ACE3/addons/explosives/functions/fnc_getSpeedDialExplosive.sqf

33 lines
587 B
Plaintext
Raw Normal View History

/*
* Author: Garth 'L-H' de Wet
* Gets the explosive from the speed dial entry.
*
* Arguments:
* 0: Speed dial entry <STRING>
*
* Return Value:
* Associated explosive (or ObjNull) <OBJECT>
*
* Example:
* ["2113"] call ace_explosives_fnc_getSpeedDialExplosive;
*
* Public: Yes
*/
#include "script_component.hpp"
2015-08-15 19:35:33 +00:00
params ["_code"];
TRACE_1("params",_code);
private ["_explosive"];
2015-08-15 19:35:33 +00:00
if (isNil QGVAR(CellphoneIEDs)) exitWith {[]};
_explosive = [];
{
if ((_x select 1) == _code) exitWith {
_explosive = _x;
};
false
} count GVAR(CellphoneIEDs);
2015-08-15 19:35:33 +00:00
_explosive