2015-02-10 04:22:10 +00:00
|
|
|
/*
|
|
|
|
* Author: commy2
|
|
|
|
* Get the index of the weapon.
|
|
|
|
*
|
2015-09-21 11:08:10 +00:00
|
|
|
* Arguments:
|
2015-02-10 04:22:10 +00:00
|
|
|
* 0: Unit <OBJECT>
|
|
|
|
* 1: Weapon <STRING>
|
|
|
|
*
|
2015-09-21 11:08:10 +00:00
|
|
|
* Return Value:
|
2015-02-10 04:22:10 +00:00
|
|
|
* Weapon index <NUMBER>
|
2015-09-21 11:08:10 +00:00
|
|
|
* 0 = primary
|
|
|
|
* 1 = secondary
|
|
|
|
* 2 = handgun
|
|
|
|
* -1 = other
|
2015-02-10 04:22:10 +00:00
|
|
|
*
|
2017-06-08 13:31:51 +00:00
|
|
|
* Example:
|
|
|
|
* [bob, "gun"] call ace_common_fnc_getWeaponIndex
|
|
|
|
*
|
2015-09-21 11:08:10 +00:00
|
|
|
* Public: Yes
|
2015-02-10 04:22:10 +00:00
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-09-21 11:08:10 +00:00
|
|
|
params ["_unit", "_weapon"];
|
2015-02-10 04:22:10 +00:00
|
|
|
|
2015-02-13 02:43:50 +00:00
|
|
|
if (_weapon == "") exitWith {-1};
|
2015-02-12 14:57:55 +00:00
|
|
|
|
2015-02-10 04:22:10 +00:00
|
|
|
[
|
|
|
|
primaryWeapon _unit,
|
|
|
|
secondaryWeapon _unit,
|
|
|
|
handgunWeapon _unit
|
2015-09-21 11:08:10 +00:00
|
|
|
] find _weapon // return
|