09.01.2013, 19:30
Hi, I got a rather easy question right here. So, I'm trying to scan the input lotto number and print it out.
Here's the code:
However, it doesn't print out my input, like 1,2 or whatever. It prints some weird stuff like 1951519. Why's that?
Here's the code:
Код:
COMMAND:lotto(playerid, params[]) { new Number; sscanf(params, "d", Number); if(Number < 1) { SendClientMessage(playerid, 0x10F441AA, "USAGE: /lotto (1-100)"); return 1; } if(Number > 100) { SendClientMessage(playerid, 0x10F441AA, "USAGE: /lotto (1-100)"); return 1; } SendClientMessage(playerid, 0x10F441AA, "Your lotto number is: %d"); SendClientMessage(playerid, 0x10F441AA, "You have purchased a lotto ticket!"); SendClientMessage(playerid, 0x10F441AA, "Wait for the draw.. Good luck!"); return 1; }