From e670b4ed55c459a21090bd0178ceaaaf12d87989 Mon Sep 17 00:00:00 2001 From: hybrid Date: Thu, 11 Jun 2026 19:58:31 +0300 Subject: init --- Client/Action/Action_RepairMHQ.sqf | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Client/Action/Action_RepairMHQ.sqf (limited to 'Client/Action/Action_RepairMHQ.sqf') diff --git a/Client/Action/Action_RepairMHQ.sqf b/Client/Action/Action_RepairMHQ.sqf new file mode 100644 index 0000000..4a7eddc --- /dev/null +++ b/Client/Action/Action_RepairMHQ.sqf @@ -0,0 +1,29 @@ +Private ["_currency","_currencySym","_hq","_isBeingFixed","_repairPrice","_vehicle"]; + +_vehicle = _this select 0; + +_hq = (sideJoinedText) Call GetSideHQ; +if (alive _hq || (_hq distance _vehicle > 30)) exitWith {hint (localize "STR_WF_INFO_Repair_MHQ_None")}; + +//--- Is HQ already being fixed? +_isBeingFixed = WF_Logic getVariable Format ["%1MHQRepair",sideJoinedText]; +if (_isBeingFixed) exitWith {hint (localize "STR_WF_INFO_Repair_MHQ_BeingRepaired")}; + +_repairPrice = 'WFBE_MHQREPAIRPRICE' Call GetNamespace; +_currency = if !(paramMoneyOnly) then {(sideJoined) Call GetSideSupply} else {Call GetPlayerFunds}; +_currencySym = if !(paramMoneyOnly) then {"S"} else {"$"}; +if (_currency < _repairPrice) exitWith {hint Format [localize "STR_WF_INFO_Repair_MHQ_Funds",_currencySym,_repairPrice - _currency]}; + +if !(paramMoneyOnly) then { + [sideJoined,-_repairPrice] Call ChangeSideSupply; +} else { + -(_repairPrice) Call ChangePlayerFunds; +}; + +WFBE_RequestMHQRepair = ['SRVFNCREQUESTMHQREPAIR',sideJoined]; +publicVariable 'WFBE_RequestMHQRepair'; +if (isHostedServer) then {['SRVFNCREQUESTMHQREPAIR',sideJoined] Spawn HandleSPVF}; + +WF_Logic setVariable [Format ["%1MHQRepair",sideJoinedText],true,true]; + +hint (localize "STR_WF_INFO_Repair_MHQ_Repair"); \ No newline at end of file -- cgit v1.3.1