Help with random spawn - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help with random spawn (
/showthread.php?tid=259617)
Help with random spawn -
Jmarr - 05.06.2011
Hello forum,
I need some help with a random spawn script, I have the random spawn locations all picked out and in the array or whatever, but what do I put in the AddPlayerClass coordinates? I have it to the default spawn location in little mexico, but I don't want them to spawn there.
What can I do?
Re: Help with random spawn -
Stigg - 05.06.2011
Try looking here:
https://sampwiki.blast.hk/wiki/Random
Re: Help with random spawn -
Jmarr - 05.06.2011
Quote:
Originally Posted by Stigg
|
I have that, and I set them to SFPD, LSPD, and LVPD, but when I add the player class later on I do this:
AddPlayerClass(165,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
Which is little mexico, so sometimes they'll spawn at PD but other times they will spawn at little mexico.
Re: Help with random spawn -
grand.Theft.Otto - 05.06.2011
Can we see a snippet of each code to do with the random spawns?
Re: Help with random spawn -
Mean - 05.06.2011
If you have random spawns, you can put anything there if you set random pos in OnPlayerSpawn... You can even put 0 0 0.
Re: Help with random spawn -
Amit_B - 05.06.2011
pawn Код:
new Float:randomSpawns[][4] =
{
{0.0,0.0,0.0},
{0.0,0.0,0.0},
{0.0,0.0,0.0},
{0.0,0.0,0.0},
{0.0,0.0,0.0},
{0.0,0.0,0.0}
};
public OnPlayerSpawn(playerid)
{
new rnd = random(randomSpawns);
SetPlayerPos(playerid,randomSpawns[rnd][0],randomSpawns[rnd][1],randomSpawns[rnd][2]);
SetPlayerFacingAngle(playerid,randomSpawns[rnd][3]);
}