HTML Code:
#include <amxmodx>
#include <fakemeta>
#include <fun>
new iGodMode[33]
public plugin_init()
{
register_plugin("PLUGIN", "VERSION", "AUTHOR")
register_forward(FM_CmdStart, "FwCmdStart")
}
public FwCmdStart(id, uc_handle, randseed)
{
if(!is_user_connected(id) || !is_user_alive(id))
return FMRES_IGNORED
static button; button = get_uc(uc_handle , UC_Buttons)
static oldbutton; oldbutton = pev(id, pev_oldbuttons)
if(button & IN_USE && !(oldbutton & IN_USE) && !iGodMode[id])
{
iGodMode[id] = true
set_user_godmode(id, true)
set_task(5.0, "RemoveGodMode", id)
client_print(id, print_chat, "GodMode ON!")
}
return FMRES_IGNORED
}
public RemoveGodMode(id)
{
if(!is_user_connected(id))
{
if(task_exists(id))
remove_task(id)
return PLUGIN_HANDLED
}
iGodMode[id] = false
set_user_godmode(id, false)
client_print(id, print_chat, "GodMode Off!")
return PLUGIN_HANDLED
}
it's a quick thing guys, it doesn't hurt to help.