Difference between revisions of "turretLocal"

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "|= Game version" to "|Game version=")
m (Text replacement - " is local" to " is local")
 
(21 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Command|Comments=
+
{{RV|type=command
____________________________________________________________________________________________
 
  
| arma3 |Game name=
+
|game1= arma3
 +
|version1= 1.32
  
|1.32|Game version=
+
|arg= global
  
|arg= global |Multiplayer Arguments=
+
|gr1= Turrets
  
____________________________________________________________________________________________
+
|mp= 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 [[Multiplayer Scripting#Locality|local]]. When gunner leaves turret it is supposed to change locality to the locality of the vehicle.
  
| Checks if a turret is [[local]]. <br><br>
+
|descr= Checks if a turret is [[Multiplayer Scripting#Locality|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. |DESCRIPTION=
 
____________________________________________________________________________________________
 
  
| vehicle '''turretLocal''' turretPath |SYNTAX=
+
|s1= vehicle [[turretLocal]] turretPath
  
|p1= vehicle: [[Object]] |PARAMETER1=
+
|p1= vehicle: [[Object]]
  
|p2= turretPath: [[Array]] |PARAMETER2=
+
|p2= turretPath: [[Array]]
  
| [[Boolean]] (or, prior to Arma 3 v1.93.145625, [[Nothing]] if the turret is non-existent)|RETURNVALUE=
+
|r1= [[Boolean]] (or, prior to Arma 3 v1.94, [[Nothing]] if the turret is non-existent)
  
 +
|x1= <code>_isLocal = [[vehicle]] [[player]] [[turretLocal]] [0];</code>
  
|x1= <code>_isLocal = [[vehicle]] [[player]] [[turretLocal]] [0];</code>|EXAMPLE1=
+
|x2= <code>[[if]] (heli [[turretLocal]] [1]) [[then]] {heli [[setVehicleAmmo]] 1};</code>
  
|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>
  
|x3= <code>[[if]] ([[isNil]] {heli [[turretLocal]] [5]}) [[then]] {[[hint]] "Turret 5 is non-existent"};</code>|EXAMPLE2=
+
|seealso= [[turretOwner]], [[setVehicleAmmo]], [[setVehicleAmmoDef]], [[removeWeaponTurret]], [[addWeaponTurret]], [[addMagazineTurret]], [[magazinesTurret]], [[removeMagazinesTurret]], [[removeMagazineTurret]], [[weaponsTurret]], [[currentMagazineDetailTurret]], [[currentMagazineTurret]], [[currentWeaponTurret]], [[selectWeaponTurret]], [[turretUnit]], [[allTurrets]]
____________________________________________________________________________________________
 
 
 
| [[turretOwner]], [[setVehicleAmmo]], [[setVehicleAmmoDef]], [[removeWeaponTurret]], [[addWeaponTurret]], [[addMagazineTurret]], [[magazinesTurret]], [[removeMagazinesTurret]], [[removeMagazineTurret]], [[weaponsTurret]], [[currentMagazineDetailTurret]], [[currentMagazineTurret]], [[currentWeaponTurret]], [[selectWeaponTurret]], [[turretUnit]], [[allTurrets]]|SEEALSO=
 
 
 
|  |MPBEHAVIOUR=
 
____________________________________________________________________________________________
 
 
}}
 
}}
 
<h3 style='display:none'>Notes</h3>
 
<dl class='command_description'>
 
<!-- Note Section BEGIN -->
 
 
<!-- Note Section END -->
 
</dl>
 
 
<h3 style='display:none'>Bottom Section</h3>
 
[[Category:Arma_3:_New_Scripting_Commands_List|{{uc:{{PAGENAME}}}}]]
 
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
 
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
 

Latest revision as of 18:09, 21 June 2021

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: Array
Return Value:
Boolean (or, prior to Arma 3 v1.94, Nothing 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