sscanf - optional number?
#1

How do you have an optional number with sscanf?

I have,
pawn Код:
new action[128], item[128], amount;
   
    if(sscanf(params, "s[128]z[128]d", action, item, amount))
    {
        SendClientMessage(playerid, COLOR_GREY, "* Usuage: /car [syntax]");
        SendClientMessage(playerid, COLOR_GRAD2, "* Syntax: Check");
        SendClientMessage(playerid, COLOR_GRAD3, "* Syntax: Put - pot crack mats weapon");
        SendClientMessage(playerid, COLOR_GRAD4, "* Syntax: Get - pot crack mats weapon");
        return 1;
    }
And then,
pawn Код:
if(strcmp(action, "check") == 0)
    {
        if(!amount)
        {
            new pot, crack, mats, gun1, gun2, gun3;
            pot = CarInfo[car][vPot], crack = CarInfo[car][vCrack], mats = CarInfo[car][vMats];
            SendClientMessage(playerid, COLOR_GREY, "__________ Car Storage __________");
            format(string, sizeof(string), "Crack: %d - Pot: %d - Materials: %d", crack, pot, mats);
            SendClientMessage(playerid, COLOR_GRAD2, string);
        }
        return 1;
    }
But if I do /car check then it doesn't work..
Reply


Messages In This Thread
sscanf - optional number? - by Jack_Leslie - 07.10.2011, 07:25
Re: sscanf - optional number? - by [MWR]Blood - 07.10.2011, 07:28
Re: sscanf - optional number? - by Jack_Leslie - 07.10.2011, 07:36
Re: sscanf - optional number? - by iggy1 - 07.10.2011, 07:39
Re: sscanf - optional number? - by [MWR]Blood - 07.10.2011, 07:39
Re: sscanf - optional number? - by iggy1 - 07.10.2011, 07:42
Re: sscanf - optional number? - by Jack_Leslie - 07.10.2011, 07:46
Re: sscanf - optional number? - by iggy1 - 07.10.2011, 07:48
Re: sscanf - optional number? - by Jack_Leslie - 07.10.2011, 07:58

Forum Jump:


Users browsing this thread: 1 Guest(s)