turretLocal: Difference between revisions

From Bohemia Interactive Community
m (Some wiki formatting)
mNo edit summary
(2 intermediate revisions by one other user not shown)
Line 18: Line 18:
|p1= vehicle: [[Object]]
|p1= vehicle: [[Object]]


|p2= turretPath: [[Array]] format [[Turret Path]]
|p2= turretPath: [[Turret Path]]. Also supports [-1] for driver turret


|r1= [[Boolean]] (or, prior to {{arma3}} v1.94, [[Nothing]] if the turret is non-existent)
|r1= [[Boolean]]


|x1= <sqf>_isLocal = vehicle player turretLocal [0];</sqf>
|x1= <sqf>_isLocal = vehicle player turretLocal [0];</sqf>

Revision as of 08:49, 2 January 2026

Hover & click on the images for description

Description

Description:
Checks if a turret is local.
Multiplayer:
A vehicle turret will change locality when player gunner gets in it, just like vehicle changes locality when player driver gets in it. Many commands for turrets work only where turret is local. When gunner leaves turret it is supposed to change locality to the locality of the vehicle.
Groups:
Turrets

Syntax

Syntax:
vehicle turretLocal turretPath
Parameters:
vehicle: Object
turretPath: Turret Path. Also supports [-1] for driver turret
Return Value:
Boolean

Examples

Example 1:
_isLocal = vehicle player turretLocal [0];
Example 2:
if (heli turretLocal [1]) then { heli setVehicleAmmo 1 };
Example 3:
if (isNil { heli turretLocal [5] }) then { hint "Turret 5 is non-existent" };

Additional Information

See also:
turretOwner setVehicleAmmo setVehicleAmmoDef removeWeaponTurret addWeaponTurret addMagazineTurret magazinesTurret removeMagazinesTurret removeMagazineTurret weaponsTurret currentMagazineDetailTurret currentMagazineTurret currentWeaponTurret selectWeaponTurret turretUnit allTurrets

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord.
Only post proven facts here! Add Note