SA-MP Forums Archive
Random Spawns? - 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 Spawns? (/showthread.php?tid=349636)



Random Spawns? - sanrock - 09.06.2012

How do I make random spawns for a certain team?


Re: Random Spawns? - varga - 09.06.2012

http://www.mediafire.com/?2ytoit18molf48k i dont know whoose work i it but it can help you a lot! Good Luck for th next period of your scripting


Re: Random Spawns? - Faisal_khan - 09.06.2012

Try this:
pawn Код:
new Float:RandomSpawn[][4] = {
    {coordx, coordy, coordz, coorda},
    {coordx, coordy, coordz, coorda},
    {coordx, coordy, coordz, coorda}
};

public OnPlayerSpawn(playerid)
{
    new rands = random(sizeof(RandomSpawn));
    SetPlayerPos(playerid, RandomSpawn[rands][0], RandomSpawn[rands][1], RandomSpawn[rands][2]);
    SetPlayerFacingAngle(playerid, RandomSpawn[rands][3]);
    return 1;
}
You need explainations? Go here Random