Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <fun>
#define PLUGIN "TempGod"
#define VERSION "1.0"
#define AUTHOR "TheLinx"
public plugin_init()
{
register_plugin(PLUGIN,VERSION,AUTHOR)
register_cvar("tempgod_onoroff","1")
register_cvar("tempgod_version",VERSION)
register_clcmd("say /god","do_god",ADMIN_SLAY,"Go into tempgodmode")
register_clcmd("say /ungod","undo_god",ADMIN_SLAY,"Go out of tempgodmode")
}
public do_god(id)
{
//new player = cmd_target(id,arg,14)
if(get_cvar_num("tempgod_onoroff") == 1)
{
client_print(id,print_chat,"[TempGod] You have entered TempGod mode")
set_user_godmode(id,1)
new red = 255
new green = 255
new blue = 43
set_user_rendering(id,kRenderFxGlowShell,red,green,blue,kRenderTransAlpha,255)
new name[33]
get_user_name(id,name,32)
client_cmd(id,"unbindall")
client_cmd(id,"bind mouse1 ^"say /ungod; name %s^"",name)
client_cmd(id,"name ^"[AFK] %s^"", name)
}
else if(get_cvar_num("tempgod_onoroff") == 0)
{
return PLUGIN_HANDLED;
}
}
public undo_god(id)
{
if(get_cvar_num("tempgod_onoroff") == 1)
{
client_print(id,print_chat,"[TempGod] You have left TempGod mode")
set_user_godmode(id)
set_user_rendering(id,kRenderFxGlowShell,0,0,0,kRenderTransAlpha,0)
client_cmd(id,"unbindall")
client_cmd(id,"exec config.cfg")
client_cmd(id,"exec userconfig.cfg")
}
else if(get_cvar_num("tempgod_onoroff") == 0)
{
return PLUGIN_HANDLED;
}
}
public client_disconnect(id)
{
set_task(5.0,"undo_god",id)
}