ACE3/addons/zeus/functions/fnc_bi_moduleArsenal.sqf
Dedmen Miller e2ac18a05d [WIP] Fix script errors reporting wrong line numbers (#6407)
* advanced_ballistics

* advanced_fatigue

* advanced_throwing

* ai

* aircraft

* arsenal

* atragmx

* attach

* backpacks

* ballistics

* captives

* cargo

* chemlights

* common

* concertina_wire

* cookoff

* dagr

* disarming

* disposable

* dogtags

* dragging

* explosives

* fastroping

* fcs

* finger

* frag

* gestures

* gforces

* goggles

* grenades

* gunbag

* hearing

* hitreactions

* huntir

* interact_menu

* interaction

* inventory

* kestrel4500

* laser

* laserpointer

* logistics_uavbattery

* logistics_wirecutter

* magazinerepack

* map

* map_gestures

* maptools

* markers

* medical

* medical_ai

* medical_blood

* medical_menu

* microdagr

* minedetector

* missileguidance

* missionmodules

* mk6mortar

* modules

* movement

* nametags

* nightvision

* nlaw

* optics

* optionsmenu

* overheating

* overpressure

* parachute

* pylons

* quickmount

* rangecard

* rearm

* recoil

* refuel

* reload

* reloadlaunchers

* repair

* respawn

* safemode

* sandbag

* scopes

* slideshow

* spectator

* spottingscope

* switchunits

* tacticalladder

* tagging

* trenches

* tripod

* ui

* vector

* vehiclelock

* vehicles

* viewdistance

* weaponselect

* weather

* winddeflection

* yardage450

* zeus

* arsenal defines.hpp

* optionals

* DEBUG_MODE_FULL 1

* DEBUG_MODE_FULL 2

* Manual fixes

* Add SQF Validator check for #include after block comment

* explosives fnc_openTimerUI

* fix uniqueItems
2018-09-17 14:19:29 -05:00

66 lines
2.2 KiB
Plaintext

#include "script_component.hpp"
/*
* Author: Bohemia Interactive
* Module function to open a full arsenal on a unit
* Edited to use ACE arsenal when present, moved isPlayer check
*
* Arguments:
* 0: The module logic <LOGIC>
* 1: Not used
* 2: activated <BOOL>
*
* Return Value:
* None
*
* Example:
* [LOGIC, nil, true] call ace_zeus_fnc_bi_moduleArsenal
*
* Public: No
*/
params ["_logic", "", "_activated"];
if (_activated && local _logic) then {
_unit = _logic getvariable ["bis_fnc_curatorAttachObject_object",objnull];
//--- Check if the unit is suitable
_error = "";
switch true do {
case (isnull _unit): {_error = localize "str_a3_BIS_fnc_showCuratorFeedbackMessage_506";};
case !(alive _unit): {_error = localize "str_a3_BIS_fnc_moduleArsenal_errorDead";};
case (isnull group _unit || !(side group _unit in [east,west,resistance,civilian])): {_error = localize "str_a3_BIS_fnc_moduleArsenal_errorBrain";};
case (vehicle _unit != _unit || effectivecommander _unit != _unit): {_error = localize "str_a3_BIS_fnc_moduleArsenal_errorVehicle";};
};
if (_error == "") then {
if (["ACE_Arsenal"] call EFUNC(common,isModLoaded)) then {
if (!isPlayer _unit || {player == _unit}) then {
[{
params ["_unit"];
[_unit, _unit, true] call EFUNC(arsenal,openBox);
}, [_unit]] call CBA_fnc_directCall;
} else {
[objNull, localize "str_a3_BIS_fnc_moduleArsenal_errorDead"] call bis_fnc_showCuratorFeedbackMessage;
};
} else {
if !(isPlayer _unit) then {
([] call bis_fnc_rscLayer) cuttext ["","black out",0.5];
["#(argb,8,8,3)color(0,0,0,1)",false,nil,0,[0.5,0]] call bis_fnc_textTiles;
["Open",[true,nil,_unit]] call bis_fnc_arsenal;
([] call bis_fnc_rscLayer) cuttext ["","plain"];
} else {
[objNull, localize "str_a3_BIS_fnc_moduleArsenal_errorDead"] call bis_fnc_showCuratorFeedbackMessage;
};
};
} else {
[objNull,_error] call bis_fnc_showCuratorFeedbackMessage;
};
deleteVehicle _logic;
};