# Unit Control (scripting commands)

- [allowGetIn](../../commands/allowGetIn.md): Set if the units given in the list are allowed to enter vehicles.
- [assignAsCargo](../../commands/assignAsCargo.md): Assign a unit as cargo of a vehicle. Used together with orderGetIn to order a unit to get in as cargo into a specific vehicle.
- [assignAsCargoIndex](../../commands/assignAsCargoIndex.md): Assigns the character to a specific cargo / passenger index of the given vehicle.
- [assignAsCommander](../../commands/assignAsCommander.md): Assign a unit as commander of a vehicle. Used together with orderGetIn to order subordinate units to get in as commander of a specific vehicle.
- [assignAsDriver](../../commands/assignAsDriver.md): Assign a unit as driver of a vehicle. Used together with orderGetIn to order subordinate units to get in as driver of a specific vehicle.
- [assignAsGunner](../../commands/assignAsGunner.md): Assign a unit as gunner of a vehicle. Used together with orderGetIn to order subordinate units to get in as gunner of a specific vehicle.
- [assignedCargo](../../commands/assignedCargo.md): Returns the list of soldiers assigned to the given vehicle as a cargo.
- [assignedCommander](../../commands/assignedCommander.md): Returns the soldier assigned to the given vehicle as a commander.
- [assignedDriver](../../commands/assignedDriver.md): Returns the soldier assigned to the given vehicle as a driver.
- [assignedGunner](../../commands/assignedGunner.md): Returns the soldier assigned to the given vehicle as a gunner.
- [attackEnabled](../../commands/attackEnabled.md): Return whether a group's leader can issue attack commands to soldiers under his command.
- [commandFire](../../commands/commandFire.md): Order the given unit to fire on the given target (via the radio). If the target is objNull, the unit is ordered to fire on its current target (set with doTarget or commandTarget).
- [commandFollow](../../commands/commandFollow.md): Order the given unit(s) to follow another from his own group (via radio). It can also be used to resume unit formation after e.g doStop.
- [commandFSM](../../commands/commandFSM.md): Orders a unit to process command defined by FSM file (via the radio).
- [commandGetOut](../../commands/commandGetOut.md): Orders one or multiple units to get out from the vehicle (via the radio). Same as doGetOut with latter being silent.
- [commandSuppressiveFire](../../commands/commandSuppressiveFire.md): Orders the given unit or a group of units to suppress the given position or target (with radio messages, see doSuppressiveFire if you do not want messages).
- [commandWatch](../../commands/commandWatch.md): Orders the unit(s) to watch the given position or target (via the radio). Use objNull as the target to order a unit to stop watching a position/target.
- [currentCommand](../../commands/currentCommand.md): Return the current command type (empty string when no command) for the commander of given vehicle (or for a given soldier).
- [doFire](../../commands/doFire.md): Order the given unit(s) to fire on the given target (without radio messages).
- [doFollow](../../commands/doFollow.md): Order the given unit(s) to follow another from his own group as his formation leader (without radio messages).
- [doFSM](../../commands/doFSM.md): Orders a unit to process command defined by FSM file (silently).
- [doGetOut](../../commands/doGetOut.md): Orders one or multiple units to get out from the vehicle (silently). Same as commandGetOut with latter being shown via radio chat.
- [doMove](../../commands/doMove.md): Order the given unit(s) to move to the given position (without radio messages). Upon reaching its destination, if it is the group leader it will order the group to form around it's new position.
- [doStop](../../commands/doStop.md): Order the given unit(s) to stop (without radio messages). The units stopped in this way will leave the groups formation.
- [doSuppressiveFire](../../commands/doSuppressiveFire.md): Orders the given unit or a group of units to suppress the given position or target (without radio messages, see commandSuppressiveFire is you need messages).
- [doTarget](../../commands/doTarget.md): Order the given unit(s) to target the given target (without radio messages). Targeting can be stopped by
- [doWatch](../../commands/doWatch.md): Order the given unit(s) to watch the given position or target (without radio messages). Use objNull as the target to order a unit to stop watching a position/target.
- [effectiveCommander](../../commands/effectiveCommander.md): Returns the effective commander of the vehicle. Effective commander is the player whom driver AI will listen to.
- [emptyPositions](../../commands/emptyPositions.md): Returns the number of given empty positions in the vehicle.
- [enableAttack](../../commands/enableAttack.md): Set if leader can issue attack commands to the soldiers in his group.
- [expectedDestination](../../commands/expectedDestination.md): Return expected destination of unit as an array.
- [fire](../../commands/fire.md): Forces a unit to fire the given weapon.
- [fireAtTarget](../../commands/fireAtTarget.md): Remotely forces a unit to fire the given weapon. See also BIS_fnc_fire.
- [forceFollowRoad](../../commands/forceFollowRoad.md): Forces the vehicle to stay on road.
- [forceWeaponFire](../../commands/forceWeaponFire.md): The unit will be forced to fire weapon from the given muzzle. The weapon will not fire if firemode passed as parameter is not supported by the given muzzle.
- [forgetTarget](../../commands/forgetTarget.md): Resets the info a group has about a target, forcing knowsAbout value to 0.
- [formationLeader](../../commands/formationLeader.md): Return leader of the formation.
- [formLeader](../../commands/formLeader.md): Returns the formation leader of a given unit. This is often the same as the group leader, but not always, for example in cases when a unit is ordered to follow another unit.
- [getCruiseControl](../../commands/getCruiseControl.md): Returns cruise control settings set with setCruiseControl command.
- [getLeaning](../../commands/getLeaning.md): Returns the leaning factor of the given unit.
- [glanceAt](../../commands/glanceAt.md): Control what the unit(s) is/are glancing at (target or Position). If target is used, it will get revealed fully.
- [in](../../commands/in.md): Checks whether value is in array, unit is in vehicle, position is inside location or ANSI string is part of other ANSI string. If Unicode support is desired, see forceUnicode.
- [land](../../commands/land.md): Forces a helicopter landing. If there is a helipad nearby, the helicopter will attempt to land on it. VTOL he other hand will just land somewhere. To make helicopter or VTOL land on a specific helipad use landAt.
- [landAt](../../commands/landAt.md): Order an AI airplane to land at a given airport. ID is the number to identify which map airport you want the airplane to land at. See Arma: Airport IDs for more information. See also land.
- [landResult](../../commands/landResult.md): Return the result of helicopter landing position searching (performed after the land command).
- [leaveVehicle](../../commands/leaveVehicle.md): Ceases the using of the vehicle by a group and unassigns vehicle from the group. If the argument is a single unit, the vehicle will be unassigned from unit's group.
- [limitSpeed](../../commands/limitSpeed.md): Limit the speed of an AI-driven vehicle or AI person to given value. It has continuous effect and AI will not break through the speed limitation until one is contacted, engaged or regrouped.
- [lookAt](../../commands/lookAt.md): Control what the unit(s) is/are looking at (target or Position). If target is used, it will get revealed fully.
- [move](../../commands/move.md): Let group move to given position. Active waypoints will be ignored when command is used.
- [moveInAny](../../commands/moveInAny.md): Moves unit to the first available seat in the specified vehicle.
- [moveInCargo](../../commands/moveInCargo.md): Moves a unit into a vehicle cargo position (immediately and without animation).
- [moveInCommander](../../commands/moveInCommander.md): Move soldier into vehicle commander position (Immediate, no animation).
- [moveInDriver](../../commands/moveInDriver.md): Moves soldier into vehicle driver position (immediate, no animation).
- [moveInGunner](../../commands/moveInGunner.md): Move the unit into vehicle gunner position (immediate, no animation).
- [moveOut](../../commands/moveOut.md): Moves the soldier out of the vehicle.
- [moveTo](../../commands/moveTo.md): Low level command to person to move to given position. It is good to check first if AI pilot unit state is COMPLETED moveToCompleted first as this command will set unit into WAIT state waiting for instruction, but only…
- [moveToCompleted](../../commands/moveToCompleted.md): Check if latest low level moveTo command is finished. Returns true if given AI pilot unit state == COMPLETED
- [moveToFailed](../../commands/moveToFailed.md): Check if latest low level moveTo command failed.
- [orderGetIn](../../commands/orderGetIn.md): Force all units in the array to get in or out of their assigned vehicles. Units must be assigned to a vehicle before this command will do anything.
- [playAction](../../commands/playAction.md): When used on a person, a smooth transition to the given action will be initiated.
- [pose](../../commands/pose.md): Returns the pose of the given unit.
- [sendSimpleCommand](../../commands/sendSimpleCommand.md): Sends a simple command to the vehicle's driver / gunner (air vehicles ignore it). See also vehicleMoveInfo.
- [setCruiseControl](../../commands/setCruiseControl.md): Limits or sets local player-controlled vehicle's speed through cruise control.
- [setDestination](../../commands/setDestination.md): Set the destination for path planning of the pilot.
- [setEffectiveCommander](../../commands/setEffectiveCommander.md): Sets effectiveCommander of the given vehicle. Effective commander is the person who commands the vehicle, i.e. gives commands to the driver.
- [setFormationTask](../../commands/setFormationTask.md): Set the current task of the formation member.
- [setUnitPos](../../commands/setUnitPos.md): Set unit position rules. This command will not change the stance of the human player, even though it will change the output of unitPos command. To change player stance use playAction or playActionNow:
- [setUnitPosWeak](../../commands/setUnitPosWeak.md): Set unit position rules. This command is the lowest level of priority for setting unit position and to be used in scripted FSM's. Priorities are: 1. Unit pos commanded (from the commanding menu, higher priority). 1.
- [setUnloadInCombat](../../commands/setUnloadInCombat.md): Sets whether or not cargo or turret units *should* get out of vehicle when in combat. If true, vehicle will stop and units will dismount. Vehicle must be local.
- [stance](../../commands/stance.md): Returns the stance of the given unit.
- [stop](../../commands/stop.md): Stop an AI unit from turning or moving, preventing it to follow a watched object or engage an enemy properly - although if properly aligned, the unit -will- shoot the enemy.
- [stopped](../../commands/stopped.md): Check if unit is stopped by stop command.
- [suppressFor](../../commands/suppressFor.md): Force suppressive fire from the unit.
- [swimInDepth](../../commands/swimInDepth.md): Sets the target depth level for swimming soldier. Depth should be a negative number.
- [switchAction](../../commands/switchAction.md): When used on a person, the given action is started immediately (there is no transition). Use switchmove "" to switch back to the default movement if there is no transition back, otherwise the person may be stuck.
- [unassignVehicle](../../commands/unassignVehicle.md): Unassigns individual unit from a vehicle, usually previously assigned with *assignAsXXX* command, i.e removes assignedVehicleRole of the unit.
- [unitPos](../../commands/unitPos.md): Return the unit position rules.
- [unitReady](../../commands/unitReady.md): Check if the unit is ready. Unit is busy when it is given some command like move, until the command is finished.
- [vehicleMoveInfo](../../commands/vehicleMoveInfo.md): Returns current vehicle move/turn info (a getter for sendSimpleCommand) in format [moveInfo, turnInfo]. Possible values:
- [weaponDirection](../../commands/weaponDirection.md): Returns the direction that the vehicle weapon is aiming in. For addons the weapon name must be an entry in CfgWeapons.
