Epoch Safe Zones won't switch on god mode

Badgerator

New Member
Hi All,

Am running my first Epoch server on Panthera, I am using a couple of scripts to try to make them work with the sensors built into the mission.sqm When the player enters the trader zone the message is displayed corrrectly from the sensor but god mode wont switch on.

Here's the safezone.sqf

Code:
Private ["_EH_Fired"];

if (isNil "inSafezone") then {
    inSafezone = false;
};

while {true} do {
    waitUntil { inSafeZone };
    titleText [format["Entering Trader Area - God Mode Enabled"],"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 Trader City Area","PLAIN DOWN"]; titleFadeOut 4;
        NearestObject [_this select 0,_this select 4] setPos[0,0,0];
    }];

    player_zombieCheck = {};
    fnc_usec_damageHandler = {};
    thePlayer removeAllEventHandlers "handleDamage";
    thePlayer addEventHandler ["handleDamage", {false}];
    thePlayer allowDamage false;

    waitUntil { !inSafeZone };

    titleText [format["Exiting Trader Area - God Mode Disabled"],"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";
    thePlayer addEventHandler ["handleDamage", {true}];
    thePlayer removeAllEventHandlers "handleDamage";
    thePlayer allowDamage true;
};

This file is executed from the init.sqf with :

Code:
[] execVM "safezone.sqf";

And here's an example of a sensor :
Code:
class Item0
        {
            position[]={4419.9492,22.076105,1629.0402};
            a=100;
            b=100;
            activationBy="WEST";
            repeating=1;
            interruptable=1;
            age="UNKNOWN";
            name="TraderCity1";
            expCond="(player distance TraderCity1) < 75; ";
            expActiv="TitleText[""Now entering trader city Pikla - god mode on"",""PLAIN DOWN""]; canbuild = false;";
            expDesactiv="TitleText[""Now leaving trader city Pikla - god mode off"",""PLAIN DOWN""]; canbuild = true;";
            class Effects
            {
            };
        };
        class Item1
        {
            position[]={4419.9492,22.076105,1629.0402};
            activationBy="ANY";
            repeating=1;
            interruptable=1;
            age="UNKNOWN";
            name="TraderCity1_safezone";
            expCond="(player distance TraderCity1) < 75;";
            expActiv="inSafeZone = true;";
            expDesactiv="inSafeZone = false;";
            class Effects
            {
            };
            };

It seems likes the inSafezone = true condition is not getting passed from sensor to safezone script, tho I am a bit lost admittedly.

Cheers

Badger
 
Back
Top