Ban Problem
#6

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;
}
Reply


Messages In This Thread
Ban Problem - by Drago987 - 28.11.2013, 19:19
Re: Ban Problem - by fiki574 - 28.11.2013, 19:26
Re: Ban Problem - by Loot - 28.11.2013, 19:28
Re: Ban Problem - by Drago987 - 28.11.2013, 19:28
Re: Ban Problem - by Drago987 - 28.11.2013, 19:32
Re: Ban Problem - by Areax - 28.11.2013, 19:33
Re: Ban Problem - by Areax - 28.11.2013, 19:37
Re: Ban Problem - by Loot - 28.11.2013, 19:43

Forum Jump:


Users browsing this thread: 3 Guest(s)