Donnovan Posted October 27, 2015 Author Report Share Posted October 27, 2015 Thankyou Tang0!The cars are associated to player object, when the player dies his object became null, so the car have no owner (objNull).I will make some tests. Link to comment Share on other sites More sharing options...
Tang0 Posted October 27, 2015 Report Share Posted October 27, 2015 thnx :) (guys on my server love breaking stuff :) ) Donnovan 1 Link to comment Share on other sites More sharing options...
Donnovan Posted October 27, 2015 Author Report Share Posted October 27, 2015 (edited) I figured it out.When the player disconnect, his player obj became null, so the vehicle in the safezone lose his owner and became avaliable.When the player dies, the player obj does not became null until the player body dissapear. So, while the player body is on the map, the car is owned by it.Will fix that. Edited October 27, 2015 by Donnovan Link to comment Share on other sites More sharing options...
Donnovan Posted October 27, 2015 Author Report Share Posted October 27, 2015 Tang0,Change the line 178 from:if (isNull _don_veh_owner) then {To:if !(!isNull _don_veh_owner && alive _don_veh_owner) then {This will fix the problem. Link to comment Share on other sites More sharing options...
Tang0 Posted October 27, 2015 Report Share Posted October 27, 2015 Thank you kind sir i will try that :) Donnovan 1 Link to comment Share on other sites More sharing options...
GudrunGisela Posted November 1, 2015 Report Share Posted November 1, 2015 First of all thanks Donnovan for this awesome script :)My Co-Admin and me tested it intensively and we have only one last persistent problem. If the server restarts and the first player run into the safezone he doesn't have God Mode so it's possible to kill him. If he leaves the Safezone and runs again into it the God Mode works. After that everything worked fine until next restart. Always the first player who run into the safezone after restart has no God Mode until he leaves it and enters the safezone again. Is this problem known? How can I fix this? Thanks in advance.Edit:If anyone has the same problem just try this:Change this line:if (hasInterface) then {To:if (!isDedicated) then {That solved it for me.Greetings pr0dukt and Donnovan 2 Link to comment Share on other sites More sharing options...
Tweety060286 Posted November 2, 2015 Report Share Posted November 2, 2015 (edited) Hello i have also test this script verry hard. Its a really good script, verry verry thanks.But i have see one Problem, can you help me or change this.The Problem is the locked Vehicle have Godmode in the Safe Area, but Non Key vehicles have not Godmode.When i shoot from Outside into the Safezone on a Non Key vehicle , i can destroy it. Grezze Edited November 2, 2015 by Tweety060286 Donnovan 1 Link to comment Share on other sites More sharing options...
Donnovan Posted November 3, 2015 Author Report Share Posted November 3, 2015 Tweety, if the vehicle started with the server inside the safezone, or if it was spawned inside the safezone, it will not have god mode until someone enters it. May be is that the case? Link to comment Share on other sites More sharing options...
Tweety060286 Posted November 4, 2015 Report Share Posted November 4, 2015 Hello,No this dont worked.When i drive with a non key vehicle inside they havent godmode.Have you a idea ok a fix?Thanks and grezze. Link to comment Share on other sites More sharing options...
Pasquale Posted November 7, 2015 Report Share Posted November 7, 2015 HIit would be nice to add the ability infistar_safezone1. USE_AI_REMOVER = true; // use this to remove Missionbots (AI) within 100m of a player if the player is in a safezone2. LOG_EnterLeave = true; // it will log your .RPT when a player enters or leaves the safezone! (only works with infiSTAR.de admin tools / AntiHack)/* You can use USE_CANBUILD or/and (collaborating) with custom positions below (USE_POSITIONS) [position or zone,radius] */3. USE_SIGNS = true; // use this to build signs around the safezone Link to comment Share on other sites More sharing options...
Donnovan Posted November 7, 2015 Author Report Share Posted November 7, 2015 Pasquale, bots should not mess with players inside safezone, because all players are put in captive mode when they are inside it (player setCaptive true;);I liked the idea of mark on ground the safezone radius. Link to comment Share on other sites More sharing options...
Tweety060286 Posted November 9, 2015 Report Share Posted November 9, 2015 Hello Donnovan !I have see a other Problem.When a player leave the Safezone with a Chopper he have also 30 secounds Godmode.When the 30 secound ends the player its on there Base.can you change me the Godmodetime without vehicle into 30 secounds and with vehicle 10 secounds ?Please and verry Thanks Link to comment Share on other sites More sharing options...
Nekuan Posted December 5, 2015 Report Share Posted December 5, 2015 At first look it seems that AI ignores me after I've been inside a safezone. The 60 sec of godmode passed and I could kill them but they simply wouldn't react. Need to test this out a bit more though Edit: Only seems to partially happen when you arrive at the mission before the godmode runs out. The first one I tested didn't react at all the 2nd one did react properly. Gonna test it out a bit more but so far really like it. Thanks for yet another awesome script. Really gotta get some money your way when I can Link to comment Share on other sites More sharing options...
Donnovan Posted December 6, 2015 Author Report Share Posted December 6, 2015 Thankyou. I beleive i need to reveal players to AI when players became hostile again or AI will not notice this change in player status. {if (!isPlayer _x) then {_x reveal player;};} forEach (player nearEntities ["CAManBase",400]); Link to comment Share on other sites More sharing options...
Doggyman Posted December 8, 2015 Report Share Posted December 8, 2015 (edited) Works PERFECT Big THX Donnovan My Players love it :) I screw the God mode time down to 30seconds for players and 15seconds for cars is more as enough :) Look forward for you scripts. Edited December 10, 2015 by Doggyman Donnovan 1 Link to comment Share on other sites More sharing options...
xandinfjg Posted December 31, 2015 Report Share Posted December 31, 2015 use sqf file //LEAVED SAFE donn_InSafeZone = false; systemChat (localize "STR_safezone_2"); donn_inSafeCounter spawn { _inSafeIndex = _this; _unGod = true; for "_c" from 0 to 3 do { _sleep = 10; if (vehicle player != player) then {_sleep = 3;}; systemChat ("in " + str (_sleep*3-_c*_sleep) + "/" + str (_sleep*3) + " seconds."); uiSleep _sleep; if (donn_InSafeZone || _inSafeIndex != donn_inSafeCounter) exitWith { _unGod = false; }; use xml file <?xml version="1.0" encoding="utf-8"?> <Project name="dayz"> <Package name="dayz"> <Key ID="STR_safezone_2"> <Original>Leaving safe zone</Original> <English>Leaving safe zone</English> <French>Laissant zone de sécurité</French> <German>Verlassen sichere Zone</German> <Portuguese>Saindo de zona segura</Portuguese> </Key> </Package> </Project> Auto detect languages cliente arma2 Link to comment Share on other sites More sharing options...
creativv Posted April 11, 2016 Report Share Posted April 11, 2016 There is a serious issue with this , on our server if 2 players leave the safezone one has 10 seconds headstart on the other when his godmode ends then shoots the player with godmode still running , the player with godmode will die . Link to comment Share on other sites More sharing options...
Xantosh Posted July 17, 2016 Report Share Posted July 17, 2016 hey man, sorry to necro such an old thread, but i just got into Arma2 dayz mod (well learning how to get a server up and rtunning), after getting bored with the SA edition (please don't hate me), just need to know if there is supposed to be a file/folder to download or do i just create the files from your texts? still new to all this but i'm loving the challenge, Overpoch is still too far over my head right now! Link to comment Share on other sites More sharing options...
Shak Posted July 18, 2016 Report Share Posted July 18, 2016 INSTALLATION Put the file andre_safezone.sqf in the root of you mission file. Add to the end of your init.sqf the line: execVM "andre_safezone.sqf"; Link to comment Share on other sites More sharing options...
WagnerMello Posted August 25, 2016 Report Share Posted August 25, 2016 Hello Andre I put your script however if I shoot the vehicles out of the safe can to damage them how can I solve? Link to comment Share on other sites More sharing options...
SKS.Goliath Posted April 3, 2017 Report Share Posted April 3, 2017 Please ask for an update thx Link to comment Share on other sites More sharing options...
juandayz Posted April 6, 2017 Report Share Posted April 6, 2017 On 3/4/2017 at 2:00 PM, SKS.Goliath said: Please ask for an update thx try for 1.6 Spoiler if (hasInterface) then { //MAP SAFEZONES (READY FOR CHERNARUS) donn_traders = [ ["Safe 1",[6325,7807,0],160,500], ["Safe 2",[4063,11664,0],160,500], ["Safe 3",[11447,11364,0],160,500], ["Safe 4",[1606,7803,0],160,500], ["Safe 5",[12944,12766,0],160,500], ["Safe 6",[12060,12640,0],160,500] ]; waitUntil {uiSleep 0.5;!isNil "PVDZ_plr_LoginRecord"}; inSafeZone = false; donn_InSafeZone = false; donn_canbuild = true; donn_incarWas = []; donn_inSafeCounter = 0; donn_vehicle_handleDamage = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\veh_handleDam.sqf"; vehicle_handleDamage_timer = 0; vehicle_handleDamage = { _owner = (_this select 0) getVariable ["don_owner",objNull]; _hasOwner = !isNull _owner; if (_hasOwner) then { if (time - vehicle_handleDamage_timer > 2) then { vehicle_handleDamage_timer = time; systemChat "This vehicle have God Mode!"; }; } else { _this call donn_vehicle_handleDamage; }; }; //SAFEZONE PROXIMITY CHECK FUNCTION donn_calcSafe = { private ["_tName","_tPos","_tRad"]; _obj = _this select 0; _radNumber = 1 + (_this select 1); _minDist = 100000; { _safePos = _x select 1; _safeRad = _x select _radNumber; _dist = (_obj distance _safePos) - _safeRad; if (_dist < _minDist) then { _minDist = _dist; _tName = _x select 0; _tPos = _x select 1; _tRad = _safeRad; }; } forEach donn_traders; [_minDist,_tName,_tPos,_tRad] }; //SAFEZONE ENTER AND EXIT [] spawn { _maxVel = 80; while {true} do { //CHECK IF IN SAFE _result = [player,1] call donn_calcSafe;_minDist = _result select 0; while {_minDist > 0} do { uiSleep (((_minDist/_maxVel) max 1) min 10); _result = [player,1] call donn_calcSafe; _minDist = _result select 0; }; //SAFE ON donn_InSafeZone = true; donn_inSafeCounter = donn_inSafeCounter + 1; systemChat "You are in the Safe Zone..."; player_zombieCheck = {}; fnc_usec_unconscious = {}; fnc_usec_damageHandler_timer = 0; fnc_usec_damageHandler = { _attacker = _this select 3; if (!isNull _attacker) then { if (isPlayer _attacker) then { if (time - fnc_usec_damageHandler_timer > 2) then { fnc_usec_damageHandler_timer = time; [nil,_attacker,"loc",rHINT,"This player have God Mode!"] call RE; }; }; }; _damage = 0; _damage }; player_fired = {deleteVehicle (_this select 6);}; player setCaptive true; inSafeZone = true; //INFISTAR FIRED EH RELATED _veh = vehicle player; if (_veh != player) then { donn_incarWas = donn_incarWas + [_veh]; _veh addEventHandler ["Fired",{deleteVehicle (_this select 6);}]; if (player == driver _veh) then { _veh setVariable ['don_owner',driver _veh,true]; }; }; //CHECK IF LEAVED FROM SAFE _tPos = _result select 2; _tRad = _result select 3; _dist = player distance _tPos; while {_dist < _tRad} do { uiSleep 1; _dist = player distance _tPos; }; //LEAVED SAFE donn_InSafeZone = false; systemChat "You leaved the Safe Zone..."; donn_inSafeCounter spawn { _inSafeIndex = _this; _unGod = true; for "_c" from 0 to 5 do { _sleep = 10; if (vehicle player != player) then {_sleep = 5;}; systemChat ("God Mode ends in " + str (_sleep*6-_c*_sleep) + "/" + str (_sleep*6) + " seconds."); uiSleep _sleep; if (donn_InSafeZone || _inSafeIndex != donn_inSafeCounter) exitWith { _unGod = false; }; }; if (_unGod) then { systemChat "God Mode ended!"; player_zombieCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_zombieCheck.sqf"; fnc_usec_unconscious = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_unconscious.sqf"; fnc_usec_damageHandler = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageHandler.sqf"; player_fired = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_fired.sqf"; player setCaptive false; inSafeZone = false; //INFISTAR FIRED EH RELATED { _x removeAllEventHandlers "Fired"; _inSafe = ([_x,1] call donn_calcSafe) select 0 < 0; if (!_inSafe) then { _ownerSet = !isNull (_x getVariable ['don_owner',objNull]); if (_ownerSet) then { _x setVariable ['don_owner',objNull,true]; }; }; } forEach donn_incarWas; donn_incarWas = []; }; }; }; }; //IN BUILD ZONE CHECK [] spawn { _maxVel = 50; while {true} do { _result = [player,2] call donn_calcSafe; _minDist = _result select 0; while {_minDist > 0} do { uiSleep (((_minDist/_maxVel) max 2) min 10); _result = [player,2] call donn_calcSafe; _minDist = _result select 0; }; donn_canbuild = false; systemChat "Your are in the NoBuild zone..."; _tPos = _result select 2; _tRad = _result select 3; _dist = player distance _tPos; while {_dist < _tRad} do { uiSleep 2; _dist = player distance _tPos; }; donn_canbuild = true; systemChat "You leaved the NoBuild zone..."; }; }; //ENTERING VEHICLES PROTECTION don_incar = false; [] spawn { while {true} do { waitUntil {uiSleep 1;don_player_veh = vehicle player;don_player_veh != player}; don_incar = true; don_player_veh_isAir = don_player_veh isKindOf "Air"; //NOT NECESSARY if (donn_InSafeZone) then { _don_veh_owner = don_player_veh getVariable ['don_owner',objNull]; if (isNull _don_veh_owner) then { don_player_veh setVariable ['don_owner',player,true]; _don_veh_owner = player; }; _ownerGroup = units group _don_veh_owner; _ownerGroupTag = _don_veh_owner getVariable ["friendlies",[]]; _playerID = player getVariable ["CharacterID","0"]; if (player in _ownerGroup || _playerID in _ownerGroupTag) then { if !(don_player_veh in donn_incarWas) then { donn_incarWas = donn_incarWas + [don_player_veh]; don_player_veh addEventHandler ["Fired",{deleteVehicle (_this select 6);}]; }; } else { player action ['getOut', don_player_veh]; }; }; waitUntil {uiSleep 1; vehicle player != don_player_veh}; don_incar = false; }; }; //GEAR PROTECTION [] spawn { while {true} do { _playerID = player getVariable ["CharacterID",0]; if (donn_InSafeZone) then { if (!don_incar) then { //CHECK NEAR PLAYERS AND VEHICLES _nearP = [];_nearV = []; { if (isPlayer _x && _x != player) then {_nearP = _nearP + [_x];}; } forEach (player nearEntities ['CAManBase',4]); _countNear = count _nearP; { if (player distance _x < ((sizeOf typeOf _x)/2) + 3) then {_nearV = _nearV + [_x];}; } forEach (player nearEntities [['LandVehicle','Air','Ship'],25]); _countNear = _countNear + count _nearV; //CHECK IF ALL ARE FRIENDLY _friends = units group player; if (_countNear > 0) then { _countNearF = {_x in _friends || _playerID in (_x getVariable ["friendlies",[]])} count _nearP; _countNearF = _countNearF + ({_owner = _x getVariable ['don_owner',objNull];_owner in _friends || _playerID in (_owner getVariable ["friendlies",[]])} count _nearV); if (_countNear > _countNearF && !isNull findDisplay 106) then { (findDisplay 106) closedisplay 0; closeDialog 0;closeDialog 0;closeDialog 0; cutText [format['%1. You is near a stranger player or vehicle and cant access gear now.',name player],'PLAIN']; }; }; }; uiSleep 0.25; } else { uiSleep 2; }; }; }; //LOG INFO diag_log "[ANDRE SAFEZONES] SCRIPT LOADED OK!"; }; gernika 1 Link to comment Share on other sites More sharing options...
SKS.Goliath Posted April 6, 2017 Report Share Posted April 6, 2017 THX me testing Link to comment Share on other sites More sharing options...
DieTanx Posted April 7, 2017 Report Share Posted April 7, 2017 Spoiler Error in expression <d; }; } forEach donn_traders; [_minDist,_tName,_tPos,_tRad] }; [] spawn { _max> Error position: <_tName,_tPos,_tRad] }; [] spawn { _max> Error Undefined variable in expression: _tname File mpmissions\__CUR_MP.Chernarus\custom\safezone.sqf, line 47 Error in expression <getVariable ['don_owner',objNull]); if (_ownerSet) then { _x setVariable ['don_o> Error position: <_ownerSet) then { _x setVariable ['don_o> Error Undefined variable in expression: _ownerset File mpmissions\__CUR_MP.Chernarus\custom\safezone.sqf, line 131 Client side error running this Link to comment Share on other sites More sharing options...
juandayz Posted April 7, 2017 Report Share Posted April 7, 2017 @DieTanx @SKS.Goliath Spoiler private ["_owner","_hasOwner","_this","_tName","_tPos","_tRad","_obj","_radNumber","_minDist","_safePos","_safeRad","_dist","_maxVel", "_result","_attacker","_damage","_veh",""_inSafeIndex,"_unGod","_inSafe","_ownerSet","_don_veh_owner","_ownerGroup","_ownerGroupTag", "_playerID","_nearP","_nearV","_countNear","_countNearF","_friends"]; if (hasInterface) then { //MAP SAFEZONES (READY FOR CHERNARUS) donn_traders = [ ["Safe 1",[6325,7807,0],160,500], ["Safe 2",[4063,11664,0],160,500], ["Safe 3",[11447,11364,0],160,500], ["Safe 4",[1606,7803,0],160,500], ["Safe 5",[12944,12766,0],160,500], ["Safe 6",[12060,12640,0],160,500] ]; waitUntil {uiSleep 0.5;!isNil "PVDZ_plr_LoginRecord"}; inSafeZone = false; donn_InSafeZone = false; donn_canbuild = true; donn_incarWas = []; donn_inSafeCounter = 0; donn_vehicle_handleDamage = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\veh_handleDam.sqf"; vehicle_handleDamage_timer = 0; vehicle_handleDamage = { _owner = (_this select 0) getVariable ["don_owner",objNull]; _hasOwner = !isNull _owner; if (_hasOwner) then { if (time - vehicle_handleDamage_timer > 2) then { vehicle_handleDamage_timer = time; systemChat "This vehicle have God Mode!"; }; } else { _this call donn_vehicle_handleDamage; }; }; //SAFEZONE PROXIMITY CHECK FUNCTION donn_calcSafe = { private ["_tName","_tPos","_tRad"]; _obj = _this select 0; _radNumber = 1 + (_this select 1); _minDist = 100000; { _safePos = _x select 1; _safeRad = _x select _radNumber; _dist = (_obj distance _safePos) - _safeRad; if (_dist < _minDist) then { _minDist = _dist; _tName = _x select 0; _tPos = _x select 1; _tRad = _safeRad; }; } forEach donn_traders; [_minDist,_tName,_tPos,_tRad] }; //SAFEZONE ENTER AND EXIT [] spawn { _maxVel = 80; while {true} do { //CHECK IF IN SAFE _result = [player,1] call donn_calcSafe;_minDist = _result select 0; while {_minDist > 0} do { uiSleep (((_minDist/_maxVel) max 1) min 10); _result = [player,1] call donn_calcSafe; _minDist = _result select 0; }; //SAFE ON donn_InSafeZone = true; donn_inSafeCounter = donn_inSafeCounter + 1; systemChat "You are in the Safe Zone..."; player_zombieCheck = {}; fnc_usec_unconscious = {}; fnc_usec_damageHandler_timer = 0; fnc_usec_damageHandler = { _attacker = _this select 3; if (!isNull _attacker) then { if (isPlayer _attacker) then { if (time - fnc_usec_damageHandler_timer > 2) then { fnc_usec_damageHandler_timer = time; [nil,_attacker,"loc",rHINT,"This player have God Mode!"] call RE; }; }; }; _damage = 0; _damage }; player_fired = {deleteVehicle (_this select 6);}; player setCaptive true; inSafeZone = true; //INFISTAR FIRED EH RELATED _veh = vehicle player; if (_veh != player) then { donn_incarWas = donn_incarWas + [_veh]; _veh addEventHandler ["Fired",{deleteVehicle (_this select 6);}]; if (player == driver _veh) then { _veh setVariable ['don_owner',driver _veh,true]; }; }; //CHECK IF LEAVED FROM SAFE _tPos = _result select 2; _tRad = _result select 3; _dist = player distance _tPos; while {_dist < _tRad} do { uiSleep 1; _dist = player distance _tPos; }; //LEAVED SAFE donn_InSafeZone = false; systemChat "You leaved the Safe Zone..."; donn_inSafeCounter spawn { _inSafeIndex = _this; _unGod = true; for "_c" from 0 to 5 do { _sleep = 10; if (vehicle player != player) then {_sleep = 5;}; systemChat ("God Mode ends in " + str (_sleep*6-_c*_sleep) + "/" + str (_sleep*6) + " seconds."); uiSleep _sleep; if (donn_InSafeZone || _inSafeIndex != donn_inSafeCounter) exitWith { _unGod = false; }; }; if (_unGod) then { systemChat "God Mode ended!"; player_zombieCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_zombieCheck.sqf"; fnc_usec_unconscious = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_unconscious.sqf"; fnc_usec_damageHandler = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageHandler.sqf"; player_fired = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_fired.sqf"; player setCaptive false; inSafeZone = false; //INFISTAR FIRED EH RELATED { _x removeAllEventHandlers "Fired"; _inSafe = ([_x,1] call donn_calcSafe) select 0 < 0; if (!_inSafe) then { _ownerSet = !isNull (_x getVariable ['don_owner',objNull]); if (_ownerSet) then { _x setVariable ['don_owner',objNull,true]; }; }; } forEach donn_incarWas; donn_incarWas = []; }; }; }; }; //IN BUILD ZONE CHECK [] spawn { _maxVel = 50; while {true} do { _result = [player,2] call donn_calcSafe; _minDist = _result select 0; while {_minDist > 0} do { uiSleep (((_minDist/_maxVel) max 2) min 10); _result = [player,2] call donn_calcSafe; _minDist = _result select 0; }; donn_canbuild = false; systemChat "Your are in the NoBuild zone..."; _tPos = _result select 2; _tRad = _result select 3; _dist = player distance _tPos; while {_dist < _tRad} do { uiSleep 2; _dist = player distance _tPos; }; donn_canbuild = true; systemChat "You leaved the NoBuild zone..."; }; }; //ENTERING VEHICLES PROTECTION don_incar = false; [] spawn { while {true} do { waitUntil {uiSleep 1;don_player_veh = vehicle player;don_player_veh != player}; don_incar = true; don_player_veh_isAir = don_player_veh isKindOf "Air"; //NOT NECESSARY if (donn_InSafeZone) then { _don_veh_owner = don_player_veh getVariable ['don_owner',objNull]; if (isNull _don_veh_owner) then { don_player_veh setVariable ['don_owner',player,true]; _don_veh_owner = player; }; _ownerGroup = units group _don_veh_owner; _ownerGroupTag = _don_veh_owner getVariable ["friendlies",[]]; _playerID = player getVariable ["CharacterID","0"]; if (player in _ownerGroup || _playerID in _ownerGroupTag) then { if !(don_player_veh in donn_incarWas) then { donn_incarWas = donn_incarWas + [don_player_veh]; don_player_veh addEventHandler ["Fired",{deleteVehicle (_this select 6);}]; }; } else { player action ['getOut', don_player_veh]; }; }; waitUntil {uiSleep 1; vehicle player != don_player_veh}; don_incar = false; }; }; //GEAR PROTECTION [] spawn { while {true} do { _playerID = player getVariable ["CharacterID",0]; if (donn_InSafeZone) then { if (!don_incar) then { //CHECK NEAR PLAYERS AND VEHICLES _nearP = [];_nearV = []; { if (isPlayer _x && _x != player) then {_nearP = _nearP + [_x];}; } forEach (player nearEntities ['CAManBase',4]); _countNear = count _nearP; { if (player distance _x < ((sizeOf typeOf _x)/2) + 3) then {_nearV = _nearV + [_x];}; } forEach (player nearEntities [['LandVehicle','Air','Ship'],25]); _countNear = _countNear + count _nearV; //CHECK IF ALL ARE FRIENDLY _friends = units group player; if (_countNear > 0) then { _countNearF = {_x in _friends || _playerID in (_x getVariable ["friendlies",[]])} count _nearP; _countNearF = _countNearF + ({_owner = _x getVariable ['don_owner',objNull];_owner in _friends || _playerID in (_owner getVariable ["friendlies",[]])} count _nearV); if (_countNear > _countNearF && !isNull findDisplay 106) then { (findDisplay 106) closedisplay 0; closeDialog 0;closeDialog 0;closeDialog 0; cutText [format['%1. You is near a stranger player or vehicle and cant access gear now.',name player],'PLAIN']; }; }; }; uiSleep 0.25; } else { uiSleep 2; }; }; }; //LOG INFO diag_log "[ANDRE SAFEZONES] SCRIPT LOADED OK!"; }; Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now