Hi, I write this code to my surf server but if i have godmode the players can kill me with knife.
Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
#define PLUGIN "No kill"
#define VERSION "1.0"
#define AUTHOR "ILUSION"
new g_godmode[33]
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("amx_god", "cmdGod", ADMIN_KICK, "<nick>")
}
public cmdGod(id, level, cid)
{
if(!cmd_access(id,level,cid,2))
return PLUGIN_HANDLED
new arg[32]
read_argv(1, arg, 31)
new target = cmd_target(id, arg, CMDTARGET_ALLOW_SELF)
if (!target) return PLUGIN_HANDLED
new name[32]
get_user_name(target, name, 31)
if (!g_godmode[target])
{
set_user_hitzones(0, target, 0)
client_print(0, print_chat, "%s ahora tiene godmode", name)
g_godmode[target] = true
}
else
{
set_user_hitzones(0, target, 255)
client_print(0, print_chat, "%s ahora no tiene godmode", name)
g_godmode[target] = false
}
return PLUGIN_HANDLED
}