summaryrefslogtreecommitdiffstats
path: root/Client/PVFunctions/CampCaptured.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/PVFunctions/CampCaptured.sqf
downloada2wf_sara-628d33984d9228f1781d13a65fbb80f35facc899.tar.gz
a2wf_sara-628d33984d9228f1781d13a65fbb80f35facc899.tar.bz2
a2wf_sara-628d33984d9228f1781d13a65fbb80f35facc899.zip
init
Diffstat (limited to '')
-rw-r--r--Client/PVFunctions/CampCaptured.sqf42
1 files changed, 42 insertions, 0 deletions
diff --git a/Client/PVFunctions/CampCaptured.sqf b/Client/PVFunctions/CampCaptured.sqf
new file mode 100644
index 0000000..0894a5e
--- /dev/null
+++ b/Client/PVFunctions/CampCaptured.sqf
@@ -0,0 +1,42 @@
+Private ["_award","_camp","_camps","_index","_marker","_name","_captureSideID","_town","_townSideID","_units"];
+
+_town = _this Select 0;
+_captureSideID = _this Select 1;
+_camp = _this Select 2;
+
+if !(clientInitComplete) exitWith {};
+
+_camps = _town getVariable "camps";
+_name = _town getVariable "name";
+_townSideID = _town getVariable "sideID";
+_index = _camps find _camp;
+
+if (_index != -1) then {
+ _marker = Format["%1Camp%2",str _town,_index];
+ if (sideID == _captureSideID) then {
+ _award = false;
+ if (Leader Group player == player) then {
+ _units = units group player;
+ {if (_x distance _camp < 5) then {_award = true}} forEach _units;
+ };
+
+ if (player Distance _camp < 5 || _award) then {
+ ('WFBE_CAMPCAPTUREBOUNTY' Call GetNamespace) Call ChangePlayerFunds;
+ WFBE_RequestChangeScore = ['SRVFNCREQUESTCHANGESCORE',[player,score player + ('WFBE_SCORECAPTURECAMP' Call GetNamespace)]];
+ publicVariable 'WFBE_RequestChangeScore';
+ if (isHostedServer) then {['SRVFNCREQUESTCHANGESCORE',[player,score player + ('WFBE_SCORECAPTURECAMP' Call GetNamespace)]] Spawn HandleSPVF};
+ Format[localize "STR_WF_CHAT_Camp_Captured_Bounty",_name,'WFBE_CAMPCAPTUREBOUNTY' Call GetNamespace] Call CommandChatMessage;
+ if (mysql) then {
+ WF_Logic setVariable ["WF_MYSQL_CLIENT",(WF_Logic getVariable "WF_MYSQL_CLIENT") + [Format ["MYSQLDATA§WFBE_Update§%1§%2§campcaptured§%3",getPlayerUID(player),name player,worldName]],true];
+ };
+ } else {
+ Format[localize "STR_WF_CHAT_Camp_Captured",_name] Call CommandChatMessage;
+ };
+ _marker setMarkerColorLocal ("Friendly" Call GetMarkerColoration);
+ } else {
+ if (_townSideID == sideID || getMarkerColor _marker == ("Friendly" Call GetMarkerColoration)) then {
+ Format[localize "STRWFCAMPCAPTUREDBYENEMY",_name] Call CommandChatMessage;
+ _marker setMarkerColorLocal ("Enemy" Call GetMarkerColoration);
+ };
+ };
+};