SA-MP Forums Archive
Repeating sequence formation. - 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: Repeating sequence formation. (/showthread.php?tid=607368)



Repeating sequence formation. - ProRakNet - 18.05.2016

Hi.
how can I do a particular sequence ?
Example:
Sequence -1
Player 1 connect and spawn 1. pos
Player 2 connect and spawn 2. pos
...
Player 5 connect and spawn 5. pos

Sequence -2
Player 6 connect and spawn 1. pos
Player 7 connect and spawn 2. pos
...
Player 10 connect and spawn 5. pos


Re: Repeating sequence formation. - Konstantinos - 18.05.2016

You can use modulo operation but it would give 0 instead of 5 so we set it again if that's the case:
pawn Код:
new spawn_number;
if (!(spawn_number = playerid % 5)) spawn_number = 5;



Re: Repeating sequence formation. - Vince - 18.05.2016

If you want to solely base it on the playerid, you can simply do:

pawn Код:
spawn = playerid % 5;
Although that may be too predictable.