Random elements from array - 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 elements from array (
/showthread.php?tid=576402)
Random elements from array -
CodeStyle175 - 03.06.2015
Hello!
I need stock, that will randomly select setted amout of elements of array.
Re: Random elements from array -
SickAttack - 03.06.2015
Use this tutorial --->
https://sampforum.blast.hk/showthread.php?tid=573732 <--- as a reference of what to use and how to do it.
Re: Random elements from array -
CodeStyle175 - 03.06.2015
but how can i make function that chnages arrays elements to new order.
Re: Random elements from array -
SickAttack - 03.06.2015
Quote:
Originally Posted by CodeStyle175
but how can i make function that chnages arrays elements to new order.
|
What are you trying to do?
Re: Random elements from array -
Pottus - 03.06.2015
Look up some shuffling methods that is all this is.
Re: Random elements from array -
CodeStyle175 - 03.06.2015
But where can i find shuffl metod like php coding has.
Re: Random elements from array -
Pottus - 03.06.2015
Just give it a shot and try to write it to work for pawn it is not that hard really it won't help if we write the code for you.