PHP код:
stock jBan(player_banned, player_banner, reason[], time = 0, system = 0)
{
if(system == 0)
{
if(strlen(reason) > MAX_REASON_LENGTH) return SendClientMessage(player_banner, 0xFFFFFF, ""chat" Sorry, the maximum reason length is "#MAX_REASON_LENGTH" characters!");
if(gotBanned[player_banned] == 0)
{
format(jQuery, MAX_QUERY_LENGTH, "INSERT INTO `"#samp_ban"` (user_banned, user_banned_ip, user_banner, ban_reason, ban_timestamp, ban_time) VALUES ('%s', '%s', 'System', '%s', CURRENT_TIMESTAMP, %d)", jNames[player_banned], jIP[player_banned], reason, time);
mysql_tquery(handle, jQuery, "", "");
format(jQuery, MAX_QUERY_LENGTH, "INSERT INTO `"#sanctionlog"` (Username, Targetname, Comanda, Motivul, Data) VALUES ('%s', '%s', 'BAN', '%s', CURRENT_TIMESTAMP)",jNames[player_banner], jNames[player_banned], ban_reason);
mysql_tquery(handle, jQuery, "", "");
format(jQuery, MAX_QUERY_LENGTH, "INSERT INTO `"#sanctionlog"` (Username, Targetname, Comanda, Motivul, Data) VALUES ('%s', '%s', 'TBAN', '%s', CURRENT_TIMESTAMP)",jNames[player_banner], jNames[player_banned], ban_reason);
mysql_tquery(handle, jQuery, "", "");
gotBanned[player_banned] = 1;
new strkick[180];
format(strkick, sizeof(strkick), ""chat" Antichat %s (%i) for: %s", PlayerName(player_banned), player_banned, reason);
SendClientMessage(player_banned, -1, ""chat""COL_WHITE" If you feel like this is a mistake please, visit website (Ban Appeals)");
SendClientMessageToAll(-1, strkick);
SetTimerEx("DelayedBan", 1000, false, "i", player_banned);
printf(jQuery);
}
}
else
{
if(strlen(reason) > MAX_REASON_LENGTH) return SendClientMessage(player_banner, 0xFFFFFF, ""chat" Sorry, the maximum reason length is "#MAX_REASON_LENGTH" characters!");
if(gotBanned[player_banned] == 0)
{
format(jQuery, MAX_QUERY_LENGTH, "INSERT INTO `"#sanctionlog"` (Username, Targetname, Comanda, Motivul, Data) VALUES ('%s', '%s', 'BAN', '%s', CURRENT_TIMESTAMP)",jNames[player_banner], jNames[player_banned], ban_reason);
mysql_tquery(handle, jQuery, "", "");
format(jQuery, MAX_QUERY_LENGTH, "INSERT INTO `"#sanctionlog"` (Username, Targetname, Comanda, Motivul, Durata, Data) VALUES ('%s', '%s', 'TBAN', '%s', '%s', CURRENT_TIMESTAMP)",jNames[player_banner], jNames[player_banned], time, ban_reason);
mysql_tquery(handle, jQuery, "", "");
gotBanned[player_banned] = 1;
format(jQuery, MAX_QUERY_LENGTH, "INSERT INTO `samp_ban` (user_banned, user_banned_ip, user_banner, ban_reason, ban_timestamp, ban_time) VALUES ('%s', '%s', '%s', '%s', CURRENT_TIMESTAMP, %d)", jNames[player_banned], jIP[player_banned], jNames[player_banner], reason, time);
mysql_tquery(handle, jQuery, "", "");
printf(jQuery);
pInfo[player_banned][Mesaj4] = 1;
SaveStats(ban_target);
SetTimerEx("DelayedBan", 1000, false, "i", player_banned);
}
}
return 1;
}