Random spawns - How to detect if a spawn is "Used"?
#1

So I'm about to create a random spawn system, which will place players (a maximum of 30.) around a center piece. (Think of the hunger games.) I understand how to set their spawn to be random, but how do I make it so only one player can spawn in one place? So two people don't spawn on each other.

I'm sort of asking how to skip a spawn position if it's occupied. Where would I start?
Reply
#2

I don't know what do you mean but maybe:
Код:
new Float:RandomPlayerSpawns[][] = {
	{//ADD POISTION HERE},
    {//ADD POISTION HERE}
};
OnPlayerSpawn:
Код:
	new rand;
	rand = random(sizeof(RandomPlayerSpawns));
	SetPlayerPos(playerid, RandomPlayerSpawns[rand][0], RandomPlayerSpawns[rand][1], RandomPlayerSpawns[rand][2]);
Reply
#3

As I've stated, I understand how to make random spawns. But how do i make sure two players dont spawn at the same location?
Reply
#4

Ammmm, I don't know if possible ,but maybe by adding check point in the spawn position .
Reply
#5

Efficient Multiple Spawning System
If you are doing random spawns and want to ensure that no player spawns near each other then use the link above.By random I mean a spawn from a set of fixed number of spawns.Not randomly creating one.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)