Safe Zones [Working]

i give it a try later and tell u if it works :D cause i think its perfect when cars are only safe when players inside the zone... cause when theres no player... well his own fault when he leaves it there... no need for alltime vehicle protection ^^
 
So it should be, or right?

Code:
Private ["_EH_Fired"];
 
if (isNil "inSafezone") then {
    inSafezone = false;
};
 
while {true} do {
    waitUntil { inSafeZone };
//    titleText [format["Entering Safe Zone! Weapons off, and shooting wastes ammo."],"PLAIN DOWN"]; titleFadeOut 4;
 
    waitUntil { player == vehicle player };
 
    theCar = LandVehicle;   
    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 = {};
    player_fired = {};
    fnc_usec_damageHandler = {};
    fnc_usec_unconscious  = {};
    object_monitorGear = {};
    thePlayer removeAllEventHandlers "handleDamage";
    thePlayer addEventHandler ["handleDamage", {false}];
    thePlayer allowDamage false;
 
    theCar removeAllEventHandlers "handleDamage";
    theCar addEventHandler ["handleDamage", {false}];
    theCar allowDamage false;
 
    waitUntil { !inSafeZone };
 
//    titleText [format["Exiting Safe Zone!"],"PLAIN DOWN"]; titleFadeOut 4;
    thePlayer removeEventHandler ["Fired", _EH_Fired];
 
    player_zombieCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_zombieCheck.sqf";
    player_fired = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_fired.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";
    object_monitorGear = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_monitorGear.sqf";
    thePlayer addEventHandler ["handleDamage", {true}];
    thePlayer removeAllEventHandlers "handleDamage";
    thePlayer allowDamage true;
   
    theCar addEventHandler ["handleDamage", {true}];
    theCar removeAllEventHandlers "handleDamage";
    theCar allowDamage true;
 
};
 
Da ist ein Fehler im Script. Wenn man von ausserhalb der Safezone in die Safezone schiesst dann tötet man den Player.

There's a bug in the script. If fired from outside the safe zone to safe zone, then you kill the player.
 
uhm... gonna test the car thing in a few minutes... for me safezones are working... even when players from outside start shooting...


***Edit: tested.... and its not working... even when players are inside the safezone, cars can still recive damage...
 
yeah the car part of it still needs work and i just finished my ammo box script which took precidance over this and i will be posting that later
 
ya I would like to know as well been spending 5 hours already trying to get this to work with my buddy we cant get cars to be invulable in the safe zones we got it so the vehicles with guns on it don't do damage inside the zones but even that is buggy sometimes when u leave the vehicle doesn't do any damage period till u log out and back in
also any vehicle outside the zone can shoot inside and kill vehicles but not players since players don't take any damage just wish the vehicles were as easy as the player commands
 
oh ok ^^ cant u run a server for script testing on your local pc? i do so too ^^ i only upload things to my public one when they are working... :p
 
oh ok ^^ cant u run a server for script testing on your local pc? i do so too ^^ i only upload things to my public one when they are working... :p


got it workin will upload my new script, without the vehicl part considering that is still not working but it got Admin Safe and Clan Zones all working at once, each with different scripts, will post that later tonight. im still working on getting the vehicles to be Immortal in safe zone
 
From what i can gather the sensor is what will need to be changed so i can call the script if a Vehicle other then a player enters the zone: this is what i can assume the sensor will look like......

Code:
class Sensors
    {
    items=1;
    class Item0
        {
            position[]={11471,0,11333};
            ractivationBy="ANY";
            repeating=1;
            interruptable=1;
            age="UNKNOWN";
            name="vehicle_god";
            expCond="(LandVehicle distance vehicle_god) < 50;";
            expActiv="CarGodEnter = [] execVM ""scripts\Zones\CarGodEnter.sqf""; terminate CarGodExit;";
            expDesactiv="terminate CarGodEnter; CarGodExit = [] execVM ""scripts\Zones\CarGodExit.sqf"";";
        class Effects
        {
        };
    };
};

The script that is another story i will see what i can do with it

what i found fro earlier script problem is it only works when player is in the car:

Code:
titleText ["Cargod enabled","PLAIN DOWN"]; titleFadeOut 4;
while {alive ( vehicle player )} do
{
    vehicle player setfuel 1;
    vehicle player setvehicleammo 1;
    vehicle player setdammage 0;
    sleep 0.001;
};
 
Hi ghost : ) may i ask u something? do u have a code if i wanna create a safe zone but only for uniquee players ? atm i have one global safe zone for all the players (trading post) but what if i want to add uniquee safe zone for my clan for example?, like with ID restriction
Thanks; and sorry for my english x).-
 
i have it yes i will upload it once all the kinks are worked out if you use Anti Hack from blur something about it wil break your zones i need to fix that before releasing
 
hey ghost me and my friend have been tryinbg to get this work for hours apon hours spent a good 3 days trying to get vehicles to not take damage in the safe zone even tried repair scripts triggering and so on and we just cant get it to work have u managed to fix out how to put god mod on vehicles in the safe areas?
 
Back
Top