How to make All vs. 1 gamemode teams?

I’m trying to make a gamemode where one person is trying to kill everyone on the opposite team, think the 1 vs. 3 mini games from Mario Party!
I’m going to refer to this one-man team as “Bowser”, and the rest of the people as “Mario” for clarity and keeping wordiness to a minimum.

How can I make it so that the last surviving member of the Mario team becomes the new Bowser in the next round?

I’m also having trouble making it so that when a round is in progress, someone who joins is not immediately spawned to the Mario team. I want them to join dead and have to wait for the next round like in TTT or Counter Strike.

I am amazed at the sheer absence of garrysmod.wiki tutorials for basic things such as teams and such. The “Gamemode Creation” only takes newbies so far, and the existing youtube tutorials seem to be sorely outdated.

It actually IS basics.
Just use PlayerAuthed or anything like that to assign people to a certain team.

I’ve done that. I need to know how to make it so the last person to die on the “good guy” team becomes the next round’s “bad guy”.

Just store him inside a variable, then use it for next round?

And to expand on that, you could check player count on death to see who the last person is

How exactly would I get it to return that specific player’s name?
Something to do with [lua]Player:Nick()[/lua]?

[editline]1st March 2015[/editline]

Even if I got it to store that name in a variable, how could I make it send him to the “bad guy” team the next round?

Well, first, once you get the actual player, you can use either ply:Nick(), ply:Name(), or ply:GetName() to return the name. After using the death hook and assigning the player variable on death, you can put a for loop in before the spawning of the players in your gamemode. Do something like:

[lua]
for i, v in pairs(player.GetAll()) do
if v.IsBowserNR then
v:SetTeam(TEAM_BOWSER)
print(v:Name() … " is the new Bowser!")
v.IsBowserNR = false
–only needed if you did not already arrange for teams already
–else
–v:SetTeam(TEAM_MARIO)
end
end
[/lua]

This assumes that the team names and the variable name that I put in actually exist, of course.