Help with ban system.
#8

Quote:
Originally Posted by budelis
Посмотреть сообщение
Yes how to make with sscanf?
pawn Код:
// Ban command created with zcmd and sscanf2.
CMD:ban( playerid, params[ ] )
{
    new ID, string[128], reason[64];
    if(!IsPlayerAdmin(playerid)) return 0; // Only rcon admins can use this command.
    if(sscanf(params, "uS(No Reason)[64]", ID, reason)) return SendClientMessage(playerid, -1, "USAGE: /ban [PlayerID] [reason]");
    else
    {
        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 , -1, string);
            format(string, sizeof(string), "You have Banned \"%s\" Reason: %s", pName(ID), reason);
            SendClientMessage(playerid, -1 , string);
            format(string, sizeof(string), "Administrator \"%s\" has Banned \"%s\" Reason: %s",pName(playerid),pName(ID),reason);
            SendClientMessageToAll( -1 , string );
            Ban(ID);
        }
        else return SendClientMessage(playerid, -1, "Player is not connected or is yourself");
    }
    return 1;
}
// Somewhere in your script.
stock pName(playerid)
{
    new Name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, Name, sizeof(Name));
    return Name;
}
Reply


Messages In This Thread
Help with ban system. - by budelis - 30.07.2011, 13:44
Re: Help with ban system. - by Runedog48 - 30.07.2011, 13:48
Re: Help with ban system. - by budelis - 30.07.2011, 14:07
Re: Help with ban system. - by rjjj - 30.07.2011, 14:58
Re: Help with ban system. - by [MWR]Blood - 30.07.2011, 15:48
Re: Help with ban system. - by budelis - 30.07.2011, 16:28
AW: Help with ban system. - by samtey - 30.07.2011, 17:36
Re: Help with ban system. - by HyperZ - 30.07.2011, 18:51
Re: Help with ban system. - by Rafa - 30.07.2011, 18:58
Re: Help with ban system. - by budelis - 30.07.2011, 20:56

Forum Jump:


Users browsing this thread: 2 Guest(s)