summaryrefslogtreecommitdiffstats
path: root/Client/Action/Action_RepairMHQ.sqf
diff options
context:
space:
mode:
authorhybrid <hybrid@hybridlabs.pro>2026-06-11 19:53:22 +0300
committerhybrid <hybrid@hybridlabs.pro>2026-06-11 19:53:22 +0300
commitc055d44dcdb87e8db49fb23e632fc086aa44cce6 (patch)
tree7ac98d865915930bebc86b36b512a859c31538e5 /Client/Action/Action_RepairMHQ.sqf
downloada2wf_zargabad-c055d44dcdb87e8db49fb23e632fc086aa44cce6.tar.gz
a2wf_zargabad-c055d44dcdb87e8db49fb23e632fc086aa44cce6.tar.bz2
a2wf_zargabad-c055d44dcdb87e8db49fb23e632fc086aa44cce6.zip
init
Diffstat (limited to 'Client/Action/Action_RepairMHQ.sqf')
-rw-r--r--Client/Action/Action_RepairMHQ.sqf29
1 files changed, 29 insertions, 0 deletions
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