Make a float to store the gravity:
Code:
new Float:g_fGravity[33]; // Make sure you set it to 0.0 in client_connect!
Then use the Reset HUD event:
Code:
register_event("ResetHUD", "player_spawn", "b");
In the function hooked to the event:
Code:
public player_spawn( id )
{
if(g_fGravity[id] > 0.0)
{
set_user_gravity(id, g_fGravity[id]);
}
}
Then in your gravity function:
Code:
public gravity(id, level, cid) {
if(!cmd_access(id, level, cid, 2))
return PLUGIN_HANDLED
read_argv(1, arg1, 31)
read_argv(2, arg2, 9)
new target = cmd_target(id, arg1, 15)
new Float:amount = str_to_float(arg2)/800
set_user_gravity(target, amount)
g_fGravity[id] = amount // set the amount
return PLUGIN_CONTINUE
}
__________________