ACE3/addons/overheating/functions/fnc_swapBarrelCallback.sqf

33 lines
804 B
Plaintext
Raw Normal View History

2015-01-16 02:36:31 +00:00
/*
* Author: Commy2
* Swap barrel callback
*
* Argument:
2015-02-08 22:54:12 +00:00
* 0: Unit <OBJECT>
* 1: Weapon <STRING>
2015-01-16 02:36:31 +00:00
*
* Return value:
* None
2015-02-08 22:54:12 +00:00
*
2015-12-15 07:09:26 +00:00
* Example:
* [player, currentWeapon player] call ace_overheating_fnc_swapBarrelCallback
*
2015-02-08 22:54:12 +00:00
* Public: No
2015-01-16 02:36:31 +00:00
*/
2015-12-15 07:09:26 +00:00
#include "script_component.hpp"
2015-01-13 03:23:14 +00:00
2015-12-15 07:09:26 +00:00
params ["_player", "_weapon"];
TRACE_2("params",_player,_weapon);
2015-01-13 03:23:14 +00:00
// Barrel mount gesture
2016-01-20 16:44:51 +00:00
_player playAction QGVAR(GestureMountMuzzle);
2016-01-20 15:48:39 +00:00
playSound "ACE_BarrelSwap";
2015-01-13 03:23:14 +00:00
// don't consume the barrel, but rotate through them.
2015-05-28 19:59:04 +00:00
[localize LSTRING(SwappedBarrel), QUOTE(PATHTOF(UI\spare_barrel_ca.paa))] call EFUNC(common,displayTextPicture);
2015-01-13 03:23:14 +00:00
// Publish the temperature variable
2016-01-20 15:15:25 +00:00
_player setVariable [format [QGVAR(%1_temp), _weapon], 0, true];
// Store the update time
2016-01-20 15:15:25 +00:00
_player setVariable [format [QGVAR(%1_time), _weapon], ACE_time];