HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. #include <amxmodx>
  2. #include <cstrike>
  3. #include <hudchat> // Credits to "Exolent"! His include.;)
  4.  
  5. #define PLUGIN "HUD Team Chat"
  6. #define VERSION "0.1"
  7. #define AUTHOR "Exolent, Black Rose, Koneuka"
  8.  
  9. new cvar_HTeamChat
  10.  
  11. public plugin_init() {
  12. register_plugin(PLUGIN, VERSION, AUTHOR)
  13.  
  14. cvar_HTeamChat = register_cvar( "hudteamchat", "1")
  15.  
  16. register_clcmd("say_team", "HUDTeamChat")
  17.  
  18. hudchat_init()
  19. hudchat_set_color(255, 255, 255)
  20. }
  21.  
  22. public plugin_end()
  23. {
  24. hudchat_end()
  25. }
  26.  
  27. public client_disconnect(id)
  28. {
  29. hudchat_clear(id)
  30. }
  31.  
  32. public HUDTeamChat(id)
  33. {
  34. if (get_pcvar_num(cvar_HTeamChat))
  35. {
  36. static say_args[128]
  37. read_args(say_args, 127)
  38. remove_quotes(say_args)
  39. trim(say_args)
  40.  
  41. if(! say_args[0]) // Credits to "Black Rose"! His code.;)
  42. return PLUGIN_HANDLED
  43.  
  44. new SenderAlive = is_user_alive(id)
  45. new Players[32], PlayersNum, tempPlayer
  46. get_players(Players, PlayersNum, "c")
  47.  
  48. new name[32]
  49. get_user_name(id, name, 31)
  50.  
  51. for(new i ; i < PlayersNum ; i++)
  52. {
  53. tempPlayer = Players[i]
  54.  
  55. if (SenderAlive == is_user_alive(tempPlayer) && cs_get_user_team(id) == cs_get_user_team(tempPlayer))
  56. {
  57. hudchat_show(tempPlayer, "%s : %s",name, say_args);
  58. hudchat_update(tempPlayer);
  59. }
  60. }
  61. return PLUGIN_HANDLED_MAIN
  62. }
  63. return PLUGIN_CONTINUE
  64. }
  65. /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
  66. *{\\ rtf1\\ ansi\\ ansicpg1252\\ deff0{\\ fonttbl{\\ f0\\ fnil\\ fcharset0 Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1037\\ f0\\ fs16 \n\\ par }
  67. */
  68.