GetTeamFriendlyFire: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
[[Category:Incomplete]]
__NOTOC__  
__NOTOC__  
This function returns the friendly fire value for the specified team.
This function returns the friendly fire value for the specified team.
Line 16: Line 14:


==Example==  
==Example==  
This example does...
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">
--This line does...
--for every team,
blabhalbalhb --abababa
for index, theTeam in getElementsByType ( "team" ) do
--This line does this...
--if friendly fire is off,
mooo
if ( getTeamFriendlyFire ( theTeam ) == false ) then
--switch it on
setTeamFriendlyFire ( theTeam, true )
end
end
</syntaxhighlight>
</syntaxhighlight>


==See Also==
==See Also==
{{FunctionArea_Functions}}
{{Team functions}}

Revision as of 01:06, 27 January 2007

This function returns the friendly fire value for the specified team.

Syntax

bool getTeamFriendlyFire ( team theTeam )

Required Arguments

  • theTeam: The team that will be checked

Returns

Returns true if friendly fire is on for the specified team, false if friendly fire is turned off 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