[Tutorial] Efficient Multiple Spawning System
#4

Quote:
Originally Posted by Dan..
View Post
Why not:

Code:
stock const offsets[][2] = {{LS_START, LS_END}, {SF_START, SF_END}, {LV_START, LV_END}};
stock GetSpawnLocation(location, &Float:x, &Float:y, &Float:z, &Float:a) {
    new idx = random(offsets[location][1] - offsets[location][0]) + offsets[location][0];
    x = spawns[idx][0];
    y = spawns[idx][1];
    z = spawns[idx][2];
    a = spawns[idx][3];
}
Awesome!

Random might give same numbers or some one number may come rare and another gets to be very common.
But my system gives in an order and all get equal number of times whereas in your case few come many times some may even repeat.Yours might be faster than mine but mine does it without any chance of repetitions nor flooding of players in one place.

Anyway thanks I will use your snippet somewhere
Reply


Messages In This Thread
[Updated]Efficient Multiple Spawning System - by Yashas - 19.04.2013, 12:41
Re: Efficient Multiple Spawning System - by Yashas - 19.04.2013, 15:48
Re: Efficient Multiple Spawning System - by Dan.. - 19.04.2013, 16:30
Re: Efficient Multiple Spawning System - by Yashas - 19.04.2013, 16:51
Re: Efficient Multiple Spawning System - by Yashas - 19.04.2013, 16:55
Re: Efficient Multiple Spawning System - by RajatPawar - 19.04.2013, 17:04
Re: Efficient Multiple Spawning System - by Yashas - 19.04.2013, 17:19
Re: Efficient Multiple Spawning System - by Yashas - 19.04.2013, 17:25
Re: Efficient Multiple Spawning System - by Vince - 19.04.2013, 17:31
Re: Efficient Multiple Spawning System - by Yashas - 19.04.2013, 17:36
Re: Efficient Multiple Spawning System - by Dan.. - 19.04.2013, 18:30
Re: Efficient Multiple Spawning System - by mastermax7777 - 20.04.2013, 05:41
Re: Efficient Multiple Spawning System - by RajatPawar - 20.04.2013, 05:48
Re: Efficient Multiple Spawning System - by Yashas - 20.04.2013, 11:18
Re: Efficient Multiple Spawning System - by Wickeed - 13.06.2013, 12:31
Re: Efficient Multiple Spawning System - by Yashas - 22.06.2013, 15:44

Forum Jump:


Users browsing this thread: 6 Guest(s)