PDA

View Full Version : Random players.


Blunt
16/07/2012, 01:53 PM
I was thinking of making a small gamemode and I wondered how I would go about setting a variable to a random player, if anyone can help it'd be appreciated very much.

ViniBorn
16/07/2012, 02:10 PM
new variable[2];
variable[0] = random(MAX_PLAYERS); // ID of player
variable[1] = // Another information

Larceny
16/07/2012, 02:17 PM
Use foreach (http://forum.sa-mp.com/showthread.php?t=92679).

Check Iter_Random function.

MadeMan
16/07/2012, 03:05 PM
http://forum.sa-mp.com/showthread.php?t=352900