07.10.2011, 07:25
How do you have an optional number with sscanf?
I have,
And then,
But if I do /car check then it doesn't work..
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;
}
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;
}