Advertisement
Guest User

Untitled

a guest
Nov 20th, 2019
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.74 KB | None | 0 0
  1. //##############################################################
  2. //################### ACRIDGAMER - COMMUNITY ###################
  3. //##############################################################
  4.  
  5. #include < amxmodx >
  6. #include < amxmisc >
  7.  
  8. #define PLUGIN "Tag"
  9. #define VERSION "1.0"
  10. #define AUTHOR "Author"
  11.  
  12. enum Color
  13. {
  14. NORMAL = 1,
  15. GREEN,
  16. TEAM_COLOR,
  17. GREY,
  18. RED,
  19. BLUE,
  20. }
  21.  
  22. new TeamName[ ][ ] =
  23. {
  24. "",
  25. "TERRORIST",
  26. "CT",
  27. "SPECTATOR"
  28. }
  29.  
  30. // - - - - - - - - - - -
  31.  
  32. #define GROUPS 12
  33.  
  34. new const g_Flags[ GROUPS ][ ] =
  35. {
  36. "abcdefghijklmnopqrstux",
  37. "abcdefgijklmnopqrstu",
  38. "abcdefgijklmnopqrsu",
  39. "abcdefgijlmnopqrst",
  40. "abcdefgijlmnopqrs",
  41. "bdefijmnopqt",
  42. "bcefijmnopq",
  43. "ceijmnt",
  44. "ceijmn",
  45. "abit",
  46. "bi",
  47. "z"
  48. };
  49.  
  50. new const g_Groups[ GROUPS ][ ] =
  51. {
  52. "Mos Craciun",
  53. "Ajutoru Mosului + VIP",
  54. "Ajutoru Mosului",
  55. "Crai + VIP",
  56. "Crai",
  57. "Ren + VIP",
  58. "Ren",
  59. "Spiridus + VIP",
  60. "Spiridus",
  61. "Rudolph",
  62. "Urator",
  63. "Colindator"
  64.  
  65. };
  66.  
  67. // - - - - - - - - - - -
  68.  
  69. new g_FlagsValue[ GROUPS ];
  70.  
  71. new bool:g_IsConnected[ 33 ];
  72. new SayText, TeamInfo, g_maxplayers;
  73.  
  74. public plugin_init ( )
  75. {
  76. register_plugin ( PLUGIN, VERSION, AUTHOR );
  77.  
  78. register_clcmd ( "say", "hook_say" );
  79.  
  80. for ( new i; i < GROUPS; i++ )
  81. g_FlagsValue[ i ] = read_flags ( g_Flags[ i ] );
  82.  
  83. SayText = get_user_msgid ( "SayText" );
  84. TeamInfo = get_user_msgid ( "TeamInfo" );
  85. g_maxplayers = get_maxplayers ( );
  86. }
  87.  
  88. public client_putinserver ( e_Index ) g_IsConnected[ e_Index ] = true;
  89. public client_disconnect ( e_Index ) g_IsConnected[ e_Index ] = false;
  90.  
  91. public hook_say ( e_Index )
  92. {
  93. static s_Said[ 192 ];
  94. read_args ( s_Said, charsmax ( s_Said ) );
  95.  
  96. if ( equal ( s_Said, "" ) )
  97. return PLUGIN_CONTINUE;
  98. remove_quotes ( s_Said );
  99.  
  100. static s_Name[ 32 ], i;
  101. get_user_name ( e_Index, s_Name, 31 );
  102.  
  103. for ( i = 0; i < GROUPS; i++ )
  104.  
  105. if ( get_user_flags ( e_Index ) == g_FlagsValue[ i ] )
  106. {
  107. switch ( get_user_team ( e_Index ) )
  108. {
  109. case 1: ColorChat ( 0, RED, "^1[^4%s^1]^3 %s^4 : %s", g_Groups[ i ], s_Name, s_Said );
  110.  
  111. case 2: ColorChat ( 0, BLUE, "^1[^4%s^1]^3 %s^4 : %s", g_Groups[ i ], s_Name, s_Said );
  112.  
  113. case 3: ColorChat ( 0, GREY, "^1[^4%s^1]^3 %s^4 : %s", g_Groups[ i ], s_Name, s_Said );
  114.  
  115. }
  116.  
  117. break;
  118. }
  119.  
  120. return ( i < GROUPS ) ? PLUGIN_HANDLED : PLUGIN_CONTINUE;
  121. }
  122.  
  123. public ColorChat ( id, Color:type, const msg[], { Float, Sql, Result, _ }:... )
  124. {
  125. static message[ 256 ];
  126.  
  127. switch ( type )
  128. {
  129. case NORMAL:
  130. message[ 0 ] = 0x01;
  131. case GREEN:
  132. message[ 0 ] = 0x04;
  133. default:
  134. message[ 0 ] = 0x03;
  135. }
  136.  
  137. vformat ( message[ 1 ], 251, msg, 4 );
  138. message[ 192 ] = '^0';
  139.  
  140. new team, ColorChange, index, MSG_Type;
  141.  
  142. if ( id )
  143. {
  144. MSG_Type = MSG_ONE;
  145. index = id;
  146. }
  147. else
  148. {
  149. index = FindPlayer ( );
  150. MSG_Type = MSG_ALL;
  151. }
  152.  
  153. team = get_user_team ( index );
  154. ColorChange = ColorSelection ( index, MSG_Type, type );
  155.  
  156. ShowColorMessage ( index, MSG_Type, message );
  157.  
  158. if ( ColorChange )
  159. Team_Info ( index, MSG_Type, TeamName[ team ] );
  160. }
  161.  
  162. ShowColorMessage ( id, type, message[] )
  163. {
  164. message_begin ( type, SayText, _, id );
  165. write_byte ( id )
  166. write_string ( message );
  167. message_end ( );
  168. }
  169.  
  170. Team_Info ( id, type, team[] )
  171. {
  172. message_begin ( type, TeamInfo, _, id );
  173. write_byte ( id );
  174. write_string ( team );
  175. message_end ( );
  176.  
  177. return 1;
  178. }
  179.  
  180. ColorSelection ( index, type, Color:Type )
  181. {
  182. switch ( Type )
  183. {
  184. case RED:
  185. return Team_Info ( index, type, TeamName[ 1 ] );
  186. case BLUE:
  187. return Team_Info ( index, type, TeamName[ 2 ] );
  188. case GREY:
  189. return Team_Info ( index, type, TeamName[ 0 ] );
  190. }
  191. return 0;
  192. }
  193.  
  194. public FindPlayer ( )
  195. {
  196. for ( new i = 1; i <= g_maxplayers; i++ )
  197. if ( g_IsConnected[ i ] )
  198. return i;
  199.  
  200. return -1;
  201. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement