Help with random spawn
#1

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?
Reply
#2

Try looking here:

https://sampwiki.blast.hk/wiki/Random
Reply
#3

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.
Reply
#4

Can we see a snippet of each code to do with the random spawns?
Reply
#5

If you have random spawns, you can put anything there if you set random pos in OnPlayerSpawn... You can even put 0 0 0.
Reply
#6

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]);
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)