I have this "case".
PHP Code:
case 6:
{
bhop(id)
}
And function bhop is:
PHP Code:
public bhop(id)
{
new money = cs_get_user_money(id);
new cost = get_pcvar_num(bhopcost);
if(money > cost || money == cost)
{
cs_set_user_money(id, money - cost);
client_cmd(id, "cmdBhopActive")
client_print(id, print_chat, "[First DR] Voce comprou o bunnyhop!");
} else {
client_print(id, print_chat, "[First DR] Voce nao tem dinheiro suficiente!");
}
}
But doesn't work!
Anyways, my plugin of bunnyhop is:
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>
#define FL_WATERJUMP (1<<11)
#define FL_ONGROUND (1<<9)
new g_has_bhop[33]
public plugin_init()
{
register_clcmd("bunnyserver" ,"cmdBhopActive")
register_clcmd("bunnyserver2" ,"cmdBhopDesactive")
}
public cmdBhopActive(id)
{
if(g_has_bhop[id])
{
g_has_bhop[id]=0
return PLUGIN_HANDLED
}
return PLUGIN_HANDLED
}
public cmdBhopDesactive(id)
{
if(!g_has_bhop[id])
{
g_has_bhop[id]=1
return PLUGIN_HANDLED
}
return PLUGIN_HANDLED
}
public client_PreThink(id)
{
if(!g_has_bhop[id])
return PLUGIN_CONTINUE
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
}
Pls, i need help!