/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <engine>
#define PLUGIN "Bunny Hope"
#define VERSION "1.0"
#define AUTHOR "AUTHOR"
new bh_on, bool:wlaczyl[33];
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
bh_on = register_cvar("bh_wlaczony","1")
register_clcmd("say /bh", "bunny")
}
public bunny(id) {
if(wlaczyl[id]){
wlaczyl[id] = false
} else {
wlaczyl[id] = true
}
return PLUGIN_CONTINUE
}
public client_PreThink(id)
{
if(wlaczyl[id])
{
if (get_pcvar_num(bh_on))
return PLUGIN_CONTINUE
entity_set_float(id, EV_FL_fuser2, 0.0) // Disable slow down after jumping
if (entity_get_int(id, EV_INT_button) & 2) { // If holding jump
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) // Play the Jump Animation
}
}
return PLUGIN_HANDLED
}