isLaserOn: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - " +" to " ")
m (Fix syntaxhighlight usage)
 
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{RV|type=command
{{RV|type=command


| arma3
|game1= arma3
|version1= 1.78


|1.78
|arg= local


|arg=local
|eff= global


|eff=global
|gr1= Weapons
 
|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.
 
|s1= [[isLaserOn]] entity


|gr1= Weapons
|p1= entity: [[Object]] - unit or vehicle
 
|r1= [[Boolean]] - [[true]] when laser is on, [[false]] otherwise


| Returns true if the vehicle has its laser turned on. Not to be confused with [[isIRLaserOn]] which is for units
|s2= vehicle [[isLaserOn]] turret
|s2since=Arma3 2.12


| '''isLaserOn''' vehicle
|p21= vehicle: [[Object]] - transport


|p1=vehicle: [[Object]]
|p22= turret: [[Array]] - turret path, [-1] for driver turret


|x1= <code>_on = [[isLaserOn]] _vehicle;</code>
|r2= [[Boolean]] - [[true]] when laser is on, [[false]] otherwise


| [[Boolean]]: True when laser is on, otherwise false
|x1= <sqf>if (isLaserOn _vehicle) then { hint "target ready" };</sqf>


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


 
{{Note
{{GameCategory|arma3|Scripting Commands}}
|user= Samatra
|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.
}}

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.