seroff

Simple Check Build 1.0 By Seroff

Jun 25th, 2016
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.78 KB | None | 0 0
  1. #include <amxmodx>
  2.  
  3. static sBuild_new[33]=0;
  4.  
  5. public plugin_init()
  6. {
  7. register_plugin("Simple Check Build","1.0","Seroff");
  8. register_clcmd("showcl","showclients");
  9. }
  10.  
  11. public client_connect(id)
  12. {
  13. sBuild_new[id]=0;
  14. set_task(3.0,"isproblem",id);
  15. set_task(0.5,"client_build",id);
  16. }
  17.  
  18. public client_build(id){
  19. query_client_cvar(id,"gl_ztrick_old","chsBuild");
  20. query_client_cvar(id,"gl_ztrick","chsBuild");
  21. }
  22.  
  23. public chsBuild(id,const szVar[],const szValue[]){
  24. if(equal(szVar,"gl_ztrick_old") && szValue[0] != 'B' || equal(szVar,"gl_ztrick") && szValue[0] == 'B' ) {
  25. sBuild_new[id]=1;
  26. }
  27. else if (equal(szVar,"gl_ztrick") && szValue[0] != 'B' || equal(szVar,"gl_ztrick_old") && szValue[0] == 'B' ) {
  28. sBuild_new[id]=2;
  29. }
  30. }
  31.  
  32. public isproblem(id){
  33. if(sBuild_new[id] == 0){
  34. new szName[33];
  35. get_user_name(id,szName,charsmax(szName));
  36. ColorChat(0,"1[^4INFINI^1] Игрок ^3%s ^1использует [^4не определяемый клиент^1]",szName);
  37. server_cmd("kick #%d ^"Ваш клиент не определился или у вас проблема с игрой!^"",get_user_userid(id));
  38. }
  39. }
  40.  
  41. public showclients(id){
  42. new players[32],inum, name[32];
  43. con_print(id,"^n=============КЛИЕНТЫ ИГРОКОВ============^n ID | Ник | Клиент");
  44. get_players(players, inum)
  45. for (new a = 0; a < inum; ++a)
  46. {
  47. get_user_name(players[a], name, sizeof(name)-1)
  48. if(sBuild_new[players[a]]==1){
  49. con_print(id,"# %d | %s | Новый",players[a],name);
  50. }
  51. if(sBuild_new[players[a]]==2){
  52. con_print(id,"# %d | %s | Старый",players[a],name);
  53. }
  54. }
  55. con_print(id,"=====================================")
  56. return 1;
  57. }
  58.  
  59.  
  60. stock ColorChat(const id, const input[], any:...)
  61. {
  62. new count = 1, players[32];
  63. static msg[191];
  64. vformat(msg, 190, input, 3);
  65.  
  66. replace_all(msg, 190, "!g", "^4"); // Зелёный
  67. replace_all(msg, 190, "!y", "^1"); // Стандартный
  68. replace_all(msg, 190, "!t", "^3"); // Цвет команды
  69.  
  70. if (id) players[0] = id; else get_players(players, count, "ch")
  71. {
  72. for (new i = 0; i < count; i++)
  73. {
  74. if (is_user_connected(players[i]))
  75. {
  76. message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
  77. write_byte(players[i]);
  78. write_string(msg);
  79. message_end();
  80. }
  81. }
  82. }
  83. }
  84.  
  85. stock con_print(id,const msg_content[],any:...){
  86. new msg[192],MSG[192];
  87. vformat(msg, charsmax(msg), msg_content, 3);
  88. formatex(MSG,charsmax(MSG),"%s^n",msg);
  89. message_begin(MSG_ONE, 8, {0,0,0}, id);
  90. write_string(MSG);
  91. message_end();
  92. }
Advertisement
Add Comment
Please, Sign In to add comment