05.11.2010, 11:06
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:
and a timer that calls it every minute (just to test it)
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
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
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
pawn Код:
#if defined SPAWN_ROTATION
SetTimer("RotateSpawns",60000,true); // 1 Hour
#endif
I should get something like this
pawn Код:
SetPlayerPos(playerid, gRandomStuntSpawn[rand][0], gRandomStuntSpawn[rand][1],gRandomStuntSpawn[rand][2]);
Please advice,
Thanks in advance!
-Born