DCS func setOnOff

From DCS World Wiki - Hoggitworld.com
Revision as of 00:12, 12 April 2018 by Grimes (talk | contribs) (1 revision imported)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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: