28.11.2013, 19:33
Just do Ban(giveplayerid);
pawn Код:
CMD:ban(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] < 2) return Error(playerid, "You are not authorized to use this command");
new giveplayerid, time, reason[64], string[128];
if(sscanf(params, "uis[64]", giveplayerid, time, reason)) return Syntax(playerid, "ban", "[playerid] [time(days) 0 = perm] [reason]");
if(!IsPlayerConnected(giveplayerid)) return Error(playerid, "Invalid player specified!");
if(playerid == giveplayerid) return Error(playerid, "You cannot ban youself.");
if(PlayerInfo[playerid][pAdmin] < PlayerInfo[giveplayerid][pAdmin]) return Error(playerid, "You cannot ban a equal or higher level admin.");
BanPlayer(playerid, giveplayerid, time, reason);
format(string, sizeof(string), "AdmCmd: %s was banned by %s for %s, reason: %s ", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), time, reason);
Log("logs/ban.log", string);
Ban(giveplayerid);
return 1;
}