turretLocal: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(see also)
m (template:command argument fix)
Line 16: Line 16:
| vehicle '''turretLocal''' turretPath |= Syntax
| vehicle '''turretLocal''' turretPath |= Syntax


|p1= vehicle: [[Object]]  |= PARAMETER1
|p1= vehicle: [[Object]]  |PARAMETER1=  


|p2= turretPath: [[Array]]  |= PARAMETER2
|p2= turretPath: [[Array]]  |PARAMETER2=  


| [[Boolean]] or [[Nothing]] ([[nil]]) if the turret is non-existent |= RETURNVALUE
| [[Boolean]] or [[Nothing]] ([[nil]]) if the turret is non-existent |RETURNVALUE=  




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


|x2= <code>[[if]] (heli [[turretLocal]] [1]) [[then]] {heli [[setVehicleAmmo]] 1};</code>|= EXAMPLE2
|x2= <code>[[if]] (heli [[turretLocal]] [1]) [[then]] {heli [[setVehicleAmmo]] 1};</code>|EXAMPLE2=  


|x3= <code>[[if]] ([[isNil]] {heli [[turretLocal]] [5]}) [[then]] {[[hint]] "Turret 5 is non-existent"};</code>|= EXAMPLE2
|x3= <code>[[if]] ([[isNil]] {heli [[turretLocal]] [5]}) [[then]] {[[hint]] "Turret 5 is non-existent"};</code>|EXAMPLE2=  
____________________________________________________________________________________________
____________________________________________________________________________________________


| [[turretOwner]], [[setVehicleAmmo]], [[setVehicleAmmoDef]], [[removeWeaponTurret]], [[addWeaponTurret]], [[addMagazineTurret]], [[magazinesTurret]], [[removeMagazinesTurret]], [[removeMagazineTurret]], [[weaponsTurret]], [[currentMagazineDetailTurret]], [[currentMagazineTurret]], [[currentWeaponTurret]], [[selectWeaponTurret]], [[turretUnit]], [[allTurrets]]|= SEEALSO
| [[turretOwner]], [[setVehicleAmmo]], [[setVehicleAmmoDef]], [[removeWeaponTurret]], [[addWeaponTurret]], [[addMagazineTurret]], [[magazinesTurret]], [[removeMagazinesTurret]], [[removeMagazineTurret]], [[weaponsTurret]], [[currentMagazineDetailTurret]], [[currentMagazineTurret]], [[currentWeaponTurret]], [[selectWeaponTurret]], [[turretUnit]], [[allTurrets]]|SEEALSO=  


|  |= MPBEHAVIOUR
|  |MPBEHAVIOUR=  
____________________________________________________________________________________________
____________________________________________________________________________________________
}}
}}

Revision as of 10:38, 7 April 2019

Hover & click on the images for description

Description

Description:
Checks if a turret is local.

Some info on turrets: 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:
Uncategorised

Syntax

Syntax:
vehicle turretLocal turretPath
Parameters:
vehicle: Object
turretPath: Array
Return Value:
Boolean or Nothing (nil) if the turret is non-existent

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:
turretOwnersetVehicleAmmosetVehicleAmmoDefremoveWeaponTurretaddWeaponTurretaddMagazineTurretmagazinesTurretremoveMagazinesTurretremoveMagazineTurretweaponsTurretcurrentMagazineDetailTurretcurrentMagazineTurretcurrentWeaponTurretselectWeaponTurretturretUnitallTurrets

Notes

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

Notes

Bottom Section