Писал автору плага amxx ban snaphots чтобы он сделал меню для банов через него...сказал что это не нужно никому...короче тупит
Решил тупо скрестить с amxbans!
Помогите плиз! есть одна осталась ошибка, остальные вроде как исправил
короче взял функцию с amx_ban_snapshot
Код
public cmdBansSS(id,level,cid)
{
if (get_pcvar_num(g_BanType) !=2)
return PLUGIN_HANDLED
if(!cmd_access(id, level, cid, 2))
return PLUGIN_HANDLED
new name[32], timer[32],hostname[64], name2[32], ip[32],authid2[32], country[33], site[64]
new arg[8], arg2[32], arg3[64]
read_argv(1,arg,7)
read_argv(2,arg2,31)
read_argv(3,arg3,63)
new bantime = str_to_num(arg)
new target = cmd_target(id, arg2, 10)
new id = get_user_userid(target)
get_user_name(id, name, 31)
get_user_name(target, name2, 31)
get_user_authid(target, authid2, 31)
get_user_ip(target, ip, 31, 1)
geoip_country(ip, country)
get_time("%d/%m/%Y - %H:%M:%S", timer, 63)
get_pcvar_string(g_Hostname, hostname, charsmax(hostname))
get_pcvar_string(g_UnbanURL, site, charsmax(site))
if(!target)
return PLUGIN_HANDLED
new iMsgType = get_pcvar_num(g_MessageType);
switch( iMsgType ) {
case 1: {
/* Show screen messages in chat */
client_printc(target,"%L", target, "SS_MSG1", name)
client_printc(target,"%L", target, "SS_MSG2", timer, hostname)
client_printc(target,"%L", target, "SS_MSG3", name2, ip, authid2, country)
client_printc(target,"%L", target, "SS_MSG4", site)
}
case 2: {
/* Show screen messages in hud */
set_hudmessage(150, 0, 255, -1.0, 0.1, 0, 0.25, 1.0, 0.0, 0.0, 4)
show_hudmessage(target, "%L", target, "SS_MSG_HUD", timer, hostname, name2, ip, authid2, country, site)
}
case 3: {
/* Show screen messages in chat */
client_printc(target,"%L", target, "SS_MSG1", name)
client_printc(target,"%L", target, "SS_MSG2", timer, hostname)
client_printc(target,"%L", target, "SS_MSG3", name2, ip, authid2, country)
client_printc(target,"%L", target, "SS_MSG4", site)
/* Show screen messages in hud */
set_hudmessage(150, 0, 255, -1.0, 0.1, 0, 0.25, 1.0, 0.0, 0.0, 4)
show_hudmessage(target, "%L", target, "SS_MSG_HUD", timer, hostname, name2, ip, authid2, country, site)
}
}
client_cmd(target,"snapshot;wait;snapshot;wait;snapshot")
/* Confirm for the admin in console that the command was commited */
console_print(id,"%L", id, "SS_CONSOLE", name2)
if(bantime == 0)
{
/* Ban player permenetly */
server_cmd("amx_ban 0 #%d %s", id, arg3)
} else {
/* Ban plyer by time */
server_cmd("amx_ban %d #%d %s", bantime, id, arg3)
}
return PLUGIN_HANDLED
}
использовал часть ее в amxbans
там же в amxbans заменил ф-ю
public delayed_kick Код
public delayed_kick(id_str[])
{
new player_id = str_to_num(id_str)
new userid = get_user_userid(player_id)
new target = cmd_target(id, arg2, 10)
new id = get_user_userid(target)
new name[32], timer[32],hostname[64], name2[32], ip[32],authid2[32], country[33], site[64]
new arg[8], arg2[32], arg3[64]
read_argv(1,arg,7)
read_argv(2,arg2,31)
read_argv(3,arg3,63)
get_user_name(id, name, 31)
get_user_name(target, name2, 31)
get_user_authid(target, authid2, 31)
get_user_ip(target, ip, 31, 1)
geoip_country(ip, country)
get_time("%d/%m/%Y - %H:%M:%S", timer, 63)
get_pcvar_string(g_Hostname, hostname, charsmax(hostname))
get_pcvar_string(g_UnbanURL, site, charsmax(site))
if ( get_pcvar_num(amxbans_debug) == 1 )
log_amx("[AMXBANS DEBUG] Delayed Kick ID: <%s>", id_str)
if(!target)
return PLUGIN_HANDLED
new iMsgType = get_pcvar_num(g_MessageType);
switch( iMsgType ) {
case 1: {
/* Show screen messages in chat */
client_printc(target,"%L", target, "SS_MSG1", name)
client_printc(target,"%L", target, "SS_MSG2", timer, hostname)
client_printc(target,"%L", target, "SS_MSG3", name2, ip, authid2, country)
client_printc(target,"%L", target, "SS_MSG4", site)
}
case 2: {
/* Show screen messages in hud */
set_hudmessage(150, 0, 255, -1.0, 0.1, 0, 0.25, 1.0, 0.0, 0.0, 4)
show_hudmessage(target, "%L", target, "SS_MSG_HUD", timer, hostname, name2, ip, authid2, country, site)
}
case 3: {
/* Show screen messages in chat */
client_printc(target,"%L", target, "SS_MSG1", name)
client_printc(target,"%L", target, "SS_MSG2", timer, hostname)
client_printc(target,"%L", target, "SS_MSG3", name2, ip, authid2, country)
client_printc(target,"%L", target, "SS_MSG4", site)
/* Show screen messages in hud */
set_hudmessage(150, 0, 255, -1.0, 0.1, 0, 0.25, 1.0, 0.0, 0.0, 4)
show_hudmessage(target, "%L", target, "SS_MSG_HUD", timer, hostname, name2, ip, authid2, country, site)
}
}
client_cmd(target,"snapshot;wait;snapshot;wait;snapshot;wait;snapshot")
/* Confirm for the admin in console that the command was commited */
console_print(id,"%L", id, "SS_CONSOLE", name2)
set_task(1.0, "actual_kick", userid)
return PLUGIN_CONTINUE
}
public actual_kick(userid)
{
new kick_message[128]
format(kick_message,127,"%L", LANG_PLAYER,"KICK_MESSAGE")
server_cmd("kick #%d %s",userid, kick_message)
}
что то тут не так(( с этими
Код
new player_id = str_to_num(id_str)
new userid = get_user_userid(player_id)
new target = cmd_target(id, arg2, 10)
new id = get_user_userid(target)
в прикриплении архив с двумя плагинами! при компиле amxbanx ошибка вроде на 411 строке короче ругается на 'id'
Прикрепленные файлы:
2.rar ( 8,83 килобайт )
Кол-во скачиваний: 9