Spawn Rotation
#1

So I've been trying to figure this out for a while now, but I haven't been able to sort it out yet.

My goal is to create a dynamic spawn rotation so players are close together in a defined area, and change it every hour or so to prevent them getting bored. So far I've created an array with the locations in:
pawn Код:
#if defined SPAWN_ROTATION
{1645.967163, 1625.352295, 18.482553, 50.0}, //lvairport
{413.5944,2527.2563,16.5536, 90.0}, //boneyard
{1953.9196,-2239.2888,13.5469,96.6900}, //lsairport
{1377.7240,-2487.6006,13.5547,25.2123}, //lsairport2
{-2363.1636,-1649.4421,487.4435, 252.50}, //chiliad
{-2362.8909,-1585.5498,493.6185,219.8771}, //chiliad2
{1591.3649,1170.9069,14.2241,87.2910}, //lvairport2
{-35.9711,2347.1038,24.1406,180.3023}, //boneyard2
{-1658.0809,-414.6946,14.1484,0.0} //sfairport
};
#endif
and a timer that calls it every minute (just to test it)
pawn Код:
#if defined SPAWN_ROTATION
    SetTimer("RotateSpawns",60000,true); // 1 Hour
    #endif
So far so good, but the function itself is pretty messy. I've thought about putting 'SetPlayerPos' in a variable, but that will obviously not work...

I should get something like this
pawn Код:
SetPlayerPos(playerid, gRandomStuntSpawn[rand][0], gRandomStuntSpawn[rand][1],gRandomStuntSpawn[rand][2]);
But the random must be called once a minute (testing) and should be server wide, we don't want everyone to somewhere else.


Please advice,
Thanks in advance!

-Born
Reply
#2

just make a global var and randomly choose 1 location every so often and save the value to that var then spawn people there
Reply
#3

Quote:
Originally Posted by (SF)Noobanatior
Посмотреть сообщение
just make a global var and randomly choose 1 location every so often and save the value to that var then spawn people there
How should I save it then?
Reply
#4

Quote:
Originally Posted by Born2die
Посмотреть сообщение
How should I save it then?
What do you want to save ?

The number which determines the spawn location is stored in the global variable

Which is set in the timer to a random value
Reply
#5

Quote:
Originally Posted by Nero_3D
Посмотреть сообщение
What do you want to save ?

The number which determines the spawn location is stored in the global variable

Which is set in the timer to a random value
Ah I see, my bad. Thanks!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)