Jump to content
  • 0
xDUKEx

Help with "Safe Zones 1.6" by - Juandayz

Question

Sorry if this post is in the wrong area on the forum ... I'm not sure if there would a better place to ask this question.

The Actual Script can be found here:

I've added the script and it works perfectly, however, I can't get the signs to populate around the safe zones.  I believe I need to be adding in actual coordinates to the script but I am not sure of the placement.  Can I stick them all within the [   ]'s and use commas to separate them ... or do I need to create a separate entry for each new location?  

Here is the bit of the script I am using:

Spoiler

USE_SIGNS = true;        // use this to build signs around the SafeZone
LOG_EnterLeave = true;    // This will log to your .rpt when a player enters or leaves a SafeZone! (only works with infiSTAR.de Admintools / AntiHack)
/* You can use USE_CANBUILD or/and (works together) the custom positions below (USE_POSITIONS) [position or zone,radius] */
_infiSZ =
[
    [[6325.6772,7807.7412,0],150,true],//stary
    [[4063.4226,11664.19,0],150,true],//bash
    [[11447.472,11364.504,0],150,true],//klen
    [[1606.6443,7803.5156,0],150,true],//bandit
    [[12944.227,12766.889,0],150,true],//hero
    [[4361.4937,2259.9526,0],50,true],//wholesalerSouth
    [[12060,12640,0],200,true]//air dealear
];

{
    DZE_SafeZonePosArray set [(count DZE_SafeZonePosArray), [(_x select 0), (_x select 1)]];
} forEach _infiSZ;

if (isServer) exitWith


{
    if (USE_SIGNS) then
    {
        {
            _center = _x select 0;
            _radius = _x select 1;
            _lSign = _x select 2;
            if (_lSign) then
            {
                for '_i' from 0 to 360 step (270 / _radius)*2 do
                {
                    _location = [(_center select 0) + ((cos _i) * _radius), (_center select 1) + ((sin _i) * _radius),0];
                    _dir = ((_center select 0) - (_location select 0)) atan2 ((_center select 1) - (_location select 1));
                    _object = createVehicle ['Sign_sphere100cm_EP1', _location, [], 0, 'CAN_COLLIDE'];
                    _object = createVehicle ['SignM_UN_Base_EP1', _location, [], 0, 'CAN_COLLIDE'];
                    _object setVehicleInit 'this setObjectTexture [0,''safezone\sign.jpg''];';
                    _object setDir _dir;
                };
            };
        } forEach _infiSZ;
    };
};

 

Share this post


Link to post
Share on other sites

12 answers to this question

Recommended Posts

  • 0

how did you call the script itself (maybe in init.sqf)?
if it's in  if (!isDedicated) then  {~~~~~}; , the script will not work on server.
show us your server *.rpt file if you want more help.

 

BTW, Q&A section is not here. 

Let's go here next time
https://epochmod.com/forum/forum/35-scripting/

Or, Reply to the exact thread of script you used.

 

Share this post


Link to post
Share on other sites
  • 0
Just now, Schalldampfer said:

how did you call the script itself (maybe in init.sqf)?
if it's in  if (!isDedicated) then  {~~~~~}; , the script will not work on server.
show us your server *.rpt file if you want more help.

 

BTW, Q&A section is not here. 

Let's go here next time
https://epochmod.com/forum/forum/35-scripting/

you beat me to it lol i was writing a reply

Share this post


Link to post
Share on other sites
  • 0
5 minutes ago, Schalldampfer said:

how did you call the script itself (maybe in init.sqf)?
if it's in  if (!isDedicated) then  {~~~~~}; , the script will not work on server.
show us your server *.rpt file if you want more help.

 

BTW, Q&A section is not here. 

Let's go here next time
https://epochmod.com/forum/forum/35-scripting/

Or, Reply to the exact thread of script you used.

 

The script is being called through my mission/init at the very bottom.  Everything works 100% except the signs won't spawn as a visual enhancement effect.

Spoiler

if (!isDedicated) then {
    if (toLower worldName == "chernarus") then {
        execVM "\z\addons\dayz_code\system\mission\chernarus\hideGlitchObjects.sqf";
    //    execvm "showid.sqf"; // Execute ID Class Name in HUD
    //    execVM "fixes\effects.sqf";        // custom color filters and color cycle (working)
        execVM "fixes\fov.sqf";            // field of view (working)    
    };
    
    
    
    //Enables Plant lib fixes
//    execVM "\z\addons\dayz_code\system\antihack.sqf";
    
    if (dayz_townGenerator) then { execVM "\z\addons\dayz_code\compile\client_plantSpawner.sqf"; };
    call compile preprocessFileLineNumbers "spawn\init.sqf";
    execFSM "\z\addons\dayz_code\system\player_monitor.fsm";
    execVM "Mods\service_point\service_point.sqf";
    //[false,12] execVM "\z\addons\dayz_code\compile\local_lights_init.sqf";
    if (DZE_R3F_WEIGHT) then {execVM "\z\addons\dayz_code\external\R3F_Realism\R3F_Realism_Init.sqf";};
    [] execVM "scripts\safezone\safezone_ai_remover.sqf"; // REMOVE AI FROM Safe Zones
    call compile preprocessFileLineNumbers "scripts\zsc\zscInit.sqf";
    execVM "scripts\zsc\playerHud.sqf";
    [] execVM "dayz_code\compile\remote_message.sqf";
    [] execVM "safezone\16_safezone.sqf";
    waitUntil {scriptDone progress_monitor};
    cutText ["","BLACK IN", 3];
    3 fadeSound 1;
    3 fadeMusic 1;
    endLoadingScreen;
};

 

Share this post


Link to post
Share on other sites
  • 0

I am getting a few instances of errors like this within my log.  They all vary in timestamp and have different coordinates.  There are maybe 6 in total through my log. 

Spoiler

[   21:22:04 UnExpected call of CreateVehicle for 'Logic', pos(0.000000.2,1.252131.2,0.000000.2). Vehicles with brain cannot be created using 'createVehicle'!
21:22:29 UnExpected call of CreateVehicle for 'Logic', pos(0.000000.2,1.239050.2,0.000000.2). Vehicles with brain cannot be created using 'createVehicle'!   ]

 

I know the script calls for the signs to be published as vehicles ... Is that the issue?   Or do I just need to add coordinate location numbers within the    [ ]    after the     _location  call?

Spoiler

_location = [(_center select 0) + ((cos _i) * _radius), (_center select 1) + ((sin _i) * _radius),0];
                    _dir = ((_center select 0) - (_location select 0)) atan2 ((_center select 1) - (_location select 1));
                    _object = createVehicle ['Sign_sphere100cm_EP1', _location, [], 0, 'CAN_COLLIDE'];
                    _object = createVehicle ['SignM_UN_Base_EP1', _location, [], 0, 'CAN_COLLIDE'];
                    _object setVehicleInit 'this setObjectTexture [0,''safezone\sign.jpg''];';
                    _object setDir _dir;

 

Share this post


Link to post
Share on other sites
  • 0
33 minutes ago, xDUKEx said:

The script is being called through my mission/init at the very bottom.  Everything works 100% except the signs won't spawn as a visual enhancement effect.

  Reveal hidden contents

if (!isDedicated) then {
    if (toLower worldName == "chernarus") then {
        execVM "\z\addons\dayz_code\system\mission\chernarus\hideGlitchObjects.sqf";
    //    execvm "showid.sqf"; // Execute ID Class Name in HUD
    //    execVM "fixes\effects.sqf";        // custom color filters and color cycle (working)
        execVM "fixes\fov.sqf";            // field of view (working)    
    };
    
    
    
    //Enables Plant lib fixes
//    execVM "\z\addons\dayz_code\system\antihack.sqf";
    
    if (dayz_townGenerator) then { execVM "\z\addons\dayz_code\compile\client_plantSpawner.sqf"; };
    call compile preprocessFileLineNumbers "spawn\init.sqf";
    execFSM "\z\addons\dayz_code\system\player_monitor.fsm";
    execVM "Mods\service_point\service_point.sqf";
    //[false,12] execVM "\z\addons\dayz_code\compile\local_lights_init.sqf";
    if (DZE_R3F_WEIGHT) then {execVM "\z\addons\dayz_code\external\R3F_Realism\R3F_Realism_Init.sqf";};
    [] execVM "scripts\safezone\safezone_ai_remover.sqf"; // REMOVE AI FROM Safe Zones
    call compile preprocessFileLineNumbers "scripts\zsc\zscInit.sqf";
    execVM "scripts\zsc\playerHud.sqf";
    [] execVM "dayz_code\compile\remote_message.sqf";
    [] execVM "safezone\16_safezone.sqf";
    waitUntil {scriptDone progress_monitor};
    cutText ["","BLACK IN", 3];
    3 fadeSound 1;
    3 fadeMusic 1;
    endLoadingScreen;
};

 

your safezone script is in !isDedicated area. that prevent server to run safezone script (thus no sign would spawn)
(I forgot to say, the signs are spawned in the server, not each client.)

Spoiler

if (!isDedicated) then {
    if (toLower worldName == "chernarus") then {
        execVM "\z\addons\dayz_code\system\mission\chernarus\hideGlitchObjects.sqf";
    //    execvm "showid.sqf"; // Execute ID Class Name in HUD
    //    execVM "fixes\effects.sqf";        // custom color filters and color cycle (working)
        execVM "fixes\fov.sqf";            // field of view (working)    
    };
    
    
    
    //Enables Plant lib fixes
//    execVM "\z\addons\dayz_code\system\antihack.sqf";
    
    if (dayz_townGenerator) then { execVM "\z\addons\dayz_code\compile\client_plantSpawner.sqf"; };
    call compile preprocessFileLineNumbers "spawn\init.sqf";
    execFSM "\z\addons\dayz_code\system\player_monitor.fsm";
    execVM "Mods\service_point\service_point.sqf";
    //[false,12] execVM "\z\addons\dayz_code\compile\local_lights_init.sqf";
    if (DZE_R3F_WEIGHT) then {execVM "\z\addons\dayz_code\external\R3F_Realism\R3F_Realism_Init.sqf";};
    [] execVM "scripts\safezone\safezone_ai_remover.sqf"; // REMOVE AI FROM Safe Zones
    call compile preprocessFileLineNumbers "scripts\zsc\zscInit.sqf";
    execVM "scripts\zsc\playerHud.sqf";
    [] execVM "dayz_code\compile\remote_message.sqf";
    [] execVM "safezone\16_safezone.sqf";
    waitUntil {scriptDone progress_monitor};
    cutText ["","BLACK IN", 3];
    3 fadeSound 1;
    3 fadeMusic 1;
    endLoadingScreen;
};

Let's move it really at the very bottom. The bottom is after any "};"

Share this post


Link to post
Share on other sites
  • 0
4 minutes ago, Schalldampfer said:

your safezone script is in !isDedicated area. that prevent server to run safezone script (thus no sign would spawn)
(I forgot to say, the signs are spawned at server-side, not each client.)

  Hide contents

if (!isDedicated) then {
    if (toLower worldName == "chernarus") then {
        execVM "\z\addons\dayz_code\system\mission\chernarus\hideGlitchObjects.sqf";
    //    execvm "showid.sqf"; // Execute ID Class Name in HUD
    //    execVM "fixes\effects.sqf";        // custom color filters and color cycle (working)
        execVM "fixes\fov.sqf";            // field of view (working)    
    };
    
    
    
    //Enables Plant lib fixes
//    execVM "\z\addons\dayz_code\system\antihack.sqf";
    
    if (dayz_townGenerator) then { execVM "\z\addons\dayz_code\compile\client_plantSpawner.sqf"; };
    call compile preprocessFileLineNumbers "spawn\init.sqf";
    execFSM "\z\addons\dayz_code\system\player_monitor.fsm";
    execVM "Mods\service_point\service_point.sqf";
    //[false,12] execVM "\z\addons\dayz_code\compile\local_lights_init.sqf";
    if (DZE_R3F_WEIGHT) then {execVM "\z\addons\dayz_code\external\R3F_Realism\R3F_Realism_Init.sqf";};
    [] execVM "scripts\safezone\safezone_ai_remover.sqf"; // REMOVE AI FROM Safe Zones
    call compile preprocessFileLineNumbers "scripts\zsc\zscInit.sqf";
    execVM "scripts\zsc\playerHud.sqf";
    [] execVM "dayz_code\compile\remote_message.sqf";
    [] execVM "safezone\16_safezone.sqf";
    waitUntil {scriptDone progress_monitor};
    cutText ["","BLACK IN", 3];
    3 fadeSound 1;
    3 fadeMusic 1;
    endLoadingScreen;
};

Let's move it really at the very bottom. The bottom is after any "};"

So should move it to here? 

Spoiler

    if (dayz_townGenerator) then { execVM "\z\addons\dayz_code\compile\client_plantSpawner.sqf"; };
    call compile preprocessFileLineNumbers "spawn\init.sqf";
    execFSM "\z\addons\dayz_code\system\player_monitor.fsm";
    execVM "Mods\service_point\service_point.sqf";
    //[false,12] execVM "\z\addons\dayz_code\compile\local_lights_init.sqf";
    if (DZE_R3F_WEIGHT) then {execVM "\z\addons\dayz_code\external\R3F_Realism\R3F_Realism_Init.sqf";};
    [] execVM "scripts\safezone\safezone_ai_remover.sqf"; // REMOVE AI FROM Safe Zones
    call compile preprocessFileLineNumbers "scripts\zsc\zscInit.sqf";
    execVM "scripts\zsc\playerHud.sqf";
    [] execVM "dayz_code\compile\remote_message.sqf";
    waitUntil {scriptDone progress_monitor};
    cutText ["","BLACK IN", 3];
    3 fadeSound 1;
    3 fadeMusic 1;
    endLoadingScreen;
};

   [] execVM "safezone\16_safezone.sqf";

 

Share this post


Link to post
Share on other sites
  • 0
2 minutes ago, xDUKEx said:

So should move it to here? 

  Hide contents

    if (dayz_townGenerator) then { execVM "\z\addons\dayz_code\compile\client_plantSpawner.sqf"; };
    call compile preprocessFileLineNumbers "spawn\init.sqf";
    execFSM "\z\addons\dayz_code\system\player_monitor.fsm";
    execVM "Mods\service_point\service_point.sqf";
    //[false,12] execVM "\z\addons\dayz_code\compile\local_lights_init.sqf";
    if (DZE_R3F_WEIGHT) then {execVM "\z\addons\dayz_code\external\R3F_Realism\R3F_Realism_Init.sqf";};
    [] execVM "scripts\safezone\safezone_ai_remover.sqf"; // REMOVE AI FROM Safe Zones
    call compile preprocessFileLineNumbers "scripts\zsc\zscInit.sqf";
    execVM "scripts\zsc\playerHud.sqf";
    [] execVM "dayz_code\compile\remote_message.sqf";
    waitUntil {scriptDone progress_monitor};
    cutText ["","BLACK IN", 3];
    3 fadeSound 1;
    3 fadeMusic 1;
    endLoadingScreen;
};

   [] execVM "safezone\16_safezone.sqf";

 

I think so, it's also there in my server, the signs spawn and safezone is working.

Share this post


Link to post
Share on other sites
  • 0

For further clarification:

The mods section is for mod releases

The questions section is for questions -> Scripting sub forum would be the second best place to post, behind just asking the question in the author's release thread.

 

Also of note: saying you're sorry or didn't know where to post doesn't make maintaining a tidy forum any less tedious, or unnecessary/misplaced threads any less annoying. please try to understand the organization of the forum, I feel it is quite clearly laid out in the forum names

Share this post


Link to post
Share on other sites
  • 0
1 minute ago, icomrade said:

For further clarification:

The mods section is for mod releases

The questions section is for questions -> Scripting sub forum would be the second best place to post, behind just asking the question in the author's release thread.

Understood.  Thanks for all of the help.  This community is the best!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Similar Content

    • By salival
      Hi,
      Here's a simple safe zone relocation script for vehicles. 
      Simple relocate only safe zone script.
      Extremely quick and low overhead since we're only scanning the safe zone array instead of every vehicle.
      Uses the Epoch DZE_SafeZonePosArray for convenience.
      Install instructions and download link: https://github.com/oiad/safeZoneRelocate
    • By Z80CPU
      NoKillScript – Prevents any ‘Safe Zone’ killings and damage to player’s vehicles.
      Version:  1.16

      Tested On:  ARMA 3 (should work on ARMA 2, though untested)
      Tested Modes: Single Player, Multiplayer (Dedicated Server)
      Tested Environments:  Standard ARMA SP/MP, Epoch, Exile
      Script Executor:  Client
      Script Host:  Server or Client
      Format:  script, SQS
       
      Description:
      NoKillZone (NKZ), is a script that helps put an end to the notorious ‘safe zone’ killings that plagued MP environments such as Epoch and Exile.
      Simply place a marker on your map, and then put the marker name in the scripts parameters, and that’s it!  It is a simple script to use.  Nothing fancy here.
      Once it starts, it just loops over and over checking to see if player has entered or left the mark area. Matters not if they teleport into the area, fly over it, or respawn in to it – the script will detect all players in the zone regardless how they arrived or left.
      100% client side and consumes almost no resources from the client.
      Runs till client exits the server.
      No triggers are used.
      This script is for players only, it does not detect/react to any AI units.
       
      Uses:
      To mark a ‘safe area’ where players can be safe and not have to worry about being killed by anyone.
      It is possible, if desired for example, to have player protected at 100m and then at 50m, their vehicle protected.  This is done by using 2 scripts.  One with the DISTANCE parameter set to ‘100’ and the other set to ‘50’.

      Usage:
      [MARKER,DISTANCE,TEXT-IN,TEXT-OUT,PROTECTION] exec "NoKillZone.Sqs";
      MARKER = Map marker name - In quotes
      DISTANCE = Radius of protection in meters
      TEXT-IN *  = Text to be shown via Hint when entering the zone - In quotes
      TEXT-OUT *  = Text to be shown via Hint when leaving the zone - In quotes
      PROTECTION *  = Allows you to choose protection for player or player and their vehicle.
      * = Optional parameter
      Example:
      ["CentralSZ",500,"You Have Entered The Central Safe Zone","You Have Left The Central Safe Zone",1] exec "NoKillZone.Sqs"
      Full documentation can be found in the top lines of the script.  Just open it in a text program such as NotePad++ to view.
      For servers, call script from 'INIT.SQF' and/or 'OnPlayerRespawn.Sqf'.
      For SP, you can also call it from the INIT.Sqf or you can activate it via the debug console or other means such as a radio trigger.
      Once launched, you will get a 'confirmation' message showing script is active, what zone, and if vehicle protection is active.

      Other Notes:
      While not ‘optimized’ and the ‘cleanest’ looking script, it does work and work well.  If you wish to spend one to two hours ‘optimizing’ it to save a few milliseconds, be my guest!  ;-)

      Known Issues:
      Script can be run many times for the same location (marker).
      There is no way to exit the script without the player quitting the game.
      Not all parameter errors are detected, though some are
      (The above issues are set to be addressed in the future)
       
      Video Example:  No Kill Zone Example
       
    • By BoleParty
      I release safe zone scripts for Australia/ Chernarus/ Esseker.
       
       
      Original script for Altis is written by Friendly and you can check it out here:
       

       
       
      Many thanks go out to him as he did all the scripting and i just did the edits to get it working for the other maps.
       
       
      Instructions in Readme.md file.
       
       
      Download here:
       
      https://github.com/BoleParty/SafeZonesAustralia
      https://github.com/BoleParty/SafeZonesChernarus
      https://github.com/BoleParty/SafeZonesEsseker
       
      Best regards
       
       
    • By Donnovan
      If you like my work, please consider a donation:

      $USD

      $EURO

      ANDRE SAFE ZONE

      . Vehicle Gear Protection (except for players in your group)
      . Player Gear Protection (except for players in your group)
      . Player Can't Shot
      . Player Can't Die
      . Turret cant' shot
      . Vehicle does not take damage
      . Vehicle can't be stolen
      . Protected vehicles liberated after some time

      INSTALATION

      Run the script from the mission file init.sqf with execVM "andre_safezone.sqf";. You must run from the root (not inside a isServer or !isServer or any other condition):
      execVM "andre_safezone.sqf"; //exec it on the root on init.sqf if (isServer) then { //code 1... //code 2... //code 3... //DO NOT EXEC IT HERE! } else { //code 4...` //code 5... //code 6... //DO NOT EXEC IT HERE! };  
      THE SCRIPT: if you use Epoch Anti Hack
       
      Ready for Altis. You can change the Konfiguration part to meet the map you is using and/or to add more safe zones.

      *Put this file in the root of your mission file, with the name andre_safezone.sqf.
      //=============== // KONFIGURATION //=============== //Altis Safezones donn_traders = [ ["Altis Trader City 1",[13323,14527,0]], ["Altis Trader City 2",[6177,16835,0]], ["Altis Trader City 3",[18460,14259,0]] ]; //==================== // CLIENT SIDE SCRIPT //==================== if (hasInterface) then { //SENSORS donn_notSafe = true; donn_safeZone_name = "(nothing)"; { _x spawn { private ["_dist","_tPos","_tName","_maxVel","_tRad"]; _tName = _this select 0; _tPos = _this select 1; _maxVel = 100; _tRad = 250; waitUntil {sleep 0.25;speed player > 1}; while {true} do { _dist = player distance _tPos; while {_dist > 150} do { sleep ((((_dist - _tRad)/_maxVel) max 0.25) min 5); _dist = player distance _tPos; }; donn_notSafe = false; donn_safeZone_name = _tName; systemChat ("You are in safezone city: " + _tName); while {_dist < 150} do { sleep 0.25; _dist = player distance _tPos; }; donn_notSafe = true; donn_safeZone_name = "(nenhuma)"; systemChat ("You leaved safezone city: " + _tName); }; }; } forEach donn_traders; //Safe zone Functions donn_avoidGearAccess = { _protecting = []; _toProtect = donn_pv_protected_veh select 1; _toUnprotect = []; _protectVersion = donn_pv_protected_veh select 0; while {!donn_notSafe} do { { _x addEventHandler ["ContainerOpened", { _veh = _this select 0; _player = _this select 1; _veh_crew = _veh getVariable ['don_crew', nil]; if (isNil '_veh_crew') then {_veh_crew = [getPlayerUID _player];}; _groupUnits = units _player; _canAccess = false; { if (getPlayerUID _x in _veh_crew) then { _canAccess = true; }; } forEach _groupUnits; if (!_canAccess)then { systemChat format ['%1, you cant access this gear.', name _player]; _player action ["Gear", objNull]; }; }]; } forEach _toProtect; { _x removeAllEventHandlers "ContainerOpened"; } forEach _toUnprotect; _protecting = _protecting + _toProtect - _toUnprotect; waitUntil {sleep 0.2;donn_pv_protected_veh select 0 > _protectVersion}; _toProtect = (donn_pv_protected_veh select 1) - _protecting; _toUnprotect = _protecting - (donn_pv_protected_veh select 1); }; { _x removeAllEventHandlers "ContainerOpened"; } forEach _protecting; }; //Safezone don_incar = false; don_firedEH_1 = nil; donn_godMode = false; [] spawn { private ['_runOneTime','_donn_notSafe','_don_passengers','_don_veh_crew','_don_player_veh','_don_veh_driver']; waitUntil {!(isNil 'donn_notSafe')}; _runOneTime = false; _donn_notSafe = donn_notSafe; while {true} do { waitUntil {!((_donn_notSafe && donn_notSafe) || (!_donn_notSafe && !donn_notSafe)) || !_runOneTime}; _donn_notSafe = donn_notSafe; if (!_donn_notSafe) then { //Player God Mode player allowDamage false; donn_sz_fired = player addEventHandler ['Fired',{deleteVehicle (_this select 6);}]; donn_godMode = true; //Protect Player Gear donn_pv_protected_veh_add = player; publicVariableServer "donn_pv_protected_veh_add"; //Avoid player to access other Gears (turn off is automatic) [] spawn donn_avoidGearAccess; }; if (_donn_notSafe && _runOneTime) then { //Player God Mode Off player allowDamage true; player removeEventHandler ["Fired",donn_sz_fired]; donn_godMode = false; //Clear Player Gear Protection donn_pv_protected_veh_sub = player; publicVariableServer "donn_pv_protected_veh_sub"; }; if (!_donn_notSafe && don_incar) then { //Get Info _don_player_veh = don_player_veh; don_veh_crew = crew _don_player_veh; _don_veh_driver = driver _don_player_veh; if (player == _don_veh_driver) then { //Car God Mode _don_player_veh allowDamage false; _don_player_veh removeAllEventHandlers 'handleDamage'; _don_player_veh addEventHandler ['handleDamage', {0}]; _don_player_veh removeAllEventHandlers 'Fired'; _don_player_veh addEventHandler ['Fired',{deleteVehicle (_this select 6);}]; //Passenger Names _don_passengers = ''; {if (alive _x) then {_don_passengers = _don_passengers + format [' %1',name _x];};} forEach don_veh_crew; //Passenger PlayerUID _don_veh_crew = []; {if (alive _x) then {_don_veh_crew = _don_veh_crew + [getPlayerUID _x];};} forEach don_veh_crew; //Put info on Vehicle _don_player_veh setVariable ['don_ownerity_code', format ['%1_%2', getPlayerUID player, round diag_tickTime], true]; _don_player_veh setVariable ['don_crew', _don_veh_crew, true]; _don_player_veh setVariable ['don_passengers', _don_passengers, true]; //Protect Vehicle Gear donn_pv_protected_veh_add = _don_player_veh; publicVariable "donn_pv_protected_veh_add"; }; }; if (_donn_notSafe && don_incar && _runOneTime) then { //Get Info _don_player_veh = don_player_veh; _don_veh_driver = driver _don_player_veh; if (player == _don_veh_driver) then { //Clear Vehicle Protection Variables _don_player_veh setVariable ['don_ownerity_code', nil, true]; _don_player_veh setVariable ['don_crew', nil, true]; _don_player_veh setVariable ['don_passengers', nil, true]; //Car God Mode Off _don_player_veh allowDamage true; _don_player_veh removeAllEventHandlers 'handleDamage'; _don_player_veh removeAllEventHandlers 'Fired'; //Clear Vehicle Gear Protection donn_pv_protected_veh_sub = _don_player_veh; publicVariableServer "donn_pv_protected_veh_sub"; }; }; _runOneTime = true; }; }; [] spawn { private ['_don_veh_crew','_wait_time','_last_mark','_max_time']; while {true} do { _max_time = 480; waitUntil {sleep 0.0625; vehicle player != player}; don_player_veh = vehicle player; don_incar = true; if (!donn_notSafe) then { _don_veh_crew = don_player_veh getVariable ['don_crew', nil]; if (isNil '_don_veh_crew') then {_don_veh_crew = [getPlayerUID player];}; _groupUnits = units player; _canAccess = false; { if (getPlayerUID _x in _don_veh_crew) then { _canAccess = true; }; } forEach _groupUnits; if (!_canAccess) then { call compile format ['if (isNil ''don_%1'') then {don_%1 = diag_tickTime;}; _last_mark = don_%1;', don_player_veh getVariable ['don_ownerity_code', 0]]; _wait_time = diag_tickTime - _last_mark; if (_wait_time < _max_time) then { while {player != vehicle player} do { player action ['getOut', don_player_veh]; uiSleep 0.01; }; cuttext [format ['Owners:%1. %2 seconds to liberate.', don_player_veh getVariable ['don_passengers','Owners not found'], round (_max_time - _wait_time)], 'PLAIN DOWN']; cad_pvar_smessage = [format ['%1 is messing with your vehicle! %2 seconds to liberate!', name player, round (_max_time - _wait_time)], _don_veh_crew]; publicVariable 'cad_pvar_smessage'; } else { call compile format ['don_%1 = nil;', don_player_veh getVariable ['don_ownerity_code', 0]]; don_player_veh setVariable ['don_ownerity_code', nil, true]; don_player_veh setVariable ['don_crew', nil, true]; don_player_veh setVariable ['don_passengers', nil, true]; cuttext [format ['Vehicle is now free for all!'], 'PLAIN DOWN']; cad_pvar_smessage = [format ['Vehicle invaded by %1!', name player], _don_veh_crew]; publicVariable 'cad_pvar_smessage'; }; }; don_player_veh allowDamage false; don_player_veh removeAllEventHandlers 'handleDamage'; don_player_veh addEventHandler ['handleDamage', {0}]; don_player_veh removeAllEventHandlers 'Fired'; don_player_veh addEventHandler ['Fired',{deleteVehicle (_this select 6);}]; }; if (donn_notSafe) then { don_player_veh allowDamage true; don_player_veh removeAllEventHandlers 'handleDamage'; don_player_veh removeAllEventHandlers 'Fired'; if (player == driver don_player_veh) then { don_player_veh setVariable ['don_ownerity_code', nil, true]; don_player_veh setVariable ['don_crew', nil, true]; don_player_veh setVariable ['don_passengers', nil, true]; }; }; waitUntil {sleep 0.0625; vehicle player == player}; don_incar = false; don_player_veh = nil; }; }; //Remote Mensages 'cad_pvar_smessage' addPublicVariableEventHandler { private ['_message', '_receivers']; _message = (_this select 1) select 0; _receivers = (_this select 1) select 1; if (getPlayerUID player in _receivers) then {cutText [_message, 'PLAIN DOWN'];}; }; diag_log "! SAZON OK !"; }; //============= // SERVER SIDE //============= if (isServer) then { //DONN SaZon Protected Veh donn_pv_protected_veh = [0,[]]; publicVariable "donn_pv_protected_veh"; "donn_pv_protected_veh_add" addPublicVariableEventHandler { donn_pv_protected_veh set [0,(donn_pv_protected_veh select 0) + 1]; donn_pv_protected_veh set [1,(donn_pv_protected_veh select 1) + [_this select 1]]; publicVariable "donn_pv_protected_veh"; diag_log ("[SAZON] Added veh to protection: " + str (_this select 1)); }; "donn_pv_protected_veh_sub" addPublicVariableEventHandler { donn_pv_protected_veh set [0,(donn_pv_protected_veh select 0) + 1]; donn_pv_protected_veh set [1,(donn_pv_protected_veh select 1) - [_this select 1]]; publicVariable "donn_pv_protected_veh"; diag_log ("[SAZON] Deadded veh to protection: " + str (_this select 1)); }; };  
       
      THE SCRIPT: if you use infi-STAR Anti Hack
       
      Ready for Altis. You can change the Konfiguration part to meet the map you is using and/or to add more safe zones.

      *Put this file in the root of your mission file, with the name andre_safezone.sqf.
      //=============== // KONFIGURATION //=============== //Altis Safezones donn_traders = [ ["Altis Trader City 1",[13323,14527,0]], ["Altis Trader City 2",[6177,16835,0]], ["Altis Trader City 3",[18460,14259,0]] ]; //==================== // CLIENT SIDE SCRIPT //==================== if (hasInterface) then { //SENSORS donn_notSafe = true; donn_safeZone_name = "(nothing)"; { _x spawn { private ["_dist","_tPos","_tName","_maxVel","_tRad"]; _tName = _this select 0; _tPos = _this select 1; _maxVel = 100; _tRad = 250; waitUntil {sleep 0.25;speed player > 1}; while {true} do { _dist = player distance _tPos; while {_dist > 150} do { sleep ((((_dist - _tRad)/_maxVel) max 0.25) min 5); _dist = player distance _tPos; }; donn_notSafe = false; inSafeZone = true; //NEW LINE 1 donn_safeZone_name = _tName; systemChat ("You are in safezone city: " + _tName); while {_dist < 150} do { sleep 0.25; _dist = player distance _tPos; }; donn_notSafe = true; inSafeZone = false; //NEW LINE 2 donn_safeZone_name = "(nenhuma)"; systemChat ("You leaved safezone city: " + _tName); }; }; } forEach donn_traders; //Safe zone Functions donn_avoidGearAccess = { _protecting = []; _toProtect = donn_pv_protected_veh select 1; _toUnprotect = []; _protectVersion = donn_pv_protected_veh select 0; while {!donn_notSafe} do { { _x addEventHandler ["ContainerOpened", { _veh = _this select 0; _player = _this select 1; _veh_crew = _veh getVariable ['don_crew', nil]; if (isNil '_veh_crew') then {_veh_crew = [getPlayerUID _player];}; _groupUnits = units _player; _canAccess = false; { if (getPlayerUID _x in _veh_crew) then { _canAccess = true; }; } forEach _groupUnits; if (!_canAccess)then { systemChat format ['%1, you cant access this gear.', name _player]; _player action ["Gear", objNull]; }; }]; } forEach _toProtect; { _x removeAllEventHandlers "ContainerOpened"; } forEach _toUnprotect; _protecting = _protecting + _toProtect - _toUnprotect; waitUntil {sleep 0.2;donn_pv_protected_veh select 0 > _protectVersion}; _toProtect = (donn_pv_protected_veh select 1) - _protecting; _toUnprotect = _protecting - (donn_pv_protected_veh select 1); }; { _x removeAllEventHandlers "ContainerOpened"; } forEach _protecting; }; //Safezone don_incar = false; donn_godMode = false; [] spawn { private ['_runOneTime','_donn_notSafe','_don_passengers','_don_veh_crew','_don_player_veh','_don_veh_driver']; waitUntil {!(isNil 'donn_notSafe')}; _runOneTime = false; _donn_notSafe = donn_notSafe; while {true} do { waitUntil {!((_donn_notSafe && donn_notSafe) || (!_donn_notSafe && !donn_notSafe)) || !_runOneTime}; _donn_notSafe = donn_notSafe; if (!_donn_notSafe) then { //Player God Mode player allowDamage false; donn_godMode = true; //Protect Player Gear donn_pv_protected_veh_add = player; publicVariableServer "donn_pv_protected_veh_add"; //Avoid player to access other Gears (turn off is automatic) [] spawn donn_avoidGearAccess; }; if (_donn_notSafe && _runOneTime) then { //Player God Mode Off player allowDamage true; donn_godMode = false; //Clear Player Gear Protection donn_pv_protected_veh_sub = player; publicVariableServer "donn_pv_protected_veh_sub"; }; if (!_donn_notSafe && don_incar) then { //Get Info _don_player_veh = don_player_veh; don_veh_crew = crew _don_player_veh; _don_veh_driver = driver _don_player_veh; if (player == _don_veh_driver) then { //Car God Mode _don_player_veh allowDamage false; _don_player_veh removeAllEventHandlers 'handleDamage'; _don_player_veh addEventHandler ['handleDamage', {0}]; _don_player_veh removeAllEventHandlers 'Fired'; _don_player_veh addEventHandler ['Fired',{deleteVehicle (_this select 6);}]; //Passenger Names _don_passengers = ''; {if (alive _x) then {_don_passengers = _don_passengers + format [' %1',name _x];};} forEach don_veh_crew; //Passenger PlayerUID _don_veh_crew = []; {if (alive _x) then {_don_veh_crew = _don_veh_crew + [getPlayerUID _x];};} forEach don_veh_crew; //Put info on Vehicle _don_player_veh setVariable ['don_ownerity_code', format ['%1_%2', getPlayerUID player, round diag_tickTime], true]; _don_player_veh setVariable ['don_crew', _don_veh_crew, true]; _don_player_veh setVariable ['don_passengers', _don_passengers, true]; //Protect Vehicle Gear donn_pv_protected_veh_add = _don_player_veh; publicVariable "donn_pv_protected_veh_add"; }; }; if (_donn_notSafe && don_incar && _runOneTime) then { //Get Info _don_player_veh = don_player_veh; _don_veh_driver = driver _don_player_veh; if (player == _don_veh_driver) then { //Clear Vehicle Protection Variables _don_player_veh setVariable ['don_ownerity_code', nil, true]; _don_player_veh setVariable ['don_crew', nil, true]; _don_player_veh setVariable ['don_passengers', nil, true]; //Car God Mode Off _don_player_veh allowDamage true; _don_player_veh removeAllEventHandlers 'handleDamage'; _don_player_veh removeAllEventHandlers 'Fired'; //Clear Vehicle Gear Protection donn_pv_protected_veh_sub = _don_player_veh; publicVariableServer "donn_pv_protected_veh_sub"; }; }; _runOneTime = true; }; }; [] spawn { private ['_don_veh_crew','_wait_time','_last_mark','_max_time']; while {true} do { _max_time = 480; waitUntil {sleep 0.0625; vehicle player != player}; don_player_veh = vehicle player; don_incar = true; if (!donn_notSafe) then { _don_veh_crew = don_player_veh getVariable ['don_crew', nil]; if (isNil '_don_veh_crew') then {_don_veh_crew = [getPlayerUID player];}; _groupUnits = units player; _canAccess = false; { if (getPlayerUID _x in _don_veh_crew) then { _canAccess = true; }; } forEach _groupUnits; if (!_canAccess) then { call compile format ['if (isNil ''don_%1'') then {don_%1 = diag_tickTime;}; _last_mark = don_%1;', don_player_veh getVariable ['don_ownerity_code', 0]]; _wait_time = diag_tickTime - _last_mark; if (_wait_time < _max_time) then { while {player != vehicle player} do { player action ['getOut', don_player_veh]; uiSleep 0.01; }; cuttext [format ['Owners:%1. %2 seconds to liberate.', don_player_veh getVariable ['don_passengers','Owners not found'], round (_max_time - _wait_time)], 'PLAIN DOWN']; cad_pvar_smessage = [format ['%1 is messing with your vehicle! %2 seconds to liberate!', name player, round (_max_time - _wait_time)], _don_veh_crew]; publicVariable 'cad_pvar_smessage'; } else { call compile format ['don_%1 = nil;', don_player_veh getVariable ['don_ownerity_code', 0]]; don_player_veh setVariable ['don_ownerity_code', nil, true]; don_player_veh setVariable ['don_crew', nil, true]; don_player_veh setVariable ['don_passengers', nil, true]; cuttext [format ['Vehicle is now free for all!'], 'PLAIN DOWN']; cad_pvar_smessage = [format ['Vehicle invaded by %1!', name player], _don_veh_crew]; publicVariable 'cad_pvar_smessage'; }; }; don_player_veh allowDamage false; don_player_veh removeAllEventHandlers 'handleDamage'; don_player_veh addEventHandler ['handleDamage', {0}]; don_player_veh removeAllEventHandlers 'Fired'; don_player_veh addEventHandler ['Fired',{deleteVehicle (_this select 6);}]; }; if (donn_notSafe) then { don_player_veh allowDamage true; don_player_veh removeAllEventHandlers 'handleDamage'; don_player_veh removeAllEventHandlers 'Fired'; if (player == driver don_player_veh) then { don_player_veh setVariable ['don_ownerity_code', nil, true]; don_player_veh setVariable ['don_crew', nil, true]; don_player_veh setVariable ['don_passengers', nil, true]; }; }; waitUntil {sleep 0.0625; vehicle player == player}; don_incar = false; don_player_veh = nil; }; }; //Remote Mensages 'cad_pvar_smessage' addPublicVariableEventHandler { private ['_message', '_receivers']; _message = (_this select 1) select 0; _receivers = (_this select 1) select 1; if (getPlayerUID player in _receivers) then {cutText [_message, 'PLAIN DOWN'];}; }; diag_log "! SAZON OK !"; }; //============= // SERVER SIDE //============= if (isServer) then { //DONN SaZon Protected Veh donn_pv_protected_veh = [0,[]]; publicVariable "donn_pv_protected_veh"; "donn_pv_protected_veh_add" addPublicVariableEventHandler { donn_pv_protected_veh set [0,(donn_pv_protected_veh select 0) + 1]; donn_pv_protected_veh set [1,(donn_pv_protected_veh select 1) + [_this select 1]]; publicVariable "donn_pv_protected_veh"; diag_log ("[SAZON] Added veh to protection: " + str (_this select 1)); }; "donn_pv_protected_veh_sub" addPublicVariableEventHandler { donn_pv_protected_veh set [0,(donn_pv_protected_veh select 0) + 1]; donn_pv_protected_veh set [1,(donn_pv_protected_veh select 1) - [_this select 1]]; publicVariable "donn_pv_protected_veh"; diag_log ("[SAZON] Deadded veh to protection: " + str (_this select 1)); }; }; BE FILTERS TWEAK
       
      FOR THE ORIGINAL EPOCH 0.3.0.2 FILTERS: My changes are after /*DONN*/.
       
      scripts.txt: You need to change 4 lines.

      7 allowDamage !="player allowDamage true;vehicle player allowDamage true;" !="player allowDamage false;{missionNamespace setVariable[format['EPOCH_player%1" /*DONN*/ !="(_|)don_player_veh allowDamage"
       
      7 exec !="<execute expression=" !"RscDebugConsole_execute" !"execFSM" !"_executeStackedEventHandler" !"fn_execVM" !"fn_moduleExecute" !"fn_execRemote" !"fn_MPexec" !"bis_fnc_moduleExecute_activate" !"fn_tridentExecute" !"randomize_civ1" !"executed from" !"EPOCH_DebugGUI_exec" !"_handle = [_display] execVM _script;" !"execVM \"\A3\Structures_F\scripts" !="execVM \"\A3\Structures_F_EPC\Civ\PlayGround\scripts\Carousel_spin.sqf\"" !="reviveExecuteTemplates" /*DONN*/ !="execVM \"andre_safezone.sqf\";"
       
      7 removeEventHandler !="displayRemoveEventHandler" !="player removeEventHandler ['Fired', 0];" !"_currentTarget removeEventHandler[\"EpeContactStart\", _onContactEH]" !" [_adminVar,objnull];\npublicvariable _adminVar;\nplayer removeeventhandler [\"respawn\",_respawn];" !="_plyr removeEventHandler [\"FiredNear\", _smokeEH];" /*DONN*/ !="player removeEventHandler [\"Fired\",donn_sz_fired]"
       
      7 removeAllEventHandlers !="ctrlRemoveAllEventHandlers" !="_vehicle removeAllEventHandlers \"GetOut\";" !="_sapper removeAllEventHandlers \"Hit\";\n_sapper removeAllEventHandlers \"FiredNear\";" /*DONN*/ !="_x removeAllEventHandlers \"ContainerOpened\";"
       
      7 GodMode /*DONN*/ !="donn_godMode"

      publicvariable.txt: You need to change 1 line.

      5 "" !="EPOCH_(UP|SAVE|PAINT|MAINT|REM)BUILD" !="EPOCH_(say3D|switchMove|(store|take)Crypto|TEMPOBJ|packJack|selectedGender)_PVS" !="EPOCH_(mineRocks|create(Object|AirDrop)|FillContainer|SapperObjs)_PVS" !="EPOCH_(load|revive|dead|push|force|respawn|check)Player_PVS" !="EPOCH_(build|equipped)Item_PVS" !="EPOCH_GROUP_(Upgrade|Player|create|Delete|Invite)_PVS" !="EPOCH_(lock|pack)Storage_PVS" !="EPOCH_(unlock|lock|fill|repair)Vehicle_PVS" !="EPOCH_(knockDownTree|destroyTrash|MAKETRADEREQ|MAKETRADE|S_S_VEHICLES|MAKENPCTRADE|oneWayTP)" !="EPOCH_Loot(Animal|Container|Building)" !="EPAH_[a-z]{5,10}" /*DONN*/ !="donn_pv_protected_veh_(add|sub)" !="cad_pvar_smessage"

      setvariable.txt: You need to change 1 line.

      5 "" !=(Offer|Accept|BUILD_SLOT|TRADE_ACTIVE|last_targeter) /*DONN*/ !="(_|)don_player_veh setVariable"
  • Advertisement
  • Supporters
  • Discord

×
×
  • Create New...