Lua:validspawn

From Fortress Forever Wiki
Revision as of 21:57, 12 May 2009 by Crazycarl (talk | contribs) (New page: Called by a spawn point. Return true/false to determine whether the player can spawn at the spawn point ===Usage=== function info_ff_teamspawn:validspawn(ffspawn, player) ... end ===E...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Called by a spawn point. Return true/false to determine whether the player can spawn at the spawn point

Usage

function info_ff_teamspawn:validspawn(ffspawn, player)
...
end

Example

This is also an example of an inline function. Since this validspawn function is so simple, it's convenient to declare it right inside the new class of teamspawn.

attacker_spawn = info_ff_teamspawn:new({ validspawn = function(self,player)
	return player:GetTeamId() == attackers
end })

defender_spawn = info_ff_teamspawn:new({ validspawn = function(self,player)
	return player:GetTeamId() == defenders
end })