28.11.2013, 19:19
Hello Guys ,i`ve a problem with /ban command ,when i do /ban the player gets kicked not banned.
if you have any idea of how to fix it post it please
Thanks
if you have any idea of how to fix it post it please
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);
return 1;
}