Hello guys im new on Allied Modders, Im polish and i need help with /gravity for VIP's.
So I'v searched everywhere and I managed to find it but there are a few things I would like to change.
This is what i found, it works fine but it resets in new round, and you need to type it in two times before
enableing it.
I need:
-type /gravity or /grav to enable or disable gravity
-Dont want it to reset untill admin types in /gravity or /grav again
Thank you all for your help and time, im sorry if there are some spelling mistakes as i sed im from poland and english is my second language
Here:
https://forums.alliedmods.net/showthread.php?p=847780
Code:
#include <amxmodx>
#include <fun>
#define MAX_PLAYERS 32
#define ADMIN_LEVEL ADMIN_SLAY
#define ADMIN_GRAV 250.0
new g_bHasGrav[MAX_PLAYERS+1]
new sv_gravity
public plugin_init()
{
sv_gravity = get_cvar_pointer("sv_gravity")
register_clcmd("say /grav", "cmdGrav", ADMIN_LEVEL)
register_clcmd("say /gravity", "cmdGrav", ADMIN_LEVEL)
}
public client_putinserver(id)
{
g_bHasGrav[id] = false
}
public cmdGrav(id)
{
if( get_user_flags(id) & ADMIN_LEVEL )
{
if( (g_bHasGrav[id] = !g_bHasGrav[id]) )
{
set_user_gravity(id, ADMIN_GRAV / get_pcvar_float(sv_gravity))
client_print(id, print_chat, " * You Have Enabled Low Gravity")
}
else
{
set_user_gravity(id)
client_print(id, print_chat, " * You Have Disabled Low Gravity")
}
}
return PLUGIN_HANDLED
}