PHP Code:
public check_player_(failstate, Handle:query, error[], errnum, data[], size)
{
new id = data[0]
if (failstate) {
new szQuery[256]
MySqlX_ThreadError( szQuery, error, errnum, failstate, 17 )
}
else {
if(!SQL_NumResults(query))
return PLUGIN_HANDLED
new ban_length[50], ban_reason[255], admin_nick[100],admin_steamid[50],admin_ip[30],ban_type[4]
new player_nick[50],player_steamid[50],player_ip[30],server_name[100],server_ip[30]
new bid = SQL_ReadResult(query, 0)
new ban_created = SQL_ReadResult(query, 1)
SQL_ReadResult(query, 2, ban_length, 49)
SQL_ReadResult(query, 3, ban_reason, 254)
SQL_ReadResult(query, 4, admin_nick, 99)
SQL_ReadResult(query, 5, admin_steamid, 49)
SQL_ReadResult(query, 6, admin_ip, 29)
SQL_ReadResult(query, 7, player_nick, 49)
SQL_ReadResult(query, 8, player_steamid, 49)
SQL_ReadResult(query, 9, player_ip, 29)
SQL_ReadResult(query, 10, server_name, 99)
SQL_ReadResult(query, 11, server_ip, 29)
SQL_ReadResult(query, 12, ban_type, 3)
if ( get_pcvar_num(amxbans_debug) == 1 )
log_amx("^nbid: %d ^nwhen: %d ^nlenght: %s ^nreason: %s ^nadmin: %s ^nadminsteamID: %s ^nPlayername %s ^nserver: %s ^nserverip: %s ^nbantype: %s",bid,ban_created,ban_length,ban_reason,admin_nick,admin_steamid,player_nick,server_name,server_ip,ban_type)
new current_time_int = get_systime(0)
new ban_length_int = str_to_num(ban_length) * 60 // in secs
new complain_url[256]
get_pcvar_string(complainurl ,complain_url,255)
client_cmd(id, "echo ^"[ViP.EE] ===============================================^"")
new show_activity = get_cvar_num("amx_show_activity")
if(get_user_flags(id)&ADMIN_LEVEL_F || id == 0)
show_activity = 1;
show_activity = 2; //eternity_
if (show_activity == 2) {
client_cmd(id, "echo ^"[ViP.EE] %L^"",LANG_PLAYER,"MSG_8", admin_nick)
} else if (show_activity == 1) {
client_cmd(id, "echo ^"[ViP.EE] %L^"",LANG_PLAYER,"MSG_9")
}
// Permanent ban
if (ban_length_int==0) {
client_cmd(id, "echo ^"[ViP.EE] %L^"",LANG_PLAYER,"MSG_10")
}
// Skaitam kad beigsies
else {
new cTimeLength[128]
new iSecondsLeft = (ban_created + ban_length_int - current_time_int)
get_time_length(id, iSecondsLeft, timeunit_seconds, cTimeLength, 127)
client_cmd(id, "echo ^"[ViP.EE] %L^"" ,LANG_PLAYER, "MSG_12", cTimeLength)
}
// Iemesls, niks
client_cmd(id, "echo ^"[ViP.EE] %L^"", LANG_PLAYER, "MSG_2", ban_reason)
client_cmd(id, "echo ^"[ViP.EE] %L^"", LANG_PLAYER, "MSG_13", player_nick)
new showip, showsteam;
new ip[32], authid[32];
get_user_ip(id,ip,31,1);
get_user_authid(id,authid,31);
if (equal(ip, player_ip)) showip = true;
else showip = false;
if (equal(authid, player_steamid)) showsteam = true;
else showsteam = false;
if ( equal("4294967295", player_steamid)
|| equal("HLTV", player_steamid)
|| equal("STEAM_ID_LAN",player_steamid)
|| equal("VALVE_ID_LAN",player_steamid)
|| equal("VALVE_ID_PENDING",player_steamid)
|| equal("STEAM_ID_PENDING",player_steamid)) {
showsteam = false;
}
if (showip && showsteam)
client_cmd(id, "echo ^"[ViP.EE] %L^"", LANG_PLAYER, "MSG_14", player_ip, player_steamid)
else if (showip)
client_cmd(id, "echo ^"[ViP.EE] %L^"", LANG_PLAYER, "MSG_5", player_ip)
else if (showsteam)
client_cmd(id, "echo ^"[ViP.EE] %L^"", LANG_PLAYER, "MSG_4", player_steamid)
// client_cmd(id, "echo ^"[ViP.EE] %L^"", LANG_PLAYER, "MSG_5", player_ip)
// client_cmd(id, "echo ^"[ViP.EE] %L^"", LANG_PLAYER, "MSG_4", player_steamid)
// client_cmd(id, "echo ^"[ViP.EE] BanID: %d^"", bid)
// client_cmd(id, "echo ^"[ViP.EE] %L^"", LANG_PLAYER, "MSG_7", complain_url)
client_cmd(id, "echo ^"[ViP.EE] More info: http://www.vip.ee/bans/%d^"", bid)
// client_cmd(id, "echo ^"[ViP.EE] ===============================================^"")
// client_cmd(id, "echo ^"[ViP.EE] UNBAN: Send SMS 'TXT VIP UNBAN %d' to number 1234 (Estonia, EEK 2.50)^"", bid)
client_cmd(id, "developer 1;developer 0;disconnect;")
client_cmd(id, "disconnect")
if ( get_pcvar_num(amxbans_debug) == 1 )
log_amx("[AMXBANS DEBUG] BID:<%d> Player:<%s> <%s> connected and got disconnected, because of an active ban", bid, player_nick, player_steamid)
new id_str[3]
num_to_str(id,id_str,3)
if (is_user_connected(id)) {
if ( get_pcvar_num(amxbans_debug) == 1 )
log_amx("[AMXBANS DEBUG] still here. Kick-TASK ID1: <%d> ID2: <%s>", id, id_str)
set_task(1.1,"delayed_kick",0,id_str,3); //fixed eternity
}
return PLUGIN_HANDLED
}
return PLUGIN_HANDLED
}