summaryrefslogtreecommitdiffstats
path: root/Server/Config/Config_Town.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 /Server/Config/Config_Town.sqf
downloada2wf_zargabad-c055d44dcdb87e8db49fb23e632fc086aa44cce6.tar.gz
a2wf_zargabad-c055d44dcdb87e8db49fb23e632fc086aa44cce6.tar.bz2
a2wf_zargabad-c055d44dcdb87e8db49fb23e632fc086aa44cce6.zip
init
Diffstat (limited to 'Server/Config/Config_Town.sqf')
-rw-r--r--Server/Config/Config_Town.sqf25
1 files changed, 25 insertions, 0 deletions
diff --git a/Server/Config/Config_Town.sqf b/Server/Config/Config_Town.sqf
new file mode 100644
index 0000000..35f5724
--- /dev/null
+++ b/Server/Config/Config_Town.sqf
@@ -0,0 +1,25 @@
+Private ['_configScripts','_location','_locationName','_params','_range','_script','_total'];
+
+_location = _this Select 0;
+_locationName = _this Select 1;
+_configScripts = _this Select 2;
+
+if (isNull _location) exitWith {};
+
+waitUntil {townModeSet};
+if ((str _location) in TownTemplate) exitWith {
+ diag_log Format ["[WFBE (INIT)][frameno:%3 | ticktime:%4] Config_Town: Removing town %1 (%2) since the town is removed in the towns templates.",_location,_locationName,diag_frameno,diag_tickTime];
+ if (isServer) then {deleteVehicle _location};
+};
+
+_range = 600;
+if (Count _this > 4) then {_range = _this Select 4};
+
+_total = Count _configScripts;
+_script = _configScripts Select (Random (_total - 1));
+_params = [_location,_locationName];
+if (Count _this > 4) then {_params = _params + [_range]};
+
+waitUntil{initJIP && commonInitComplete};
+
+_params ExecVM Format["Server\Config\Config_%1.sqf",_script]; \ No newline at end of file