-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinitUAVCache.sqf
More file actions
45 lines (34 loc) · 1.23 KB
/
initUAVCache.sqf
File metadata and controls
45 lines (34 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#define UAV_RESPAWN_TIME 600
private ["_cache"];
_cache = _this select 0;
if(isServer) then
{
sleep 1;
clearMagazineCargoGlobal _cache;
clearWeaponCargoGlobal _cache;
clearItemCargoGlobal _cache;
clearBackpackCargoGlobal _cache;
_cache addBackpackCargoGlobal ["B_UAV_01_backpack_F", maxUavs];
_cache addItemCargoGlobal ["B_UavTerminal", maxUavs];
availableUavs = maxUavs;
uavCache = _cache;
mh_drone_cache_refill = {
[] spawn {
sleep UAV_RESPAWN_TIME;
[[[West, "HQ"], "A UAV has been delivered at the base"], "sideChat", west] call Bis_fnc_mp;
uavCache addBackpackCargoGlobal ["B_UAV_01_backpack_F", 1];
uavCache addItemCargoGlobal ["B_UavTerminal", 1];
};
};
};
if(!isDedicated) then
{
_cache addAction [format["Destroy UAV", name _x], {
private ["_caller"];
_caller = _this select 1;
[[[West, "HQ"], format ["%1 has destroyed all UAVs", name _caller] ], "sideChat", west] call Bis_fnc_mp;
{
_x setDamage 1.0;
} forEach allUnitsUAV;
}, [], 0, false, true, "", "side _this == west && count allUnitsUAV > 0"];
};