summaryrefslogtreecommitdiffstats
path: root/Client/Functions/Client_HandlePVF.sqf
diff options
context:
space:
mode:
authorhybrid <hybrid@hybridlabs.pro>2026-06-11 19:54:45 +0300
committerhybrid <hybrid@hybridlabs.pro>2026-06-11 19:54:45 +0300
commit68d4c9bbd80ed2e6528244569c79676b87295bd1 (patch)
tree6efd42fbf6f1281874ae0ff1f8816b01fe0c7153 /Client/Functions/Client_HandlePVF.sqf
downloada2wf_takistan-68d4c9bbd80ed2e6528244569c79676b87295bd1.tar.gz
a2wf_takistan-68d4c9bbd80ed2e6528244569c79676b87295bd1.tar.bz2
a2wf_takistan-68d4c9bbd80ed2e6528244569c79676b87295bd1.zip
init
Diffstat (limited to 'Client/Functions/Client_HandlePVF.sqf')
-rw-r--r--Client/Functions/Client_HandlePVF.sqf30
1 files changed, 30 insertions, 0 deletions
diff --git a/Client/Functions/Client_HandlePVF.sqf b/Client/Functions/Client_HandlePVF.sqf
new file mode 100644
index 0000000..3d61118
--- /dev/null
+++ b/Client/Functions/Client_HandlePVF.sqf
@@ -0,0 +1,30 @@
+/*
+ description:
+ - New network system handler.
+ destination:
+ - Nil: Everyone
+ - String: vehicleVarName of the unit to trigger on.
+ - Side: A side
+ note:
+ - addPublicVariableEventHandler is triggered everywhere BUT on the caller.
+ usage:
+ - [destination,client PVF to run,parameters]
+*/
+
+Private ["_destination","_exit","_parameters","_publicVar","_script"];
+_publicVar = _this;
+_exit = true;
+
+_destination = _publicVar select 0;
+if (isNil '_destination') then {_destination = 0;_exit = false};
+if (typeName(_destination) == 'SIDE') then {if (sideJoined == _destination) then {_exit = false}};
+if (typeName(_destination) == 'STRING') then {
+ if (vehicleVarName player == _destination) then {_exit = false};
+};
+
+if (_exit) exitWith {};
+
+_script = _publicVar select 1;
+_parameters = if (count _this > 2) then {_publicVar select 2} else {[]};
+
+_parameters Spawn (Call Compile _script); \ No newline at end of file