Hello. Im working on my own jailbreak plugin. But i have one problem. See code
There is part of prethink. All is good working but when player buy both (multijump,bhop) somethink went wrong. Is there any way how solve this problem ?
Code:
public client_PreThink(id)
{
if(g_bhop == true)
{
set_pev(id, pev_fuser2, 0.0)
if(pev(id, pev_button) & 2)
{
new flags = pev(id, pev_flags)
if(flags & FL_WATERJUMP)
return PLUGIN_CONTINUE
if(pev(id, pev_waterlevel) >= 2)
return PLUGIN_CONTINUE
if(!(flags & FL_ONGROUND))
return PLUGIN_CONTINUE
new Float:velocity[3]
pev(id, pev_velocity, velocity)
velocity[2] += 260.0
set_pev(id, pev_velocity, velocity)
set_pev(id, pev_gaitsequence, 6)
}
}
if(g_multijump == true)
{
if(!is_user_alive(id)) return PLUGIN_CONTINUE
if(!(get_user_flags( id ) & ADMIN_ADMIN)) return PLUGIN_CONTINUE
new nbut = get_user_button(id)
new obut = get_user_oldbutton(id)
if((nbut & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(obut & IN_JUMP))
{
if(jumpnum[id] < 1)
{
dojump[id] = true
jumpnum[id]++
return PLUGIN_CONTINUE
}
}
if((nbut & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
{
jumpnum[id] = 0
return PLUGIN_CONTINUE
}
}
return PLUGIN_CONTINUE
}
public client_PostThink(id)
{
if(g_multijump == true)
{
if(!is_user_alive(id)) return PLUGIN_CONTINUE
if(!(get_user_flags( id ) & ACCESS_ADMIN)) return PLUGIN_CONTINUE
if(dojump[id] == true)
{
new Float:velocity[3]
entity_get_vector(id,EV_VEC_velocity,velocity)
velocity[2] = random_float(265.0,285.0)
entity_set_vector(id,EV_VEC_velocity,velocity)
dojump[id] = false
return PLUGIN_CONTINUE
}
}
return PLUGIN_CONTINUE
}