HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. #include <amxmodx>
  2. #include <cstrike>
  3. #include <zombieplague>
  4. #include <colorchat>
  5.  
  6. new players[33][32]
  7. new num[33]
  8.  
  9. public plugin_init()
  10. {
  11. // Register the plugin
  12. register_plugin("[ZP] Classes In Chat", "1.0", "@bdul!")
  13.  
  14. // Client say commands
  15. register_clcmd("say", "hook_say")
  16. register_clcmd("say_team", "hook_team_say")
  17. }
  18.  
  19. public hook_say(id)
  20. {
  21. // Process what he is speaking
  22. new chat[192]
  23. read_args(chat, 191)
  24. remove_quotes(chat)
  25.  
  26. // Get his name
  27. new name[32]
  28. get_user_name(id, name, 31)
  29.  
  30. // Get his team
  31. new CsTeams:userteam = cs_get_user_team(id)
  32.  
  33. // If he has written nothing then return
  34. if(equal(chat, ""))
  35. return PLUGIN_HANDLED
  36.  
  37. // Check if he is alive
  38. if (is_user_alive(id))
  39. {
  40. // He is a zombie
  41. if (zp_get_user_zombie(id))
  42. {
  43. if (zp_get_user_nemesis(id))
  44. {
  45. ColorChat(0, RED, "[Nemesis] ^x04%s^x01: %s", name, chat);
  46. }
  47. else
  48. {
  49. ColorChat(0, RED, "[Zombie] ^x04%s^x01: %s", name, chat);
  50. }
  51. }
  52. // This means he is a human
  53. else
  54. {
  55. if (zp_get_user_survivor(id))
  56. {
  57. ColorChat(0, BLUE, "[Tulelo] ^x04%s^x01: %s", name, chat);
  58. }
  59. else
  60. {
  61. ColorChat(0, BLUE, "[Ember] ^x04%s^x01: %s", name, chat);
  62. }
  63. }
  64. }
  65. // He is dead
  66. else if (!is_user_alive(id) && userteam != CS_TEAM_SPECTATOR)
  67. {
  68. ColorChat(0, GREY, "[Halott] ^x04%s^x01: %s", name, chat);
  69. }
  70. // Else he is a spectator
  71. else
  72. {
  73. ColorChat(0, GREY, "[Nezo] ^x04%s^x01: %s", name, chat);
  74. }
  75. return PLUGIN_HANDLED
  76. }
  77.  
  78. public hook_team_say(id)
  79. {
  80. // Process his team say
  81. new chat[192]
  82. read_args(chat, 191)
  83. remove_quotes(chat)
  84.  
  85. // Get his Name
  86. new name[32], team[32]
  87. get_user_name(id, name, 31)
  88.  
  89. // He has written nothing then return
  90. if(equal(chat, ""))
  91. return PLUGIN_HANDLED
  92.  
  93. // Get his team
  94. new CsTeams:userteam =cs_get_user_team(id)
  95.  
  96. // He is a zombie
  97. if (zp_get_user_zombie(id))
  98. {
  99. if (get_players(players[id], num[id], _, "TERRORIST"))
  100. {
  101. if (zp_get_user_nemesis(id))
  102. team = "[Nemesis]"
  103. else
  104. team = "[Zombie]"
  105. }
  106. }
  107. // Else he is a human
  108. else
  109. {
  110. if (get_players(players[id], num[id], _, "CT"))
  111. {
  112. if (zp_get_user_survivor(id))
  113. team = "[Survivor]"
  114. else
  115. team = "[Human]"
  116. }
  117. }
  118.  
  119. // Start the loop
  120. for (new a = 0; a < num[id]; ++a)
  121. {
  122. new i = players[id][a]
  123.  
  124. // He is alive
  125. if (is_user_alive(id))
  126. {
  127. if (zp_get_user_zombie(id))
  128. ColorChat(i, RED, "%s^x04(Team Message) %s^x01: %s",team, name, chat);
  129. else
  130. ColorChat(i, BLUE, "%s^x04(Team Message) %s^x01: %s",team, name, chat);
  131. }
  132. // Else he dead
  133. else if (!is_user_alive(id) && userteam != CS_TEAM_SPECTATOR)
  134. {
  135. ColorChat(i, GREY, "[Halott]^x04(Team Message) ^x03%s^x01: %s", name, chat);
  136. }
  137. // Else he is a spectator
  138. else
  139. {
  140. ColorChat(i, GREY, "[Nezo]^x04(Team Message) ^x03%s^x01: %s", name, chat);
  141. }
  142. }
  143. return PLUGIN_HANDLED
  144. }
  145.