diff --git a/Readme.md b/Readme.md new file mode 100644 index 0000000..055eb9a --- /dev/null +++ b/Readme.md @@ -0,0 +1,23 @@ +Hi There + +I would just like to thank the creators of exilez for this code. + +To Configure + +Open fn_preInit.sqf +define safezone positions (2d coords) + + + x y r +eg. [[4992.78,8005.07],120], + +open safezone.sqf + +line 22 - Edit side to match your AI + side +_trigger setTriggerActivation["EAST", "PRESENT", TRUE]; + + + +drop the pbo in the @exileserver/addons + diff --git a/SaferSafezone.pbo b/SaferSafezone.pbo new file mode 100644 index 0000000..379420c Binary files /dev/null and b/SaferSafezone.pbo differ diff --git a/SaferSafezone/$PREFIX$ b/SaferSafezone/$PREFIX$ new file mode 100644 index 0000000..34c8cb2 --- /dev/null +++ b/SaferSafezone/$PREFIX$ @@ -0,0 +1 @@ +SaferSafezone \ No newline at end of file diff --git a/SaferSafezone/Code/Safezone.sqf b/SaferSafezone/Code/Safezone.sqf new file mode 100644 index 0000000..d76c3ff --- /dev/null +++ b/SaferSafezone/Code/Safezone.sqf @@ -0,0 +1,27 @@ + +//created by Sp!ts + +// Thanks to ExileZ 2.0 by Patrix87 of http:\\multi-jeux.quebec For some of the code// + +//Variable declaration +private [ + "_position", + "_trigger", + "_nearestLocation", + "_radius" +]; + + +_position = (_this select 0) select 0; +_radius = (_this select 0) select 1; +_nearestLocation = text nearestLocation [_position, ""]; + +//Create trigger area +_trigger = createTrigger["EmptyDetector", _position]; +_trigger setTriggerArea[_radius, _radius, 0, true]; +_trigger setTriggerActivation["EAST", "PRESENT", TRUE]; +_trigger setTriggerStatements["this && {vehicle _x isKindOf 'Man'} count thislist > 0", "{if (_x isKindOf 'Man') then {_x setdamage 1; deleteVehicle _x;}; }foreach thislist;", ""]; + +if (Debug) then { + diag_log format["Safer Safezones: Creating Safezone Trigger | Position : %1 | Radius : %2m | Near : %3 ",_position,_radius,_nearestLocation]; +}; \ No newline at end of file diff --git a/SaferSafezone/bootstrap/fn_preInit.sqf b/SaferSafezone/bootstrap/fn_preInit.sqf new file mode 100644 index 0000000..ecc2838 --- /dev/null +++ b/SaferSafezone/bootstrap/fn_preInit.sqf @@ -0,0 +1,23 @@ + +sleep 1; + +diag_log "\\\ --- Starting Sp!ts SaferSafezones ///"; + +SafeZonePositions = +[// [[Coordinates],Radius] // You can Get the safezone information directly from your mission.sqm under class Markers + [[4992.78,8005.07],120], + [[9120.65,10076.6],120], + [[4357.36,4724.03],120] +]; + +//compile code +Safezone = compile preprocessFile "SaferSafezone\Code\Safezone.sqf"; + +//Create Triggers for safezones +{nul = [_x] spawn Safezone; + sleep 0.01; +}foreach SafeZonePositions; + +sleep 1; + +diag_log "/// --- Sp!ts SaferSafezones Started --- \\\"; diff --git a/SaferSafezone/config.cpp b/SaferSafezone/config.cpp new file mode 100644 index 0000000..f9f6bfa --- /dev/null +++ b/SaferSafezone/config.cpp @@ -0,0 +1,26 @@ +class CfgPatches +{ + class SaferSafezone + { + requiredVersion = 0.1; + requiredAddons[] = {"exile_client","exile_assets","exile_server_config"}; + units[] = {}; + weapons[] = {}; + magazines[] = {}; + ammo[] = {}; + }; +}; +class CfgFunctions +{ + class SaferSafezone + { + class Bootstrap + { + file = "SaferSafezone\bootstrap"; + class preInit + { + preInit = 1; + }; + }; + }; +};