ID:155976
 
I want to have a system with 15 z levels.
Each of is an arena.
Point me in the right direction on how to make it so a person cannot enter an arena that is in use.

I have been trying
for(var/mob/m in world)
if(m.z==2)

etc.


but I think im going about it all wrong.

please help



note:
[02:40:27] Audeuro: You should have a datum representing an arena.
[02:40:45] Audeuro: Which will then have all of the arena-related functionality
[02:41:08] Audeuro: Then a list with the Z-level as the index and the /arena as the value.
[02:41:22] Audeuro: Then you simply check the /arena to see if it's in use.
Each arena should be owned by a datum, and that datum is what should be checked for if the arena is in use, or supply other info about the arenas.
you could just use a list:
var
list
UsedArenas = list(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15)



for(var/i=1 to 15)
if(!UsedArenas[i])
UsedArenas.Add(i)
BeginBattle(arena=i)
break


#define ICE_ARENA 1
#define FIRE_ARENA 2
#define FOREST_ARENA 3
//....