Returns the type of weapon the unit is currently using. Does not return the class name of the weapon used, but rather whether it is the primary weapon (for example, a rifle), secondary weapon (for example, launcher) or a handgun.
If the specified object is not a unit, or if the unit is unarmed or in a vehicle, or the weapon is on the back or holstered, then "NONE" is returned.
Note: Before V3.4, not reliable for launchers or pistols held in the safety position.
|Syntax:||unit call fn_vbs_selectedWeaponType|
|Return Value:||String - One of |
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.
_weap = player call fn_vbs_selectedWeaponType;
|See also:||primaryWeapon, secondaryWeapon, PistolWeapon|