Could this work? please answer!
#3

Use this:
pawn Код:
CMD:ban( playerid, params[ ] )
{
    new ID, string[128], reason[66];
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0x0259EAAA, "You are not admin.");
    if(sscanf(params, "uS(No Reason Given)[65]", ID, reason)) return SendClientMessage(playerid, 0x0259EAAA, "USAGE: /ban [PlayerID] [reason]");
    if(IsPlayerConnected(ID) && ID != INVALID_PLAYER_ID && ID != playerid)
    {
        format(string,sizeof(string), "You have been Banned by Administrator \"%s\" Reason: %s", pName(playerid),reason);
        SendClientMessage(ID, 0x0259EAAA, string);
        format(string, sizeof(string), "You have Banned \"%s\" Reason: %s", pName(ID), reason);
        SendClientMessage(playerid, 0x0259EAAA , string);
        format(string, sizeof(string), "Administrator \"%s\" has Banned \"%s\" Reason: %s",pName(playerid),pName(ID),reason);
        SendClientMessageToAll( 0x0259EAAA , string );
        TogglePlayerControllable(ID, false);
        Ban(ID);
    }
    else return SendClientMessage(playerid, -1, "Player is not connected or is yourself");
    return 1;
}
Somewhere in your script:
pawn Код:
stock pName(playerid)
{
    new Name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, Name, sizeof(Name));
    return Name;
}
Reply


Messages In This Thread
Could this work? please answer! - by ricardo178 - 14.03.2011, 12:55
Re: Could this work? please answer! - by Macluawn - 14.03.2011, 13:01
Re: Could this work? please answer! - by HyperZ - 14.03.2011, 13:02
Re: Could this work? please answer! - by Macluawn - 14.03.2011, 13:04
Re: Could this work? please answer! - by Markx - 14.03.2011, 13:05
Re: Could this work? please answer! - by HyperZ - 14.03.2011, 13:05
Re: Could this work? please answer! - by ricardo178 - 14.03.2011, 13:11
Re: Could this work? please answer! - by ricardo178 - 14.03.2011, 13:54

Forum Jump:


Users browsing this thread: 3 Guest(s)