Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Thanks to bogdhy for giving this brilliant ideea */
- #include <amxmodx>
- #include <amxmisc>
- #include <engine>
- #include <fakemeta>
- #define PLUGIN "BunnyHop Checker"
- #define VERSION "1.1"
- #define AUTHOR "ThE_ChOSeN_OnE"
- new check[33], wait[33], count[33]
- public plugin_init(){
- register_plugin(PLUGIN, VERSION, AUTHOR)
- register_concmd("amx_bhcheck","cmdBhop",ADMIN_KICK,"- <name> Check a player if it's using BHop Hack (like BunnyFlop or KZH).")
- register_concmd("amx_check","cmdBhop",ADMIN_KICK,"- <name> Check a player if it's using BHop Hack (like BunnyFlop or KZH).")
- }
- public client_connect(id){
- check[id] = 0
- wait[id] = 0
- count[id] = 0
- }
- public client_disconnect(id){
- new name[32], ip[32]
- get_user_name(id,name,31)
- get_user_ip(id,ip,31,1)
- if(check[id]==1){
- color_print(1,0,"!g ## !y%s !ghas disconnected while being verified by BHop Hack Checker!",name)
- log_to_file("bhophack.log", "%s [%s] has disconnected while being verified by BHop Hack Checker", name, ip)
- client_cmd(id,"exec config.cfg;wait;-jump")
- set_pev(id,pev_takedamage,DAMAGE_AIM)
- }
- check[id] = 0
- wait[id] = 0
- count[id] = 0
- }
- public cmdBhop(id,level,cid){
- if(!cmd_access(id,level,cid,1)) return PLUGIN_HANDLED
- new arg[32], name[32], name2[32]
- read_argv(1,arg,31)
- new target = cmd_target(id,arg,CMDTARGET_NO_BOTS | CMDTARGET_ALLOW_SELF | CMDTARGET_ONLY_ALIVE | CMDTARGET_OBEY_IMMUNITY)
- if(!target) return PLUGIN_HANDLED
- get_user_name(id,name,31)
- get_user_name(target,name2,31)
- if(check[target]==1){
- client_print(id,print_console,"[AMXX] This player is already being checked, wait for results!")
- return PLUGIN_HANDLED
- }
- if(pev(id,pev_flags)&FL_ONGROUND){
- check[target] = 1
- set_pev(target, pev_takedamage, DAMAGE_NO)
- set_task(2.0,"client_stopCheck",target+123123)
- color_print(1,0,"!g ## !y%s !gis being checked for BHop Hack by admin !y%s!g...",name2,name)
- color_print(0,target,"!y ## You are being checked for !gBHop Hack !yby Admin !g%s!y, please wait 2 seconds!",name)
- client_cmd(target,"unbindall;wait;-forward;-back;-moveleft;-moveright;-duck;-showscores;+jump")
- }else client_print(id,print_console,"[AMXX] That player is not on the ground (jumping/swimming)")
- return PLUGIN_CONTINUE
- }
- public client_stopCheck(ii){
- if(ii > 32) ii-=123123
- if(task_exists(ii+123123)) remove_task(ii+123123)
- if(!is_user_connected(ii)) return
- client_cmd(ii,"exec config.cfg;wait;-jump")
- check[ii] = 0
- }
- public client_PreThink(id){
- static Float:velocity[3]
- if(is_user_alive(id) && !is_user_bot(id)){
- if(check[id]==1 && wait[id]==0){
- entity_get_vector(id,EV_VEC_velocity,velocity)
- if(velocity[2]!=0){
- wait[id] = 1
- count[id]++
- if(count[id] > 1) client_stopCheck(id)
- }
- }
- if(pev(id,pev_flags)&FL_ONGROUND && wait[id]==1) wait[id] = 0
- if(!task_exists(id+123123) && count[id] > 0){
- new name[32], ip[32]
- get_user_name(id,name,31)
- get_user_ip(id,ip,31,1)
- if(count[id] > 1){
- color_print(1,0,"!team ## !y%s !teamhas been found using !teamBHop Hack (possible KZH)",name)
- log_to_file("bhophack.log", "%s [%s] has been found using BHop Hack (possible KZH)", name, ip)
- }else color_print(1,0,"!g ## !y%s !gis not using BHop Hack!",name)
- wait[id] = 0
- count[id] = 0
- set_pev(id,pev_takedamage,DAMAGE_AIM)
- }
- }
- }
- color_print(admin=0,const id,const input[],any:...){
- new count = 1, players[32]
- static msg[191]
- vformat(msg, 190, input, 4)
- replace_all(msg, 190, "!g", "^4")
- replace_all(msg, 190, "!y", "^1")
- replace_all(msg, 190, "!team", "^3")
- if(id) players[0] = id; else get_players(players, count, "ch"); {
- for(new i=0; i < count; i++){
- if(is_user_connected(players[i])){
- if(admin==1 && !is_user_admin(players[i]))
- continue;
- message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
- write_byte(players[i])
- write_string(msg)
- message_end()
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement