setWeaponZeroing: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "- True" to "- true")
m (Some wiki formatting)
Line 12: Line 12:
|p1= object: [[Object]] - Unit or vehicle
|p1= object: [[Object]] - Unit or vehicle


|p2= weaponClass: [[String]] - Class name of weapon
|p2= weaponClass: [[String]] - class name of weapon


|p3= muzzleClass: [[String]] - Class name of the muzzle
|p3= muzzleClass: [[String]] - class name of the muzzle


|p4= zeroingIndex: [[Number]] - Zeroing index, see [[currentZeroing]]
|p4= zeroingIndex: [[Number]] - zeroing index. See [[currentZeroing]]


|r1= [[Boolean]] - [[true]] if successful, otherwise [[false]] is returned (e.g. weapon, muzzle, or zeroing index is invalid)
|r1= [[Boolean]] - [[true]] if successful, otherwise [[false]] is returned (e.g. weapon, muzzle, or zeroing index is invalid)


|x1= <code>[[player]] [[setWeaponZeroing]] ["arifle_MX_GL_F", "GL_3GL_F", 8]; {{cc|Set zeroing for underbarrel grenade launcher to 400 m}}</code>
|x1= <sqf>player setWeaponZeroing ["arifle_MX_GL_F", "GL_3GL_F", 8]; // Set zeroing for underbarrel grenade launcher to 400m</sqf>


|seealso= [[currentZeroing]]
|seealso= [[currentZeroing]]
}}
}}

Revision as of 17:32, 5 May 2022

Hover & click on the images for description

Description

Description:
Sets zeroing of given weapon and muzzle for given unit or vehicle.
Groups:
Weapons

Syntax

Syntax:
object setWeaponZeroing [weaponClass, muzzleClass, zeroingIndex]
Parameters:
object: Object - Unit or vehicle
weaponClass: String - class name of weapon
muzzleClass: String - class name of the muzzle
zeroingIndex: Number - zeroing index. See currentZeroing
Return Value:
Boolean - true if successful, otherwise false is returned (e.g. weapon, muzzle, or zeroing index is invalid)

Examples

Example 1:
player setWeaponZeroing ["arifle_MX_GL_F", "GL_3GL_F", 8]; // Set zeroing for underbarrel grenade launcher to 400m

Additional Information

See also:
currentZeroing

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