Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fnc_infiSTAR_SafeZone =
- {
- _infiSZ =
- [
- [[6325.6772,7807.7412],200,true]
- ,[[4063.4226,11664.19],200,true]
- ,[[11447.472,11364.504],200,true]
- ,[[1606.6443,7803.5156],150,true]
- ,[[12944.227,12766.889],150,true]
- ,[[12060.471,12638.533],350,true]
- ,[[4058.42,10792.62],20,false]
- ,[[13532.4,6356.52],60,false]
- ,[[13466.8,5439.51],60,false]
- ,[[7998.39,2899.04],60,false]
- ,[[4359.92,2259.39],60,false]
- ,[[3708.5974,5970.499],315,true]
- ,[[13642.55,2880.3267],315,false]
- ];
- if (isServer) exitWith
- {
- _signs = true;
- {
- _center = _x select 0;
- _radius = _x select 1;
- _lSign = _x select 2;
- if (_signs && _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 ['SignM_FARP_Winchester_EP1', _location, [], 0, 'CAN_COLLIDE'];
- _object setDir _dir;
- _object setVehicleInit 'this setObjectTexture [0, ''Addons\SafeZones\sign.paa''];';
- };
- };
- } forEach _infiSZ;
- };
- waitUntil { !isNil 'dayz_animalCheck' };
- if (isNil 'inSafezone') then {inSafezone = false;};
- [_infiSZ] spawn {
- _infiSZ = _this select 0;
- startSafeZone =
- {
- if (isNil 'outNow') then
- {
- hint 'You entered a Safe Zone!';
- taskHint ['You entered a Safe Zone!', [0,1,0,1], 'taskDone'];
- inNow = nil;
- outNow = true;
- };
- player_fired = { deleteVehicle (nearestObject [_this select 0,_this select 4]); };
- player_zombieCheck = {};
- fnc_usec_damageHandler = {};
- fnc_usec_unconscious = {};
- object_monitorGear = {};
- player removeAllEventHandlers 'handleDamage';
- player addEventHandler ['handleDamage', {false}];
- player allowDamage false;
- if (vehicle player != player) then
- {
- _vehObj = vehicle player;
- _vehObj removeAllEventHandlers 'Fired';
- _vehObj addEventHandler ['Fired', {_this call player_fired;}];
- };
- };
- endSafeZone =
- {
- if (isNil 'inNow') then
- {
- hint 'You left the Safe Zone!';
- taskHint ['You left the Safe Zone!', [1,0,0.1,1], 'taskFailed'];
- inNow = true;
- outNow = nil;
- };
- player_fired = compile preprocessFileLineNumbers '\z\addons\dayz_code\compile\player_fired.sqf';
- 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';
- object_monitorGear = compile preprocessFileLineNumbers '\z\addons\dayz_code\compile\object_monitorGear.sqf';
- player allowDamage true;
- player removeAllEventHandlers 'HandleDamage';
- player addeventhandler ['HandleDamage',{_this call fnc_usec_damageHandler;} ];
- };
- while {1 == 1} do
- {
- _state = false;
- _obj = vehicle player;
- {
- _z = _x select 0;
- _r = _x select 1;
- if (_obj distance _z < _r) exitWith {_state = true;};
- } forEach _infiSZ;
- if (_state) then
- {
- inSafeZone = true;
- call startSafeZone;
- {
- if (!isNull _x) then
- {
- if !(isPlayer _x) then
- {
- deletevehicle _x;
- };
- };
- } forEach (_obj nearEntities ['zZombie_Base',15]);
- }
- else
- {
- inSafeZone = false;
- };
- _plr = player;
- sleep 2;
- if (!(inSafeZone) || (_plr != player)) then
- {
- call endSafeZone;
- };
- };
- };
- [] spawn {
- while {1 == 1} do
- {
- if (inSafezone) then
- {
- _cnt = {isPlayer _x && _x != player} count (player nearEntities [['CAManBase'], 2]);
- if ((_cnt > 0) && (!isNull (findDisplay 106))) then
- {
- (findDisplay 106) closedisplay 0;
- _log = format['%1 You are not allowed to open Gear while near another player!',name player];
- cutText [_log,'PLAIN'];
- hint _log;
- };
- }
- else
- {
- sleep 2;
- };
- sleep 0.1;
- };
- };
- };
- [] spawn fnc_infiSTAR_SafeZone;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement