View Single Post
Old 02-01-2011, 06:34 PM   #5
Hammock
D&A Member
 
Join Date: Sep 2007
Posts Rated Helpful 13 Times
Quote:
Originally Posted by Bridget View Post
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
Did a quick test on this at lunch, and it messed up team/class selection, all 4 teams became available, and no classes were available
Hammock is offline   Reply With Quote