isLaserOn: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (stable)
m (Fix syntaxhighlight usage)
 
(38 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{Command|=
{{RV|type=command
____________________________________________________________________________________________


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


|1.77|= 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


|exec= |= 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.
____________________________________________________________________________________________


| Returns true if the vehicle has its laser turned on. |= Description
|s1= [[isLaserOn]] entity
____________________________________________________________________________________________


| '''isLaserOn''' vehicle |= Syntax
|p1= entity: [[Object]] - unit or vehicle


|p1=vehicle: [[Object]] |= Parameter 1
|r1= [[Boolean]] - [[true]] when laser is on, [[false]] otherwise


|p2= |= Parameter 2
|s2= vehicle [[isLaserOn]] turret
|s2since=Arma3 2.12


|p3= |= Parameter 3
|p21= vehicle: [[Object]] - transport


|p4= |= Parameter 4
|p22= turret: [[Array]] - turret path, [-1] for driver turret


|p5= |= Parameter 5
|r2= [[Boolean]] - [[true]] when laser is on, [[false]] otherwise


|p6= |= Parameter 6
|x1= <sqf>if (isLaserOn _vehicle) then { hint "target ready" };</sqf>
 
|p7=  |= Parameter 7
 
|p8=  |= Parameter 8
 
|p9=  |= Parameter 9
 
|p10=  |= Parameter 10
 
|p11=  |= Parameter 11
 
|p12=  |= Parameter 12
 
|p13=  |= Parameter 13
 
|p14=  |= Parameter 14
 
|p15=  |= Parameter 15
 
|p16=  |= Parameter 16
 
|p17=  |= Parameter 17
 
|p18=  |= Parameter 18
 
|p19=  |= Parameter 19
 
|p20=  |= Parameter 20
 
| [[Boolean]]: True when laser is on, otherwise false |= Return Value
 
 
<!-- START alternative syntax (optional) -->
 
|s2=  |= Alternative Syntax
 
|p21=  |= Alternative Parameter 1
 
|p22=  |= Alternative Parameter 2
 
|p23=  |= Alternative Parameter 3
 
|p24=  |= Alternative Parameter 4
 
|p25=  |= Alternative Parameter 5
 
|p26=  |= Alternative Parameter 6
 
|p27=  |= Alternative Parameter 7
 
|p28=  |= Alternative Parameter 8
 
|p29=  |= Alternative Parameter 9
 
|p30=  |= Alternative Parameter 10
 
|p31=  |= Alternative Parameter 11
 
|p32=  |= Alternative Parameter 12
 
|p33=  |= Alternative Parameter 13
 
|p34=  |= Alternative Parameter 14
 
|p35=  |= Alternative Parameter 15
 
|p36=  |= Alternative Parameter 16
 
|p37=  |= Alternative Parameter 17
 
|p38=  |= Alternative Parameter 18
 
|p39=  |= Alternative Parameter 19
 
|p40=  |= Alternative Parameter 20
 
|r2=  |= Alternative Return Value
 
<!-- END alternative syntax (optional) -->
 
 
<!-- START alternative syntax 2 (optional) -->
 
|s3=  |= Alternative Syntax 2
 
|p41=  |= Alternative 2 Parameter 1
 
|p42=  |= Alternative 2 Parameter 2
 
|p43=  |= Alternative 2 Parameter 3
 
|p44=  |= Alternative 2 Parameter 4
 
|p45=  |= Alternative 2 Parameter 5
 
|p46=  |= Alternative 2 Parameter 6
 
|p47=  |= Alternative 2 Parameter 7
 
|p48=  |= Alternative 2 Parameter 8
 
|p49=  |= Alternative 2 Parameter 9
 
|p50=  |= Alternative 2 Parameter 10
 
|p51=  |= Alternative 2 Parameter 11
 
|p52=  |= Alternative 2 Parameter 12
 
|p53=  |= Alternative 2 Parameter 13
 
|p54=  |= Alternative 2 Parameter 14
 
|p55=  |= Alternative 2 Parameter 15
 
|p56=  |= Alternative 2 Parameter 16
 
|p57=  |= Alternative 2 Parameter 17
 
|p58=  |= Alternative 2 Parameter 18
 
|p59=  |= Alternative 2 Parameter 19
 
|p60=  |= Alternative 2 Parameter 20
 
|r3=  |= Alternative 2 Return Value
 
<!-- END alternative syntax 2 (optional) -->


|seealso= [[laserTarget]] [[enableIRLasers]] [[isIRLaserOn]]
}}


<!-- START alternative syntax 3 (optional) -->
{{Note
 
|user= Samatra
|s4=  |= Alternative Syntax 3
|timestamp= 20221227082727
 
|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.
|p61=  |= Alternative 3 Parameter 1
 
|p62=  |= Alternative 3 Parameter 2
 
|p63=  |= Alternative 3 Parameter 3
 
|p64=  |= Alternative 3 Parameter 4
 
|p65=  |= Alternative 3 Parameter 5
 
|p66=  |= Alternative 3 Parameter 6
 
|p67=  |= Alternative 3 Parameter 7
 
|p68= |= Alternative 3 Parameter 8
 
|p69= |= Alternative 3 Parameter 9
 
|p70=  |= Alternative 3 Parameter 10
 
|p71=  |= Alternative 3 Parameter 11
 
|p72=  |= Alternative 3 Parameter 12
 
|p73=  |= Alternative 3 Parameter 13
 
|p74=  |= Alternative 3 Parameter 14
 
|p75=  |= Alternative 3 Parameter 15
 
|p76=  |= Alternative 3 Parameter 16
 
|p77=  |= Alternative 3 Parameter 17
 
|p78=  |= Alternative 3 Parameter 18
 
|p79=  |= Alternative 3 Parameter 19
 
|p80=  |= Alternative 3 Parameter 20
 
|r4=  |= Alternative 3 Return Value
 
<!-- END alternative syntax 3 (optional) -->
 
 
<!-- START alternative syntax 4 (optional) -->
 
|s5=  |= Alternative Syntax 4
 
|p81=  |= Alternative 4 Parameter 1
 
|p82=  |= Alternative 4 Parameter 2
 
|p83=  |= Alternative 4 Parameter 3
 
|p84=  |= Alternative 4 Parameter 4
 
|p85=  |= Alternative 4 Parameter 5
 
|p86=  |= Alternative 4 Parameter 6
 
|p87=  |= Alternative 4 Parameter 7
 
|p88=  |= Alternative 4 Parameter 8
 
|p89=  |= Alternative 4 Parameter 9
 
|p90=  |= Alternative 4 Parameter 10
 
|p91=  |= Alternative 4 Parameter 11
 
|p92=  |= Alternative 4 Parameter 12
 
|p93=  |= Alternative 4 Parameter 13
 
|p94=  |= Alternative 4 Parameter 14
 
|p95=  |= Alternative 4 Parameter 15
 
|p96=  |= Alternative 4 Parameter 16
 
|p97=  |= Alternative 4 Parameter 17
 
|p98=  |= Alternative 4 Parameter 18
 
|p99=  |= Alternative 4 Parameter 19
 
|p100=  |= Alternative 4 Parameter 20
 
|r5=  |= Alternative 4 Return Value
 
<!-- END alternative syntax 4 (optional) -->
____________________________________________________________________________________________
 
|x1= <code> '''isLaserOn''' [[vehicle]] [[player]] </code> |= Example 1
____________________________________________________________________________________________
 
|x2=  |= Example 2
____________________________________________________________________________________________
 
|x3=  |= Example 3
____________________________________________________________________________________________
 
|x4=  |= Example 4
____________________________________________________________________________________________
 
|x5=  |= Example 5
____________________________________________________________________________________________
 
|x6=  |= Example 6
____________________________________________________________________________________________
 
|x7=  |= Example 7
____________________________________________________________________________________________
 
|x8=  |= Example 8
____________________________________________________________________________________________
 
|x9=  |= Example 9
____________________________________________________________________________________________
 
|x10=  |= Example 10
____________________________________________________________________________________________
 
|mp= - |= Multiplayer Behaviour
 
|  |= See Also
 
}}
}}
<dl class="command_description">
<!-- BEGIN Note Section -->
<!-- For example:
<dd class="notedate">Posted on Month Day, Year - Time (UTC)</dd>
<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 19:16, 28 December 2022

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 - 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
Samatra - 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.