2026-08-28 18:14:49 +10:00
|
|
|
|
/*
|
|
|
|
|
|
Author: Clarky
|
|
|
|
|
|
Usage:
|
|
|
|
|
|
[this] call CLRK_fnc_initSupplyDepotInteractions;
|
|
|
|
|
|
|
|
|
|
|
|
Intended to run locally on each client.
|
|
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
params ["_depot"];
|
|
|
|
|
|
|
|
|
|
|
|
if (isNull _depot) exitWith {hint "Object ain't exist";};
|
|
|
|
|
|
if !(_depot getVariable ["isSupplyDepot", false]) exitWith {hint "Object ain't supply depot";};
|
|
|
|
|
|
|
|
|
|
|
|
// Prevent duplicate actions if script runs again
|
|
|
|
|
|
if (_depot getVariable ["supplyInteractionsAdded", false]) exitWith {};
|
|
|
|
|
|
|
|
|
|
|
|
_depot setVariable ["supplyInteractionsAdded", true];
|
|
|
|
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////
|
|
|
|
|
|
// INIT STATUS ACTION
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
_depot addAction [
|
|
|
|
|
|
"<t color='#FFD700'>Check Materiel Status</t>",
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
params ["_target", "_caller"];
|
|
|
|
|
|
|
|
|
|
|
|
private _current =
|
|
|
|
|
|
_target getVariable ["currentMateriel", 0];
|
|
|
|
|
|
|
|
|
|
|
|
private _max =
|
|
|
|
|
|
_target getVariable ["maxMateriel", 300];
|
|
|
|
|
|
|
|
|
|
|
|
[
|
|
|
|
|
|
"CLRK_ShowMessage",
|
|
|
|
|
|
[
|
|
|
|
|
|
3,
|
|
|
|
|
|
1,
|
|
|
|
|
|
format
|
|
|
|
|
|
[
|
|
|
|
|
|
"SUPPLY DEPOT STORAGE<br />Materiel: %1 / %2",
|
|
|
|
|
|
_current,
|
|
|
|
|
|
_max
|
|
|
|
|
|
]
|
|
|
|
|
|
],
|
|
|
|
|
|
_caller
|
|
|
|
|
|
] call CBA_fnc_targetEvent;
|
|
|
|
|
|
},
|
|
|
|
|
|
nil,
|
|
|
|
|
|
1,
|
|
|
|
|
|
true,
|
|
|
|
|
|
false,
|
|
|
|
|
|
"",
|
|
|
|
|
|
"true",
|
|
|
|
|
|
6
|
2026-08-29 14:38:47 +10:00
|
|
|
|
];
|