Command of Roll numbers - 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: Command of Roll numbers (
/showthread.php?tid=515903)
Command of Roll numbers -
Clad - 28.05.2014
Hello brothers,
Today I'm having some issue in making a command so I want from you a favour and do it for me, It's quite simple but hard for me I don't know why !
My command is like this : /rollnumbers [From] [to]
In place of from and to you make numbers ex : /rollnumbers 5 50 and the server will show GameText to players rolling number randomly and it choose a number from 5 to 50,
Thanks !
Re: Command of Roll numbers -
Clad - 28.05.2014
Anyone help pls ?
Re : Command of Roll numbers -
S4t3K - 28.05.2014
EDIT : Out of topic, I didn't understand very well and I apologize.
Re: Command of Roll numbers -
Threshold - 28.05.2014
Example:
pawn Код:
CMD:rollnumbers(playerid, params[])
{
new min, max;
if(sscanf(params, "ii", min, max)) return SendClientMessage(playerid, -1, "USAGE: /random [from] [to]");
if(min > max) new var = min, min = max, max = var;
new str[65];
format(str, sizeof(str), "Number Rolled Between %d and %d: %d", min, max, (random(max - min + 1) + min));
SendClientMessage(playerid, 0xFFFF00FF, str);
return 1;
}
The above would also work, but you shouldn't use the "uu" sscanf parameters like Ralfie suggested.