Help me please.
#1

pawn Код:
CMD:SpawnTime(playerid, params[])
{
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pAdmin] >= 1)
            {
            new ammount;
            if(sscanf(params,"n", ammount)) return SendClientMessage(playerid, -1,""); // If player didn't enter numerical ammont
Now I want that the command work only with /spawntime number 5 and 100, How can I do this ?
And please, When for exemple he do /spawntime 5, it will put this
pawn Код:
EventTime = 5;
And when he put 100
pawn Код:
EventTime = 100;
Thanks !
Reply
#2

Код:
EventTime = ammount;
Reply
#3

Код:
CMD:spawntime(playerid, params[])
{
    new theNumber = strval(params);

    if((theNumber == 5 || theNumber == 100) && PlayerInfo[playerid][pAdmin] >= 1)
    {
        EventTime = theNumber;
    }
    return 1;
}
Don't use sscanf for one argument
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)