PHP Code:
#include <amxmodx>
#include <engine>
#define FL_WATERJUMP (1<<11) // player jumping out of water
#define FL_ONGROUND (1<<9) // At rest / on the ground
new bool:bhopOn[33];
public plugin_init() {
register_plugin("Super Bunny Hopper", "1.2", "Cheesy Peteza")
register_cvar("sbhopper_version", "1.2", FCVAR_SERVER)
register_clcmd( "say /on", "itsOn" );
register_clcmd( "say /off", "itsOff" );
}
public itsOn( id )
{
if( bhopOn[id] )
{
client_print( id, print_chat, "Auto bhop is already on for you!" );
return PLUGIN_HANDLED;
}
bhopOn[id] = true;
new name[32];
get_user_name( id, name, 31 );
client_print( 0, print_chat, "%s has turned on auto bunnyhop!", name );
return PLUGIN_HANDLED;
}
public itsOff( id )
{
if( !bhopOn[id] )
{
client_print( id, print_chat, "Auto bhop is already off for you!" );
return PLUGIN_HANDLED;
}
bhopOn[id] = false;
client_print( id, print_chat, "You have successfully turned auto bhop off." );
return PLUGIN_HANDLED;
}
public client_PreThink(id)
{
if( !bhopOn[id] )
return PLUGIN_HANDLED;
entity_set_float(id, EV_FL_fuser2, 0.0)
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
}
^CheesyPeteza's bunnyhop plugin.
__________________