2015-08-04 01:08:21 +00:00
|
|
|
/*
|
|
|
|
* Author: commy2
|
|
|
|
* Display Grenade information on grenade throw.
|
|
|
|
*
|
2015-08-08 12:40:23 +00:00
|
|
|
* Arguments:
|
2015-08-05 22:36:28 +00:00
|
|
|
* 0: unit - Object the event handler is assigned to <OBJECT>
|
|
|
|
* 1: weapon - Fired weapon <STRING>
|
|
|
|
* 2: muzzle - Muzzle that was used <STRING>
|
|
|
|
* 3: mode - Current mode of the fired weapon <STRING>
|
|
|
|
* 4: ammo - Ammo used <STRING>
|
|
|
|
* 5: magazine - magazine name which was used <STRING>
|
|
|
|
* 6: projectile - Object of the projectile that was shot <OBJECT>
|
2015-08-04 01:08:21 +00:00
|
|
|
*
|
2015-08-08 12:40:23 +00:00
|
|
|
* Return Value:
|
2015-08-04 01:08:21 +00:00
|
|
|
* None
|
2015-08-08 12:40:23 +00:00
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile] call ace_weaponselect_fnc_throwGrenade
|
|
|
|
*
|
|
|
|
* Public: No
|
2015-08-04 01:08:21 +00:00
|
|
|
*/
|
2015-01-17 17:26:51 +00:00
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-08-05 22:36:28 +00:00
|
|
|
params ["_unit", "_weapon", "", "", "", "_magazine"];
|
2015-01-17 17:26:51 +00:00
|
|
|
|
|
|
|
if (_weapon != "Throw") exitWith {};
|
|
|
|
|
|
|
|
private "_count";
|
|
|
|
_count = {_x == _magazine} count magazines _unit;
|
|
|
|
|
|
|
|
[_magazine, _count] call FUNC(displayGrenadeTypeAndNumber);
|
|
|
|
|
|
|
|
if (_count == 0) then {
|
|
|
|
if (GVAR(CurrentGrenadeMuzzleIsFrag)) then {GVAR(CurrentGrenadeMuzzleFrag) = ""} else {GVAR(CurrentGrenadeMuzzleOther) = ""};
|
|
|
|
};
|