Code about immunity seems ok with cmd_target.
Anyway, i've cleaned up a bit, try it now.
Make sure you have disabled default amx_slay command.
PHP Code:
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "plugin_slay"
#define VERSION "1.0"
#define AUTHOR "YANKEE"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_concmd("amx_slay", "cmdSlay", ADMIN_KICK, "<nume> - il omori")
}
public cmdSlay(id, level, cid)
{
if( cmd_access(id, level, cid, 2) )
{
new arg[32];
read_argv ( 1 , arg , charsmax(arg) )
// #define CMDTARGET_OBEY_IMMUNITY (1<<0)
// #define CMDTARGET_ALLOW_SELF (1<<1)
// #define CMDTARGET_ONLY_ALIVE (1<<2)
// #define CMDTARGET_NO_BOTS (1<<3)
// 9 is CMDTARGET_OBEY_IMMUNITY | CMDTARGET_NO_BOTS so previous code seemed to be ok
new target = cmd_target ( id , arg , CMDTARGET_OBEY_IMMUNITY | CMDTARGET_ALLOW_SELF | CMDTARGET_ONLY_ALIVE )
if( target )
{
new admin[32], name2[32]
get_user_name(id, admin, charsmax(admin));
get_user_name(target, name2, charsmax(name2));
user_kill(target, 1)
log_amx("Slay: ^"%s^" amx_slay ^"%s^"", admin, name2)
show_activity(id, admin, "foloseste comanda amx_slay %s", name2)
}
}
return PLUGIN_HANDLED
}
__________________