MsFritzyBoy
New Member
Can someone plz send me a safezone script that works for DayZ S.T as I have tried many and they all fail
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
if (!isServer) then {
if (isNil "SafeZoneClientCheck") then
{
SafeZoneClientCheck = true;
[] spawn {
waitUntil {alive player };
waituntil {!isnull (finddisplay 46)};
sleep 3;
if (isNil "inSafezone") then {inSafezone = false;};
[] spawn {
while {true} do
{
if ((vehicle player distance zonebash < 75) || (vehicle player distance zoneklen < 75) || (vehicle player distance zonestary < 75)) then
{
inSafeZone = true;
canbuild = false;
{
if (!isNull _x) then {
if !(isPlayer _x) then {
deletevehicle _x;
};
};
} forEach (vehicle player nearEntities ["zZombie_Base",25]);
}
else
{
inSafeZone = false;
canbuild = true;
};
sleep 2;
};
};
[] spawn {
while {true} do
{
sleep 0.5;
waitUntil {inSafeZone};
waitUntil {player == vehicle player};
thePlayer = player;
_EH_Fired = player addEventHandler ["Fired",{
deleteVehicle (nearestObject [_this select 0,_this select 4]);
}];
player_zombieCheck = {};
player_fired = {};
fnc_usec_damageHandler = {};
fnc_usec_unconscious = {};
object_monitorGear = {};
player removeAllEventHandlers "handleDamage";
player addEventHandler ["handleDamage", {false}];
player allowDamage false;
sleep 0.5;
waitUntil {((!inSafeZone) || (thePlayer != player))};
player 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";
player addEventHandler ["handleDamage", {true}];
player removeAllEventHandlers "handleDamage";
player allowDamage true;
};
};
[] spawn
{
if (isNil "inSafezone") then
{
inSafezone = false;
};
_ownGear = false;
while {true} do
{
if (inSafezone) then
{
_list = ({isPlayer _x} count (getPos vehicle player nearEntities [['AllVehicles'], 10])) - 1;
if (_list > 0) then
{
if( !isNull (FindDisplay 106) ) then
{
if( !_ownGear ) then
{
player action ["GEAR", ""];
systemchat "Other player within 10m can only access own gear";
_ownGear = true;
};
}
else
{
if(_ownGear) then
{
_ownGear = false;
};
};
};
};
sleep 0.1;
};
};
};
};
};