09.01.2013, 17:05
Hey.
I'd recommend you to use sscanf and zcmd inc's.
Here's a working code for that:
Greetz,
LetsOWN
I'd recommend you to use sscanf and zcmd inc's.
Here's a working code for that:
pawn Код:
COMMAND:lotto(playerid, params[])
{
new Number;
if(!sscanf(params, "d", Number))
{
SendClientMessage(playerid, 0xFF0000FF, "USAGE: Lotto [1-100]"); // if they write something like: /lotto or /lotto blabla
return 1;
}
if(Number < 1 || Number > 100)
{
SendClientMessage(playerid, 0xFF0000FF, "USAGE: Lotto [1-100]"); // if they write /lotto -3; /lotto 0; /lotto 101
return 1;
}
SendClientMessage(playerid, 0x10F441AA, "You have purchased a lotto ticket!");
SendClientMessage(playerid, 0x10F441AA, "Wait for the draw.. Good luck!");
return 1;
}
LetsOWN