2016-08-27 08:19:39 +00:00
|
|
|
/*
|
|
|
|
* Author: voiper
|
|
|
|
* Create and throw IR chemlight.
|
|
|
|
*
|
|
|
|
* Arguments:
|
2016-08-31 20:12:40 +00:00
|
|
|
* 0: Original throw projectile <OBJECT>
|
|
|
|
* 1: Class of projectile <STRING>
|
|
|
|
* 2: Adv throw (default: false) <BOOL><OPTIONAL>
|
2016-08-27 08:19:39 +00:00
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [_projectile, _ammoType] call ace_chemlights_fnc_throwIR;
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2016-08-31 20:12:40 +00:00
|
|
|
params ["_projectile", "_ammo", ["_replaceAdvThrowable", false]];
|
2016-08-27 08:19:39 +00:00
|
|
|
|
|
|
|
private _config = configFile >> "CfgAmmo" >> _ammo;
|
|
|
|
private _dummyClass = getText (_config >> "ACE_Chemlight_IR");
|
|
|
|
private _pos = getPosATL _projectile;
|
|
|
|
private _velocity = velocity _projectile;
|
|
|
|
|
|
|
|
deleteVehicle _projectile;
|
|
|
|
private _dummy = _dummyClass createVehicle _pos;
|
|
|
|
_dummy setPosATL _pos;
|
|
|
|
[_dummy, 90, 0] call BIS_fnc_setPitchBank;
|
|
|
|
_dummy setVelocity _velocity;
|
2016-08-31 20:12:40 +00:00
|
|
|
|
|
|
|
if (_replaceAdvThrowable) then {
|
2016-09-05 18:23:03 +00:00
|
|
|
ACE_player setVariable [QEGVAR(advanced_throwing,activeThrowable), _dummy];
|
2016-08-31 20:12:40 +00:00
|
|
|
};
|