Hello all!
Who can help me and fix it? I need, if an admin say in
chat, but not in
console:
- .kick <username> - and <username> will be kicked.
I have scripted, but it doesn't works. Here is a code:
Code:
/* Edited Code */
/* ********* */
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "Kick Plugin"
#define VERSION "0.1"
#define AUTHOR "D3v1L"
#define ACCESS ADMIN_KICK
#define PREFIX "[NEF]"
new g_kickCmd[] = ".kick"
new g_fCvarMsg
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say", "cmd_Kick")
g_fCvarMsg = register_cvar("amx_show_msg_1all_0id", "1")
}
public cmd_Kick(id)
{
new args[32]
read_args(args, charsmax(args))
new target = cmd_target(id, args, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_ALLOW_SELF)
if (!target)
return PLUGIN_CONTINUE
new admin_name[32], target_name[32]
get_user_name(id, admin_name, charsmax(admin_name))
get_user_name(target, target_name, charsmax(target_name))
new fix[192]
format(fix, charsmax(fix), "%s", target)
if (containi(args, g_kickCmd) != -1 && containi(args, fix) != -1)
{
if (!access(id, ACCESS))
{
client_print(id, print_chat, "%s You have no access to that command.", PREFIX)
return PLUGIN_HANDLED
}
server_cmd("kick #%d", get_user_userid(target))
client_print(get_pcvar_num(g_fCvarMsg) ? 0 : id, print_chat, "%s Admin %s: kicked %s", PREFIX, admin_name, target_name)
}
return PLUGIN_CONTINUE
}
Sorry for my very bad english.
Thanks for all!