Whats wrong here
#7

Try this code

pawn Код:
CMD:ban(playerid, params[])
{
    if(Player[playerid] [pAdmin] >=1)
    {
        new targetid;
        new sendername[MAX_PLAYERS];
        new recievername[MAX_PLAYERS];
        new reason[50];
        new string[120];
        if(sscanf(params,"us[50]",targetid,reason)) return SendClientMessage(playerid,COLOR_RED,"[ERROR]/ban [PlayerID] [REASON]");
        GetPlayerName(playerid,sendername,sizeof(sendername)); // As Vince said, it should be done after you find out who the target player is.
        GetPlayerName(targetid,recievername,sizeof(recievername));
        format(string,sizeof(string),"Administrator %s has banned %s reason: %s.",sendername,recievername,reason);
        SendClientMessageToAll(COLOR_RED,string);
        SavePlayer(targetid);
        Ban(targetid);
    }
    else
    {
        SendClientMessage(playerid,COLOR_RED,"[SERVER]:You are not allowed to use this command");
    }
    return 1;
}
Reply


Messages In This Thread
Whats wrong here - by Gogeta101 - 14.09.2014, 14:18
Re: Whats wrong here - by IceBilizard - 14.09.2014, 14:24
Re: Whats wrong here - by Gogeta101 - 14.09.2014, 14:46
Re: Whats wrong here - by IceBilizard - 14.09.2014, 14:48
Re: Whats wrong here - by Vince - 14.09.2014, 14:57
Re : Whats wrong here - by Chipardeur - 14.09.2014, 14:58
Re: Whats wrong here - by Affan - 14.09.2014, 15:04

Forum Jump:


Users browsing this thread: 1 Guest(s)