SA-MP Forums Archive
Help me please. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help me please. (/showthread.php?tid=532937)



Help me please. - Simou - 21.08.2014

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 !


Re: Help me please. - MicroD - 21.08.2014

Код:
EventTime = ammount;



Re: Help me please. - ball - 21.08.2014

Код:
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