ID:2117364
 
Code:


Problem description:
I'm trying to make an auto-host type of thing that'll auto start games/end whenever a specific amount of players have joined in.
I currently designed it by creating it as an obj then creating one copy of it when the world is initialized.It then goes through the tick loop and does everything it's supposed to do.

I was just wondering if there's a better way of doing this instead of creating an object to do so. Any tips on better methods?
You could loop through all the players in the world if they are in match then update the match count.

mob
proc
MatchCheck
for(var/mob/T in world)
if(T.inmatch)
matchcount++
if(matchcount>5)
world<<"Match is closed."
verbs.Remove(path/to/join)
else
return
There should be a join proc that gets called when a player joins the game. do the MatchCheck on player join. Or make a global list of players and check its size every time a player joins.