Check if point is occupied
#4

Give your random point an id and a boolean, false by defaut.

Every time a player spawns at that point, set the point boolean to true (as someone has already spawned at the said location) and also make a player variable containing that spawn id. When the player dies, set that random point boolean to false (thus it can be used again).

What is left to do is a function that checks whether there is a free (boolean set to false) spawn point. If there is none, just choose a random one from the whole set of spawn points.
Reply


Messages In This Thread
Check if point is occupied - by Viggo - 03.04.2019, 17:17
Re: Check if point is occupied - by v1k1nG - 03.04.2019, 17:47
Re: Check if point is occupied - by Viggo - 03.04.2019, 17:49
Re: Check if point is occupied - by Private200 - 03.04.2019, 17:54
Re: Check if point is occupied - by v1k1nG - 03.04.2019, 17:55
Re: Check if point is occupied - by Viggo - 03.04.2019, 17:59
Re: Check if point is occupied - by v1k1nG - 03.04.2019, 18:00
Re: Check if point is occupied - by Viggo - 03.04.2019, 18:01
Re: Check if point is occupied - by v1k1nG - 03.04.2019, 18:02
Re: Check if point is occupied - by RedFusion - 03.04.2019, 18:03
Re: Check if point is occupied - by Viggo - 03.04.2019, 18:03
Re: Check if point is occupied - by v1k1nG - 03.04.2019, 18:06
Re: Check if point is occupied - by Private200 - 03.04.2019, 18:08
Re: Check if point is occupied - by Viggo - 03.04.2019, 18:08
Re: Check if point is occupied - by Viggo - 03.04.2019, 18:13
Re: Check if point is occupied - by CONTROLA - 04.04.2019, 08:57
Re: Check if point is occupied - by Viggo - 04.04.2019, 10:40

Forum Jump:


Users browsing this thread: 3 Guest(s)