diff options
| author | hybrid <hybrid@hybridlabs.pro> | 2026-06-11 19:58:31 +0300 |
|---|---|---|
| committer | hybrid <hybrid@hybridlabs.pro> | 2026-06-11 19:58:31 +0300 |
| commit | e670b4ed55c459a21090bd0178ceaaaf12d87989 (patch) | |
| tree | b6833d5e842475f0ee27f5f617096445fdd4e4a1 /Client/PVFunctions/CampCaptured.sqf | |
| download | a2wf_fallujah-e670b4ed55c459a21090bd0178ceaaaf12d87989.tar.gz a2wf_fallujah-e670b4ed55c459a21090bd0178ceaaaf12d87989.tar.bz2 a2wf_fallujah-e670b4ed55c459a21090bd0178ceaaaf12d87989.zip | |
init
Diffstat (limited to '')
| -rw-r--r-- | Client/PVFunctions/CampCaptured.sqf | 42 |
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);
+ };
+ };
+};
|
