View Single Post
Old 06-15-2013, 04:41 AM   #2
squeek.
Stuff Do-er
Lua Team
Wiki Team
Fortress Forever Staff
 
squeek.'s Avatar
 
Join Date: Mar 2007
Location: Northern California
Class/Position: Rallygun Shooter
Gametype: Conc tag (you just wait)
Affiliations: Mustache Brigade
Posts Rated Helpful 352 Times
Send a message via AIM to squeek.
1. A few possibilities:
  • map .cfg files (cfg/ff_dustbowl.cfg, cfg/ff_ksour.cfg, etc) that set sv_globalluascript and a server.cfg that resets it to blank or something else
  • add an IncludeScript() line to the gametype's base include (base_ad, etc) that includes your file
  • maybe more than I can't think of right now
2. Absolutely. This will count only players on a playable team (blue through green):
Code:
local numplayers = 0
for team_id = Team.kBlue, Team.kGreen do
	numplayers += GetTeam( team_id ):GetNumPlayers()
end
Including spectators:
Code:
local numplayers = 0
for team_id = Team.kSpectator, Team.kGreen do
	numplayers += GetTeam( team_id ):GetNumPlayers()
end
Including spectators and unassigned:
Code:
local numplayers = 0
for team_id = Team.kUnassigned, Team.kGreen do
	numplayers += GetTeam( team_id ):GetNumPlayers()
end
EDIT: To react to changes in player number immediately, you can use the callback functions player_disconnected( player ) and player_switchteam( player, old_team_id, new_team_id )
__________________
#FF.Pickup ยค Fortress-Forever pickups

My Non-official Maps
Released FF_DM_Squeek - FF_2Mesa3_Classic - FF_Siege_Classic
Beta FF_Myth - FF_Redlight_Greenlight

Sick of the people on the internet, always moanin'. They just moan.
- Karl Pilkington

Last edited by squeek.; 06-15-2013 at 04:43 AM.
squeek. is offline   Reply With Quote