Advertisement
Guest User

Bhop Checker

a guest
May 1st, 2012
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 3.91 KB | None | 0 0
  1. /* Thanks to bogdhy for giving this brilliant ideea */
  2.  
  3. #include <amxmodx>
  4. #include <amxmisc>
  5. #include <engine>
  6. #include <fakemeta>
  7.  
  8. #define PLUGIN "BunnyHop Checker"
  9. #define VERSION "1.1"
  10. #define AUTHOR "ThE_ChOSeN_OnE"
  11.  
  12. new check[33], wait[33], count[33]
  13.  
  14. public plugin_init(){
  15.     register_plugin(PLUGIN, VERSION, AUTHOR)
  16.     register_concmd("amx_bhcheck","cmdBhop",ADMIN_KICK,"- <name> Check a player if it's using BHop Hack (like BunnyFlop or KZH).")
  17.     register_concmd("amx_check","cmdBhop",ADMIN_KICK,"- <name> Check a player if it's using BHop Hack (like BunnyFlop or KZH).")
  18. }
  19.  
  20. public client_connect(id){
  21.     check[id] = 0
  22.     wait[id] = 0
  23.     count[id] = 0
  24. }
  25.  
  26. public client_disconnect(id){
  27.     new name[32], ip[32]
  28.     get_user_name(id,name,31)
  29.     get_user_ip(id,ip,31,1)
  30.     if(check[id]==1){
  31.         color_print(1,0,"!g  ## !y%s !ghas disconnected while being verified by BHop Hack Checker!",name)
  32.         log_to_file("bhophack.log", "%s [%s] has disconnected while being verified by BHop Hack Checker", name, ip)
  33.         client_cmd(id,"exec config.cfg;wait;-jump")
  34.         set_pev(id,pev_takedamage,DAMAGE_AIM)
  35.     }
  36.     check[id] = 0
  37.     wait[id] = 0
  38.     count[id] = 0
  39. }
  40.  
  41. public cmdBhop(id,level,cid){
  42.     if(!cmd_access(id,level,cid,1)) return PLUGIN_HANDLED
  43.     new arg[32], name[32], name2[32]
  44.     read_argv(1,arg,31)
  45.    
  46.     new target = cmd_target(id,arg,CMDTARGET_NO_BOTS | CMDTARGET_ALLOW_SELF | CMDTARGET_ONLY_ALIVE | CMDTARGET_OBEY_IMMUNITY)
  47.     if(!target) return PLUGIN_HANDLED
  48.    
  49.     get_user_name(id,name,31)
  50.     get_user_name(target,name2,31)
  51.    
  52.     if(check[target]==1){
  53.         client_print(id,print_console,"[AMXX] This player is already being checked, wait for results!")
  54.         return PLUGIN_HANDLED
  55.     }
  56.     if(pev(id,pev_flags)&FL_ONGROUND){
  57.         check[target] = 1
  58.         set_pev(target, pev_takedamage, DAMAGE_NO)
  59.         set_task(2.0,"client_stopCheck",target+123123)
  60.         color_print(1,0,"!g  ## !y%s !gis being checked for BHop Hack by admin !y%s!g...",name2,name)
  61.         color_print(0,target,"!y  ## You are being checked for !gBHop Hack !yby Admin !g%s!y, please wait 2 seconds!",name)
  62.         client_cmd(target,"unbindall;wait;-forward;-back;-moveleft;-moveright;-duck;-showscores;+jump")
  63.     }else client_print(id,print_console,"[AMXX] That player is not on the ground (jumping/swimming)")
  64.     return PLUGIN_CONTINUE
  65. }
  66.  
  67. public client_stopCheck(ii){
  68.     if(ii > 32) ii-=123123
  69.     if(task_exists(ii+123123)) remove_task(ii+123123)
  70.     if(!is_user_connected(ii)) return
  71.     client_cmd(ii,"exec config.cfg;wait;-jump")
  72.     check[ii] = 0
  73. }
  74.  
  75. public client_PreThink(id){
  76.     static Float:velocity[3]
  77.     if(is_user_alive(id) && !is_user_bot(id)){
  78.         if(check[id]==1 && wait[id]==0){
  79.             entity_get_vector(id,EV_VEC_velocity,velocity)
  80.             if(velocity[2]!=0){
  81.                 wait[id] = 1
  82.                 count[id]++
  83.                 if(count[id] > 1) client_stopCheck(id)
  84.             }
  85.         }
  86.         if(pev(id,pev_flags)&FL_ONGROUND && wait[id]==1) wait[id] = 0
  87.         if(!task_exists(id+123123) && count[id] > 0){
  88.             new name[32], ip[32]
  89.             get_user_name(id,name,31)
  90.             get_user_ip(id,ip,31,1)
  91.             if(count[id] > 1){
  92.                 color_print(1,0,"!team  ## !y%s !teamhas been found using !teamBHop Hack (possible KZH)",name)
  93.                 log_to_file("bhophack.log", "%s [%s] has been found using BHop Hack (possible KZH)", name, ip)
  94.             }else color_print(1,0,"!g  ## !y%s !gis not using BHop Hack!",name)
  95.             wait[id] = 0
  96.             count[id] = 0
  97.             set_pev(id,pev_takedamage,DAMAGE_AIM)
  98.         }
  99.     }
  100. }
  101.  
  102. color_print(admin=0,const id,const input[],any:...){
  103.     new count = 1, players[32]
  104.     static msg[191]
  105.     vformat(msg, 190, input, 4)
  106.     replace_all(msg, 190, "!g", "^4")
  107.     replace_all(msg, 190, "!y", "^1")
  108.     replace_all(msg, 190, "!team", "^3")
  109.  
  110.     if(id) players[0] = id; else get_players(players, count, "ch"); {
  111.         for(new i=0; i < count; i++){
  112.             if(is_user_connected(players[i])){
  113.                 if(admin==1 && !is_user_admin(players[i]))
  114.                     continue;
  115.                 message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])  
  116.                 write_byte(players[i])
  117.                 write_string(msg)
  118.                 message_end()
  119.             }
  120.         }
  121.     }
  122. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement