Difference between revisions of "DCS func setOnOff"

From DCS World Wiki - Hoggitworld.com
m (1 revision imported)
 
 
Line 45: Line 45:
 
}}
 
}}
 
[[Category:Class Functions|setOnOff]]
 
[[Category:Class Functions|setOnOff]]
 +
[[Category:Game Patch 1.2.4|setOnOff]]

Latest revision as of 23:05, 17 March 2022

Scripting Root

Envrioment: Mission Scripting
Function: setOnOff Added with: 1.2.4
Member Of: Controller
Syntax: function Controller.setOnOff(Class self , boolean value )
Description: Enables or disables the AI controller for the specified group or unit. When AI is turned off the units are incapable of moving, shooting, or detecting targets.

Function CAN NOT be used on aircraft or helicopters. This function will only work on ground or naval forces!

When the value passed is false the AI is set off.

When the value passed is true the AI is set on.


Return Value: function
Return Example: none
Examples: The following sets a groups AI off.
 local function AIOff(groupName)
   Group.getByName(groupName):getController():setOnOff(false)	
 end
Related Functions: Controller: setTask, resetTask, pushTask, popTask, hasTask, setCommand, setOption, setOnOff, setAltitude, setSpeed, knowTarget, isTargetDetected, getDetectedTargets
Notes: