This is it:
PHP Code:
public client_PreThink(id)
{
if( is_kickball && is_valid_ent(aball) && is_user_connected(id))
{
new button = entity_get_int(id, EV_INT_button)
new relode = (button & IN_RELOAD)
new usekey = (button & IN_USE)
new up = (button & IN_FORWARD)
new down = (button & IN_BACK)
new moveright = (button & IN_MOVERIGHT)
new moveleft = (button & IN_MOVELEFT)
new jump = (button & IN_JUMP)
new flags = entity_get_int(id, EV_INT_flags)
new onground = flags & FL_ONGROUND
if( (moveright || moveleft) && !up && !down && jump && onground && !g_sprint[id] && id != ballholder)
SideJump[id] = 1
if(!Coord_Off_Z_active)
{
if(onground)
{
new User_Origin[3]
get_user_origin(id, User_Origin)
Coord_Off_Z_active = 1
Coord_Off_Z = User_Origin[2] - 35
Coord_Off_Y = User_Origin[1]
}
}
if(ballholder > 0)
{
no_ball = 1
entity_set_float(aball,EV_FL_framerate,0.0)
entity_set_int(aball,EV_INT_sequence,0)
}
else
{
if(no_ball)
{
no_ball = 0
entity_set_int(aball, EV_INT_sequence, 2);
entity_set_float(aball, EV_FL_framerate, 22.0);
}
}
if(relode)
{
entity_set_float(id, EV_FL_framerate, 0.0); //FLY CHARGE
entity_set_int(id, EV_INT_sequence, 54);
entity_set_float(id, EV_FL_animtime, 1.0)
}
if(g_sprint[id])
entity_set_float(id, EV_FL_fuser2, 0.0)
if( id != ballholder )
PressedAction[id] = usekey
else
{
if( usekey && !PressedAction[id])
{
kickBall(ballholder, 0)
if(get_pcvar_num(CVAR_OFFSIDE))
Adelantado(id)
}
else if( !usekey && PressedAction[id])
PressedAction[id] = 0
}
if(soy_spec[id] || is_user_foul[id] || is_offside[id])
{
if((button & IN_ATTACK || button & IN_ATTACK2))
entity_set_int(id, EV_INT_button, (button & ~IN_ATTACK) & ~IN_ATTACK2)
}
/****************************************************************** FRAG O NO FRAG ************************************************************************/
new auxiliar = get_pcvar_num(CVAR_FRAG)
if(!auxiliar)
{
if( id != ballholder && (button & IN_ATTACK || button & IN_ATTACK2) )
{
/****************************************************************** FRAG EN AREA ************************************************************************/
static Float:maxdistance
static Float:maxdistancem
static ferencere
static distancemax
new fteam = get_user_team(id)
distancemax = Mascots[fteam]
maxdistancem = get_pcvar_float(CVAR_KILLNEARAREA)
if(ballholder > 0)
{
ferencere = ballholder
maxdistance = get_pcvar_float(CVAR_KILLNEARHOLDER)
}
else {
ferencere = aball
maxdistance = get_pcvar_float(CVAR_KILLNEARBALL)
}
if(!maxdistance)
return
if(entity_range(id, ferencere) > maxdistance && entity_range(id, distancemax) > maxdistancem)
entity_set_int(id, EV_INT_button, (button & ~IN_ATTACK) & ~IN_ATTACK2)
}
}
}
}