gm_name = {}
gm_name[0] = "Standard"
gm_name[1] = "Deathmatch"
gm_name[2] = "Team Deathmatch"
gm_name[3] = "Construction"
gm_name[4] = "Zombies"

gm_max = 4

function GameMode()
	return tonumber(game("sv_gamemode"))
end

function GMButtonCustom()
	return "Game mode|"..(gm_name[GameMode()] or "")
end

function GMButtonToggle()
	local gm = GameMode() + 1
	if gm > gm_max then
		gm = 0
	end
	parse("sv_gm "..gm)
end

CreateSetting(GMButtonCustom, GMButtonToggle)