[Help]Simple question. - 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: [Help]Simple question. (
/showthread.php?tid=293087)
[Help]Simple question. -
moadi - 26.10.2011
Hey there,
I was wondering how can I do something such as, when a player uses a CMD he gets a random number from 1-10000 or something and the numbers mustn't be for a player same as other.
Thanks...
Re: [Help]Simple question. -
|_ⒾⓇⓄN_ⒹⓄG_| - 26.10.2011
pawn Код:
stock randomEx(min, max)
{
//Credits to ******
new rand = random(max-min)+min;
return rand;
}
Re: [Help]Simple question. -
moadi - 26.10.2011
Quote:
Originally Posted by |_ⒾⓇⓄN_ⒹⓄG_|
pawn Код:
stock randomEx(min, max) { //Credits to ****** new rand = random(max-min)+min; return rand; }
|
Mind explaining how does it work and how may I use it? thank you.
Re: [Help]Simple question. -
JiHost - 26.10.2011
Read wiki for basics on scripting. I don't think anyone will going to explain how Pawno works in details here.
wiki.sa-mp.com
Re: [Help]Simple question. -
|_ⒾⓇⓄN_ⒹⓄG_| - 26.10.2011
put it inside a command idk and get a number between the 2 values u said...
eg:
pawn Код:
cmd:hello(playerid,params[])
{
new string[60], randomnumber;
randomnumber = randomEx(1,10000);
format(string, sizeof(string), "the number is %d", randomnumber );
not tested, i dunno if it works lol
im noob too