Random() function - 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: Random() function (
/showthread.php?tid=572834)
Random() function -
DeathKing - 02.05.2015
Is it in anyway possible to loop numbers 1, 3 and 6 without having to loop the numbers 2, 4 and 5?
Random only sets the MAX so... its not good using that
Re: Random() function -
arlindi - 02.05.2015
Here
You can create something like this On Player Spawn in random
But put the numbers 1,3,5, etc
Re: Random() function -
Mencent - 02.05.2015
Hello!
Do you mean it so?
PHP код:
for(new i;i<6;i++)
{
if(i == 2 || i == 4 || i == 5)continue;
// i == 1, i == 3, i == 6
}
Re: Random() function -
DeathKing - 02.05.2015
Quote:
Originally Posted by arlindi
Here
You can create something like this On Player Spawn in random
But put the numbers 1,3,5, etc
|
Hmm something like
Код HTML:
Random(1, 3, 5);
Will Work
Quote:
Originally Posted by Mencent
Hello!
Do you mean it so?
PHP код:
for(new i;i<6;i++)
{
if(i == 2 || i == 4 || i == 5)continue;
// i == 1, i == 3, i == 6
}
|
Nah man... That Loops on those numbers... i need them in random
Re: Random() function -
arlindi - 02.05.2015
Yeah you can use it
This is my IDEA
AW: Random() function -
Nero_3D - 02.05.2015
This function was once posted in Useful Functions
pawn Код:
// Use it like Random(1, 3, 6);
stock Random(...) {
return getarg(random(numargs()));
}