SetTeamFriendlyFire: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
This function sets the friendly fire value for the specified team. | This function sets the friendly fire value for the specified team. | ||
Line 17: | Line 15: | ||
==Example== | ==Example== | ||
This example | This example checks if friendly fire is on for every team, and toggles it on if it isn't. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
-- | --for every team, | ||
for index, theTeam in getElementsByType ( "team" ) do | |||
-- | --if friendly fire is off, | ||
if ( getTeamFriendlyFire ( theTeam ) == false ) then | |||
--switch it on | |||
setTeamFriendlyFire ( theTeam, true ) | |||
end | |||
end | |||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{ | {{Team functions}} |
Revision as of 01:06, 27 January 2007
This function sets the friendly fire value for the specified team.
Syntax
bool setTeamFriendlyFire ( team theTeam , bool friendlyFire )
Required Arguments
- theTeam: The team that will have friendly fire set
- friendlyFire: The friendly fire value
Returns
Returns true if the friendly fire value is set for the specified team, false if the friendly fire value can't be set for the specified team or if invalid arguments are specified.
Example
This example checks if friendly fire is on for every team, and toggles it on if it isn't.
--for every team, for index, theTeam in getElementsByType ( "team" ) do --if friendly fire is off, if ( getTeamFriendlyFire ( theTeam ) == false ) then --switch it on setTeamFriendlyFire ( theTeam, true ) end end
See Also
- countPlayersInTeam
- getPlayerTeam
- getPlayersInTeam
- getTeamColor
- getTeamFriendlyFire
- getTeamFromName
- getTeamName