GetTeamFriendlyFire: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
__NOTOC__ | {{Server client function}} | ||
This function | __NOTOC__ | ||
This function tells you if friendly fire is turned on for the specified team. | |||
==Syntax== | ==Syntax== | ||
Line 11: | Line 12: | ||
===Returns=== | ===Returns=== | ||
Returns ''true'' if friendly fire is on for the specified team, ''false'' if | Returns ''true'' if friendly fire is on for the specified team, ''false'' if it is turned off or if invalid arguments are specified. | ||
==Example== | ==Example== | ||
Line 18: | Line 19: | ||
function setFriendlyFireOn ( ) | function setFriendlyFireOn ( ) | ||
-- For each team, | -- For each team, | ||
for index, theTeam in ipairs(getElementsByType ( "team" )) do | for index, theTeam in ipairs ( getElementsByType("team") ) do | ||
-- if friendly fire is off, | -- if friendly fire is off, | ||
if ( getTeamFriendlyFire ( theTeam ) == false ) then | if ( getTeamFriendlyFire ( theTeam ) == false ) then |
Revision as of 18:54, 17 August 2007
This function tells you if friendly fire is turned on for the specified team.
Syntax
bool getTeamFriendlyFire ( team theTeam )
Required Arguments
- theTeam: The team object that will be checked
Returns
Returns true if friendly fire is on for the specified team, false if it is turned off or if invalid arguments are specified.
Example
This example makes a command that checks if friendly fire is on for each team, and toggles it on if it isn't.
function setFriendlyFireOn ( ) -- For each team, for index, theTeam in ipairs ( getElementsByType("team") ) do -- if friendly fire is off, if ( getTeamFriendlyFire ( theTeam ) == false ) then -- switch it on. setTeamFriendlyFire ( theTeam, true ) end end end -- Add console command 'setFF' addCommandHandler ( "setFF", setFriendlyFireOn )
See Also
- countPlayersInTeam
- getPlayerTeam
- getPlayersInTeam
- getTeamColor
- getTeamFriendlyFire
- getTeamFromName
- getTeamName