summaryrefslogtreecommitdiffstats
path: root/Client/Functions/Client_CommanderUpgrade.sqf
diff options
context:
space:
mode:
authorhybrid <hybrid@hybridlabs.pro>2026-06-11 19:55:24 +0300
committerhybrid <hybrid@hybridlabs.pro>2026-06-11 19:55:24 +0300
commit628d33984d9228f1781d13a65fbb80f35facc899 (patch)
treecd909141f87e14f22c3511549a9bc067d9ff8b50 /Client/Functions/Client_CommanderUpgrade.sqf
downloada2wf_sara-628d33984d9228f1781d13a65fbb80f35facc899.tar.gz
a2wf_sara-628d33984d9228f1781d13a65fbb80f35facc899.tar.bz2
a2wf_sara-628d33984d9228f1781d13a65fbb80f35facc899.zip
init
Diffstat (limited to '')
-rw-r--r--Client/Functions/Client_CommanderUpgrade.sqf34
1 files changed, 34 insertions, 0 deletions
diff --git a/Client/Functions/Client_CommanderUpgrade.sqf b/Client/Functions/Client_CommanderUpgrade.sqf
new file mode 100644
index 0000000..366fa31
--- /dev/null
+++ b/Client/Functions/Client_CommanderUpgrade.sqf
@@ -0,0 +1,34 @@
+private ["_i","_index","_index2","_name","_time","_upgrades"];
+_time = _this select 0;
+_index = _this select 1;
+_index2 = _this select 2;
+_name = _this select 3;
+isUpgrading = true;
+
+hint Format [localize "STR_WF_Upgrade_Start",_name];
+
+WFBE_RequestChangeScore = ['SRVFNCREQUESTCHANGESCORE',[player,score player + ('WFBE_COMMANDERUPGRADESCORE' Call GetNamespace)]];
+publicVariable 'WFBE_RequestChangeScore';
+if (!isMultiplayer || (isServer && local player)) then {['SRVFNCREQUESTCHANGESCORE',[player,score player + ('WFBE_COMMANDERUPGRADESCORE' Call GetNamespace)]] Spawn HandleSPVF};
+
+_i = _time;
+while {_i > 0} do {
+ _i = _i - 1;
+ upgradingTime = _i;
+ sleep 1;
+};
+_upgrades = (sideJoinedText) Call GetSideUpgrades;
+_upgrades Set [_index,_index2 + 1];
+Call Compile Format ["%1Upgrades = _upgrades; publicVariable '%1Upgrades';",sideJoinedText];
+upgradingTime = -1;
+isUpgrading = false;
+hint Format [localize "STR_WF_Upgrade_Complete",_name,_index2 + 1];
+WFBE_LocalizeMessage = [sideJoined,'CLTFNCLOCALIZEMESSAGE',['UpgradeComplete',_index,(_index2 + 1)]];
+publicVariable 'WFBE_LocalizeMessage';
+if (!isMultiplayer || (isServer && local player) || local player) then {[sideJoined,'CLTFNCLOCALIZEMESSAGE',['UpgradeComplete',_index,(_index2 + 1)]] Spawn HandlePVF};
+
+sleep 0.3;
+
+WFBE_RequestSpecial = ['SRVFNCREQUESTSPECIAL',['upgrade',sideJoined]];
+publicVariable 'WFBE_RequestSpecial';
+if (!isMultiplayer || (isServer && local player)) then {['SRVFNCREQUESTSPECIAL',['upgrade',sideJoined]] Spawn HandleSPVF};