Gamemode auto spawn after round ends

I need my gamemode to repsawn everyone after everyone on the other team dies.

init.lua

[lua]AddCSLuaFile( “cl_init.lua” )
AddCSLuaFile( “shared.lua” )

include( “shared.lua” )

function GM:PlayerInitialSpawn( ply )
print(“Player " … ply:Nick() … " spawned”)
ply:SetGamemodeTeam(math.random(0,1))
end

function GM:PlayerSpawn( ply )
if ply:Team() == 0 then
ply:SetModel( “models/player/swat.mdl” )
ply:Give( “weapon_mad_knife” )
ply:AllowFlashlight(true)
elseif ply:Team() == 1 then
ply:SetModel( “models/player/leet.mdl” )
ply:Give( “weapon_mad_knife” )
ply:AllowFlashlight(true)
end
end

function GM:PlayerAuthed( ply, steamID, uniqueID )
print(“Player " … ply:Nick() … " has been authed”)
end

function GM:PlayerDeath(ply)
ply:ChatPrint(“You’ve died.”)
end

function GM:PlayerDeathThink(ply)
Msg( "Player " … ply:GetName() … " has died.
" )
ply:Spectate( OBS_MODE_ROAMING )
end[/lua]

-snip-