ACE3/addons/atragmx/functions/fnc_change_gun.sqf

24 lines
819 B
Plaintext
Raw Normal View History

#include "script_component.hpp"
2015-04-08 09:05:28 +00:00
if (_this < 0 || _this > (count GVAR(gunList)) - 1) exitWith {};
2015-04-08 09:05:28 +00:00
GVAR(workingMemory) set [GVAR(currentTarget), +(GVAR(gunList) select _this)];
GVAR(currentGun) set [GVAR(currentTarget), _this];
2015-04-08 09:05:28 +00:00
lbSetCurSel [6000, (GVAR(currentGun) select GVAR(currentTarget))];
2015-04-08 09:05:28 +00:00
if ((GVAR(scopeUnits) select (GVAR(currentScopeUnit) select GVAR(currentTarget))) != "Clicks") then
{
2015-04-08 09:05:28 +00:00
GVAR(currentScopeUnit) set [GVAR(currentTarget), (GVAR(workingMemory) select GVAR(currentTarget)) select 6];
};
[] call FUNC(update_gun);
2015-04-08 09:05:28 +00:00
GVAR(elevationOutput) set [GVAR(currentTarget), 0];
GVAR(windageOutput) set [GVAR(currentTarget), 0];
GVAR(leadOutput) set [GVAR(currentTarget), 0];
GVAR(tofOutput) set [GVAR(currentTarget), 0];
GVAR(velocityOutput) set [GVAR(currentTarget), 0];
[] call FUNC(update_result);