getTeamFriendlyFire | Multi Theft Auto: Wiki Skip to content

getTeamFriendlyFire

Client-side
Server-side
Shared

Pair: setTeamFriendlyFire

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


This function tells you if friendly fire is turned on for the specified team.

Syntax

getTeamFriendlyFire ( )

Code Examples

server

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 )