SA-MP Forums Archive
random player - 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 player (/showthread.php?tid=416215)



random player - micol - 16.02.2013

Hi, i have a question.
When the player type the command then server change var to 1(OK), but how to do function which will be random players with this var and after this give them another var ?

Something like:

Someone type command
Server change his var to 1 (ex. player[playerid] = 1)
Now random players with this var on 1 (random)
Server chose 1(one) player with this var and change his to another (ex. player[playerid] = 1 --> player1[playerid] = 1)

I think that's all.

Greetings.


Re: random player - DaRk_RaiN - 16.02.2013

Random Same basic principle, just like random spawns.


Re: random player - micol - 16.02.2013

Sry, but unhelpful post


Re: random player - E_Meec - 16.02.2013

Код:
new yourvar[MAX_PLAYERS];

yourvar[random(MAX_PLAYERS)] = 1; //Random id