Page tree
Skip to end of metadata
Go to start of metadata



Introduced in

Version:1.20

Description

Description:Returns an array of modes that can be used by the passed weapon muzzle. The modes are listed as either string class names, or as configuration paths, depending on the input syntax.

Syntax

Syntax:config call fn_vbs_getModes
Parameters:
  • config: Config-2 - Configuration pointing to muzzle or weapon.
Return Value:Array of Config-2 - One for each mode.

Alternative Syntax

Syntax:[weaponClass, muzzleClass] call fn_vbs_getModes
Parameters:
  • weaponClass: String - Class name of weapon.
  • muzzleClass: String - Class name of muzzle. Identical to weapon class name for weapons with no muzzles.
Return Value:Array of String - One for each mode.

Warning

When using functions in VBS versions older than 3.4, certain limitations and requirements should be kept in mind - the main ones being that capitalization of the function name is crucial, and that #include "\vbs2\headers\function_library.hpp" has to be included in every script that utilizes it. More Category VBS Scripting Functions.

Examples

Examples:
_modes = (configFile >> "CfgWeapons" >> "vbs2_us_m16a2_iron_gla" >> "vbs2_M203_Muzzle") call fn_vbs_getModes 
_modes = ["vbs2_us_m16a2_iron_gla","vbs2_M203_Muzzle"] call fn_vbs_getModes  
_modes = ["vbs2_us_m16a2_iron_none","vbs2_us_m16a2_iron_none"] call fn_vbs_getModes 

Additional Information

See also: setWeaponMode, SWITCHWEAPON
Multiplayer: 
Problems: 

Notes