seroff

Anti Protector By Spawner

Sep 4th, 2016
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 KB | None | 0 0
  1. #include <amxmodx>
  2.  
  3. #define cm(%0) ( sizeof (%0) - 1 )
  4. #define g_BoolCheck(%0,%1) (%0 & (1<<%1))
  5. #define g_BoolTrue(%0,%1) (%0 |= (1<<%1))
  6. #define g_BoolFalse(%0,%1) (%0 &= ~(1<<%1))
  7.  
  8. #define clientCommand(%0,%1,%2) client_cmd(%0,%1,%2)
  9. #define timeCheck 1.0
  10. #define PUNISHTYPE 1
  11.  
  12. #define BCF 0
  13.  
  14. #define tripleExecute(%0,%1,%2) \
  15. get_user_info(id,(%0),global_check[id],cm(global_check[])); \
  16. clientCommand(id,(%1),Value_rate); \
  17. g_BoolTrue(Check_First,id); \
  18. set_task( timeCheck , (%2), id)
  19.  
  20. const Value_rate = 0x5abf
  21. const buffer1 = 0x20
  22. const buffer2 = 0x21
  23.  
  24. new Check_First,global_check[ buffer1 ][ buffer2 ];
  25.  
  26. public plugin_init(){ register_plugin("Anti Protector", "1.0", "Spawner"); }
  27.  
  28. public client_connect(id){ set_task(timeCheck + 1.0 ,"checkProtector", id ); }
  29.  
  30. public client_disconnect(id){ remove_task(id); }
  31.  
  32. public checkProtector(id){
  33. if(g_BoolCheck(Check_First,id)){
  34. new FirstInfo[ buffer1 ];
  35. get_user_info(id,"rate",FirstInfo, charsmax(FirstInfo));
  36. if( equal(global_check[id] ,FirstInfo) ){
  37. switch(PUNISHTYPE){
  38. case 1: punish_type(id,1);
  39. case 2: punish_type(id,2);
  40. }
  41. } else {
  42. g_BoolFalse(Check_First,id);
  43. clientCommand(id,"rate %d",global_check[id]);
  44. }
  45. } else {
  46. tripleExecute("rate", "rate %d", "checkProtector");
  47. }
  48. return BCF;
  49. }
  50.  
  51. stock punish_type(index,value){
  52. new iClient = get_user_userid(index);
  53. switch(value){
  54. case 1: server_cmd("kick #%d ^"Protector Detected^"", iClient);
  55. case 2: server_cmd("amx_ban 50.0 #%d ^"Protector Detected^"", iClient);
  56. }
  57. return BCF;
  58. }
Advertisement
Add Comment
Please, Sign In to add comment