28.11.2013, 19:32
i only found this
pawn Код:
stock BanPlayer(playerid, giveplayerid, time, reason[])
{
new name[24], namegive[24];
if(playerid == 501) format(name, sizeof(name), "Squidward (Anti-Cheat)");
else GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(giveplayerid, namegive, sizeof(namegive));
new curtime = gettime();
new expire;
if(!time)
{
expire = 1577836800;
}
else
{
new Float:banminutes = time * 24 * 60 * 60;
new bantime = floatround(banminutes);
expire = curtime + bantime;
}
new q[400];
new ip[16];
GetPlayerIp(giveplayerid, ip, sizeof(ip));
//AddBan(ip);
format(q, sizeof(q), "INSERT INTO bans (name, reason, ban_time, issue_time, expiry_time, admin, ip) VALUES ('%s', '%s', %d, %d, %d, '%s', '%s')", namegive, reason, time, curtime, expire, name, ip);
new string[128];
if(time)
format(STRING, "AdmCmd: %s was banned for %d days by %s: %s", GetPlayerNameEx(giveplayerid), time, GetPlayerNameEx(playerid), reason);
else
format(STRING, "AdmCmd: %s was banned permanently by %s: %s", GetPlayerNameEx(giveplayerid), name, reason);
SendClientMessageToAllEx(COLOR_LIGHTRED, string);
if(time)
format(STRING, "You were banned by Admin %s for %d days: %s", GetPlayerNameEx(playerid), time, reason);
else
format(STRING, "You were banned permanently by Admin %s: %s", name, reason);
SendClientMessage(giveplayerid, 0x00FF00FF, string);
new dialogstring[512];
ShowPlayerDialog(giveplayerid, 4564, DIALOG_STYLE_MSGBOX, "Banned!", dialogstring, "Close", "");
Kick(giveplayerid);
return 1;
}