ID:1722711
 
(See the best response by Reformist.)
Code:
mob/proc/DeathCheck(M)
M.Health = 0
M.MaxHealth = 100
M.icon_state="dead"
M.verbs+=(/mob/Death/verb/Spectate)
M.movestop=1
M.Alive=0
deaths+=1
world<<"<font color=red><b><BIG>[usr.key] has been killed!"
if(deaths==8)
world<<"<font color=red><b><BIG>All engineers have perished. Sending everyone back to lobby."


Problem description:

Just curious how I'd send every player in the world back to the lobby for the game. I have the lobby set as an area for locations, but can't figure out how to work it into the DeathCheck if everyone is dead.

Originally, I have it so the server reboots but I'd rather not do that.

area/Lobby


A combination of a loop, locate() and Move() would probably do the trick. You can locate(/area/Lobby) and Move() them to it.
In response to Audeuro
Actually, waiting for 8 people to die wouldn't allow less than 8 people to play. How could I work it so that when all the players whom are alive die they get sent back?
Ideally you'll keep track of who is in the game and who is not. Then, in DeathCheck(), you'll do an if(deaths == number_of_players) locate() and Move(). number_of_players could be a variable of its own or, probably for the better, the 'len' variable of a list of players.
Best response
You could do something like:

var
tmp
list/Connected = list() //a list of every player connected to the server
list/Players = list() //a list of people who are actually in the game
Deaths = 0

mob
Login()
..()
global.Connected += src //add player to connected list

Logout()
global.Connected -= src //remove player from connected list
if(src in global.Players) //if they leave and are currently in the game
//you may want to kill the player or something here
global.Players -= src //remove them from the game list
..()
del src

proc
DeathCheck(M)
//blah
//blah
global.Deaths ++
if(Deaths == global.Players.len) //check player count against deaths
for(var/mob/P in global.Connected) //loop through all connected players
P.Move(locate(/area/Lobby)) //move them to the lobby area
global.Deaths = 0 //reset the death count (you can do this here or when the game starts)


Be sure to add each player who is in the round to global.Players when the round starts.
In response to Reformist
Alright, cool. Thanks! I'll give this a whirl.
To be serious, Server Rebooting is the best way. Two reasons. First, it will restart all the map and everything damaged with out, it being coded.Second, It will stop you from needing to code all of this crap for no reason. Also, famous games do it, so it doesn't really matter.