Jump to content
  • 0

Protected Dome God Mode


Aristoi

Question

Using this as a guide, I have set up protected domes around the trader cities:

http://dayz.st/w/Protected_Dome_for_Epoch

 

Unfortunately, it appears that patrolling SargeAI can kill players in the zone, and they are (of course) defenseless.  I thought that unsetting fnc_usec_damageHandler would have put them in god mode, but perhaps that is not the case?  Is there a different way to do this?

 

Thanks!

 

safezones.sqf

    Private ["_EH_Fired"];
     
    if (isNil "canbuild") then {
            canbuild = true;
    };
     
    while {true} do {
            waitUntil { !canbuild };
            titleText [format["Entering Safe Zone. Your weapons have been deactivated."],"PLAIN DOWN"]; titleFadeOut 4;
     
            waitUntil { player == vehicle player };
     
            thePlayer = vehicle player;
            _EH_Fired = thePlayer addEventHandler ["Fired", {
                    titleText ["You can not fire your weapon in a safe zone.","PLAIN DOWN"]; titleFadeOut 4;
                    NearestObject [_this select 0,_this select 4] setPos[0,0,0];
            }];
     
            player_zombieCheck = {};
            fnc_usec_damageHandler = {};
            fnc_usec_unconscious = {};
            thePlayer removeAllEventHandlers "handleDamage";
            thePlayer addEventHandler ["handleDamage", {false}];
            thePlayer allowDamage false;
     
            waitUntil { canbuild };
     
            titleText [format["Exiting Safe Zone. Your weapons have been reactivated."],"PLAIN DOWN"]; titleFadeOut 4;
            thePlayer removeEventHandler ["Fired", _EH_Fired];
     
            player_zombieCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_zombieCheck.sqf";
            fnc_usec_damageHandler = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageHandler.sqf";
            fnc_usec_unconscious = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_unconscious.sqf";
            thePlayer addEventHandler ["handleDamage", {true}];
            thePlayer removeAllEventHandlers "handleDamage";
            thePlayer allowDamage true;
    };
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Discord

×
×
  • Create New...