ACE3/addons/atragmx/functions/fnc_change_gun.sqf
2015-04-08 11:05:28 +02:00

24 lines
819 B
Plaintext

#include "script_component.hpp"
if (_this < 0 || _this > (count GVAR(gunList)) - 1) exitWith {};
GVAR(workingMemory) set [GVAR(currentTarget), +(GVAR(gunList) select _this)];
GVAR(currentGun) set [GVAR(currentTarget), _this];
lbSetCurSel [6000, (GVAR(currentGun) select GVAR(currentTarget))];
if ((GVAR(scopeUnits) select (GVAR(currentScopeUnit) select GVAR(currentTarget))) != "Clicks") then
{
GVAR(currentScopeUnit) set [GVAR(currentTarget), (GVAR(workingMemory) select GVAR(currentTarget)) select 6];
};
[] call FUNC(update_gun);
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);