/*
*
* Original Code Author: Cheesy Peteza
* Modifed: PoYRaZ (www.cgturk.net)
* Description: Enable bunny hopping in Counter-Strike.
*
* Cvars:
* bh_enabled 1 to enable this plugin, 0 to disable.
* bh_autojump If set to 1 players just need to hold down jump to bunny hop (no skill required)
* bh_showusage If set to 1 it will inform joining players that bunny hopping has been enabled
* and how to use it if bh_autojump enabled.
*
* Requirements: AMXModX 0.16 or greater
*
*
*
*/
#include <amxmodx>
#include <amxmisc>
#include <engine>
#define FL_WATERJUMP (1<<11)
#define FL_ONGROUND (1<<9)
new oyuncular[33]
public plugin_init() {
register_plugin("Tavsan", "1.0", "Phobia")
register_cvar("sbhopper_version", "1.0", FCVAR_SERVER)
register_concmd("amx_zipzip","zipzip",ADMIN_KICK,"amx_zipzip name or #id")
register_cvar("bh_enabled", "1")
register_cvar("bh_autojump", "1")
register_cvar("bh_showusage", "1")
}
public client_PreThink(id) {
if(oyuncular[id]!=1)
return PLUGIN_CONTINUE
if (!get_cvar_num("bh_enabled"))
return PLUGIN_CONTINUE
entity_set_float(id, EV_FL_fuser2, 0.0)
if (!get_cvar_num("bh_autojump"))
return PLUGIN_CONTINUE
if (entity_get_int(id, EV_INT_button) & 2) {
new flags = entity_get_int(id, EV_INT_flags)
if (flags & FL_WATERJUMP)
return PLUGIN_CONTINUE
if ( entity_get_int(id, EV_INT_waterlevel) >= 2 )
return PLUGIN_CONTINUE
if ( !(flags & FL_ONGROUND) )
return PLUGIN_CONTINUE
new Float:velocity[3]
entity_get_vector(id, EV_VEC_velocity, velocity)
velocity[2] += 250.0
entity_set_vector(id, EV_VEC_velocity, velocity)
entity_set_int(id, EV_INT_gaitsequence, 6)
}
return PLUGIN_CONTINUE
}
public zipzip(id) {
new arg[32],vID
read_argv(1,arg,31)
vID = cmd_target(id,arg,2)
if(oyuncular[vID]!=1)
{
oyuncular[vID]=1
}else{
oyuncular[vID]=0
}
}