View Single Post
Old 02-01-2011, 04:35 PM   #3
Bridget
Banned
 
Bridget's Avatar
 
Join Date: Sep 2008
Class/Position: Soldier
Gametype: AVD
Affiliations: TALOS
Posts Rated Helpful 5 Times
Code:
-- Assuming this overrides the base_flag functions.
-- Also assuming the blue flag is named 'blue flag'.
-- Also assuming info_ff_script has an allowed() return function.

function GetNumAllPlayers() return GetTeam(Team.kRed):GetNumPlayers() + GetTeam(Team.kBlue):GetNumPlayers() end

function baseflag:allowed() if GetNumAllPlayers() >= 10 then return true else return false end

function player_ondisconnect()
	-- Game still counts the player during this function's execution, I think?
	if (GetNumAllPlayers() - 1) < 10 then
		GetInfoScriptByName('blue flag'):Return()
		BroadCastMessage('The Blue Flag has returned due to player limit being under ten.')
	end
end
dunno

Last edited by Bridget; 02-01-2011 at 04:36 PM. Reason: forgot an end
Bridget is offline   Reply With Quote