isLaserOn: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
m (Text replacement - "Samatra" to "Sa-Matra")
 
(27 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{Command|Comments=
{{RV|type=command
____________________________________________________________________________________________


| arma3 |Game=
|game1= arma3
|version1= 1.78


|1.78|Game Version (number surrounded by NO SPACES)=
|arg= local


|arg=local |Multiplayer Arguments= ("local" or "global")
|eff= global


|eff=global  |Multiplayer Effects= ("local" or "global")
|gr1= Weapons


|serverExec= |= Multiplayer Execution ("server" or empty)
|descr= Returns true if the vehicle has its laser turned on. Not to be confused with [[isIRLaserOn]] which is for units. Main syntax is for primary gunner turret.


|gr1= Weapons |GROUP1=
|s1= [[isLaserOn]] entity
____________________________________________________________________________________________


| Returns true if the vehicle has its laser turned on. Not to be confused with [[isIRLaserOn]] which is for units |DESCRIPTION=
|p1= entity: [[Object]] - unit or vehicle
____________________________________________________________________________________________


| '''isLaserOn''' vehicle  |SYNTAX=
|r1= [[Boolean]] - [[true]] when laser is on, [[false]] otherwise


|p1=vehicle: [[Object]] |PARAMETER1=
|s2= vehicle [[isLaserOn]] turret
|s2since=Arma3 2.12


|x1= <code>_on = [[isLaserOn]] _vehicle;</code> |Example 1=
|p21= vehicle: [[Object]] - transport


| [[Boolean]]: True when laser is on, otherwise false |RETURNVALUE=
|p22= turret: [[Array]] format [[Turret Path]] - [-1] for driver turret


| [[enableIRLasers]] [[isIRLaserOn]] |SEEALSO=
|r2= [[Boolean]] - [[true]] when laser is on, [[false]] otherwise


|x1= <sqf>if (isLaserOn _vehicle) then { hint "target ready" };</sqf>
|seealso= [[laserTarget]] [[enableIRLasers]] [[isIRLaserOn]]
}}
}}


<dl class="command_description">
{{Note
<!-- BEGIN Note Section -->
|user= Sa-Matra
<!-- For example:
|timestamp= 20221227082727
<dd class="notedate">Posted on Month Day, Year - Time (UTC)</dd>
|text= Does not mean there is actual laser object present. Returns laser designator weapon's toggle state. In other words [[isLaserOn]] can return <sqf inline>true</sqf> while [[laserTarget]] returns {{hl|<NULL-object>}}, for example in case laser was turned on and unit left the vehicle, there would be no laser target entity anymore, while designator is still turned on.
<dt class="note">[[User:User Name|User Name]]</dt>
}}
<dd class="note">This is an example note. It is true and verifiable, and contains a little code snippet.
<code>[[if]] ([[_this]] == anExample) [[then]] { [[hint]] "Leave it here for others to read"; };</code></dd>
-->
<!-- END Note Section -->
</dl>
 
<h3 style="display:none">Bottom Section</h3>
<!-- Appropriate categories go here -->
 
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]

Latest revision as of 20:58, 4 July 2024

Hover & click on the images for description

Description

Description:
Returns true if the vehicle has its laser turned on. Not to be confused with isIRLaserOn which is for units. Main syntax is for primary gunner turret.
Groups:
Weapons

Syntax

Syntax:
isLaserOn entity
Parameters:
entity: Object - unit or vehicle
Return Value:
Boolean - true when laser is on, false otherwise

Alternative Syntax

Syntax:
vehicle isLaserOn turret
Parameters:
vehicle: Object - transport
turret: Array format Turret Path - [-1] for driver turret
Return Value:
Boolean - true when laser is on, false otherwise

Examples

Example 1:
if (isLaserOn _vehicle) then { hint "target ready" };

Additional Information

See also:
laserTarget enableIRLasers isIRLaserOn

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
Sa-Matra - c
Posted on Dec 27, 2022 - 08:27 (UTC)
Does not mean there is actual laser object present. Returns laser designator weapon's toggle state. In other words isLaserOn can return true while laserTarget returns <NULL-object>, for example in case laser was turned on and unit left the vehicle, there would be no laser target entity anymore, while designator is still turned on.