Donnovan Posted June 4, 2015 Report Share Posted June 4, 2015 (edited) MEGA UPDATE ON 26 OF OCTOBER OF 2015 FEATURES - COMPATIBLE WITH INFISTAR - COMPATIBLE WITH DZGM - PEOPLE TAGGED AS FRIENDLY OR IN YOUR GROUP (DZGM) CAN ACCESS YOUR GEAR - PEOPLE TAGGED AS FRIENDLY OR IN YOUR GROUP (DZGM) CAN ACCESS YOUR CAR & CAR GEAR - A CAR IS YOURS IF YOU ENTERED THE SAFEZONE DRIVING IT - NO-BUILD ZONES ARROUND SAFEZONES - 60 SECONDS, FOR PLAYERS ON FOOT, OR 30 SECONDS, FOR MOTORIZED PLAYERS, EXTRA GOD MODE ON SAFE ZONE EXIT - PLAYER GOD MODE AND NO-SHOT MODE - REAL VEHICLE GOD MODE AND VEHICLE NO-SHOT MODE FOR ALL PLAYERS If it worked and you enjoy it, i ask for a donation. Thankyou! $USD $EURO 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"; THE SCRIPT andre_safezones.sqf 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 "PVDZE_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\vehicle_handleDamage.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!"; }; NO-BUILD ZONES 1 - NO GENERAL BUILD You must have a custom player_build.sqf. On your custom player_build.sqf, search for this code: //No building on roads unless toggled if (!DZE_BuildOnRoads) then { if (isOnRoad _position) then { _cancel = true; _reason = "Cannot build on a road."; }; }; Bellow it, add this code: // No buildings arround safe zones (no-build zones) if(!donn_canbuild) then { _cancel = true; _reason = "\nCannot build on the no-build zone!"; }; //DONN NO-BUILD ZONES 2 - NO SAFE PLACEMENT You must have a custom vault_pitch.sqf. On your custom vault_pitch.sqf, search for this code: // Make sure vault is not placed on road. if (isOnRoad _vault_location) then { _isOk = true; }; Bellow it, add this code: // Make sure vault are not placed arround safe zones (no-build zones) if(!donn_canbuild) then { _isOk = true; }; Search this code more to the end of the file: cutText [(localize "str_epoch_player_110"), "PLAIN DOWN"]; Change it to: //cutText [(localize "str_epoch_player_110"), "PLAIN DOWN"]; cutText ["You can''t place safes on the roads or no-build zones!", "PLAIN DOWN"]; CONFIGURATION ON andre_safezone.sqf Search for this code bellow in andre_safezone.sqf, here you need to add the safezones of your map. Default is Chernarus, if you use another map, change it to your safezones. 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] ]; Each line contain one safe zone: [Name of the Safe, position of the safe, safe zone radius, no-build zone radius] The name of the safezones is just to organize things better, it does not appears on the enter/leave safezone message. BE FILTERS None needed. Edited October 26, 2015 by Donnovan MG-Maximus, Ree, Richie and 1 other 4 Link to comment Share on other sites More sharing options...
Ghostis Posted June 5, 2015 Report Share Posted June 5, 2015 FEATURES FROM HELL SPAWN - COMPATIBLE WITH INFISTAR - COMPATIBLE WITH DZGM - PEOPLE TAGGED AS FRIENDLY OR IN YOUR GROUP (DZGM) CAN ACCESS YOUR GEAR - PEOPLE TAGGED AS FRIENDLY OR IN YOUR GROUP (DZGM) CAN ACCESS YOUR CAR & CAR GEAR - A CAR IS YOURS IF YOU ENTERED THE SAFEZONE DRIVING IT - NO BUILD ZONES ARROUND SAFEZONES INSTALLATION Put the file andre_safezone.sqf in you mission file. Add to your init.sqf the line: execVM "andre_safezone.sqf"; THE SCRIPT Download Link: ... BE FILTERS None. MORE INFO Please ask bellow. ANOTHER SAFEZONE FOR ARMA 2? Yes. This one is better, more optimized and less complicated. Its better than the Andre Safezones for Arma 3 and Gebriel Safezones for Arma 2. THANKYOU Thankyou for the donations, i apreciate. For this one please wait the download link. Where andre_safezone.sqf ?? Link to comment Share on other sites More sharing options...
Donnovan Posted June 5, 2015 Author Report Share Posted June 5, 2015 Updated with the link! Link to comment Share on other sites More sharing options...
AdenGG Posted June 8, 2015 Report Share Posted June 8, 2015 The line you told us to put into the init.sqf is "andre_safezone.sqf" but the file is actually called "andre_safezones.sqf" Donnovan 1 Link to comment Share on other sites More sharing options...
Donnovan Posted June 8, 2015 Author Report Share Posted June 8, 2015 Thankyou AdenGG. Is you using it? Link to comment Share on other sites More sharing options...
AdenGG Posted June 8, 2015 Report Share Posted June 8, 2015 I believe I did everything correctly but there are no safe zones at all, I will try again. Link to comment Share on other sites More sharing options...
Guest Posted June 10, 2015 Report Share Posted June 10, 2015 Instead of creating another SafeZone script with Loops 'n Stuff, that is really unecessary, why not update existing Triggers from the mission.sqm, to safe some Loops and with it safe Ram? Link to comment Share on other sites More sharing options...
Donnovan Posted June 10, 2015 Author Report Share Posted June 10, 2015 NEXT UPDATE Vehicle Crash Protection. WHAT IS THAT? Vehicles from enemies are protected against crash. HOW THIS WILL HELP? Helis, for example, still explode if you crash on it, even with god mode. This update will avoid that. THIS WILL HELP IN ANY OTHER WAY? Yes. The server will have less cases of "X destroyed my Heli full of loot in the safe zone!". ALL VEHICLES ARE PROTECTED? No, just vehicles inside a safezone that is not yours and is not from one of your friends (tagged as friend or in the same DZGM group). Link to comment Share on other sites More sharing options...
pr0dukt Posted June 10, 2015 Report Share Posted June 10, 2015 Why not just update your old safezone script to be compatible with DZGM ? Link to comment Share on other sites More sharing options...
mimmosan Posted June 14, 2015 Report Share Posted June 14, 2015 Thanks works well! Here are the cords for Chernarus; //=============== // CONFIGURATION //=============== //Chernarus Safezones donn_traders = [ ["Stary",[6325.6772,7807.7412,0]], ["Bash",[4063.4226,11664.19,0]], ["Klen",[11447.472,11364.504,0]], ["Bandit Vendor",[1606.6443,7803.5156,0]], ["Hero Vendor",[12944.227,12766.889,0]], ["Airplane Dealer",[5068.6636,9723.4248,0]], ["Wholesaler",[1093.76,2844.97,0]], ["Boat Dealer",[8388.65,2373.57,0]], ["Wholesaler",[13272.7,6096.64,0]], ["Boat Dealer",[13084.4,8253.4,0]] ]; Looking forward to Crash protection. Donnovan 1 Link to comment Share on other sites More sharing options...
NateDaBeast Posted June 18, 2015 Report Share Posted June 18, 2015 In your features you say all good things but you forgot to add god mode in the trader which would actually be nice to add because I don't know if it even has god mode. Link to comment Share on other sites More sharing options...
KraCKzzz Posted June 18, 2015 Report Share Posted June 18, 2015 Works Fantastic thanks man Link to comment Share on other sites More sharing options...
Donnovan Posted June 19, 2015 Author Report Share Posted June 19, 2015 I saw some problems happening on the anti-crash feature because probabily isEngineOn is not returning the correct state of remote vehicles engine. Anyone know a problem about isEngineOn returning incorrect info? Link to comment Share on other sites More sharing options...
Donnovan Posted October 26, 2015 Author Report Share Posted October 26, 2015 I finally fully compreend how event handlers work.This made me possible to make a 100% exact safezone for Arma 2 Epoch.No one really will be able to shot from any vehicle inside the safe.Vehicle god mode is exact as that, it will always be turned for any player to any vehicle (not abandoned vehicles).Protect a player is simple, because the player is allways hosted on the same machine. Vehicles, on the other hand, can be hosted by the server or by any player, an the hoster can change during the game play. This make vehicle protection (god mode and "unable to shot") more complex.All mastered now.It's perfect, with 30 seconds god mode for player that exit the safezone in a vehicle and 60 seconds for the ones on foot. Ajustable if the player goes inside a vehicle or leave his vehicle.It have 1 Monster Plus: No-Build zones.Do you want the better safezone Epoch has ever seen?Fully compatible with infiStar and ultra easy instalation. No BE filters needed. Link to comment Share on other sites More sharing options...
Tang0 Posted October 26, 2015 Report Share Posted October 26, 2015 Gona try this :) Whats the safezone radius 150m? Link to comment Share on other sites More sharing options...
Tang0 Posted October 26, 2015 Report Share Posted October 26, 2015 anyway to clear zombies in the safezones? players can farm them etc , also seems u can destroy your own vehicles Link to comment Share on other sites More sharing options...
Donnovan Posted October 26, 2015 Author Report Share Posted October 26, 2015 Tang0, it's not updated here yet. If you used the one from first post, its a very outdated version. Link to comment Share on other sites More sharing options...
Tang0 Posted October 26, 2015 Report Share Posted October 26, 2015 ok, will wait for the update Donnovan 1 Link to comment Share on other sites More sharing options...
Donnovan Posted October 26, 2015 Author Report Share Posted October 26, 2015 Tang0! Updated! Link to comment Share on other sites More sharing options...
Tang0 Posted October 26, 2015 Report Share Posted October 26, 2015 thnx, does it delete zeds as the players can farm them atm, ie kill them and gain humanity Link to comment Share on other sites More sharing options...
Tang0 Posted October 27, 2015 Report Share Posted October 27, 2015 (edited) have a problem, when a player leaves a safe zone in a mozie, car etc infistar kicks the player from server with zombiecheck changed in Hack Log Edited October 27, 2015 by Tang0 Link to comment Share on other sites More sharing options...
Donnovan Posted October 27, 2015 Author Report Share Posted October 27, 2015 (edited) Tang0, your infiStar is old? Last version? Recent but not last?You know if infiStar is kicking because i made player_zombieCheck = {}?This is why you is asking for zombie deletion?May infiStar is a bit old, and it's working correctly. Edited October 27, 2015 by Donnovan Link to comment Share on other sites More sharing options...
Tang0 Posted October 27, 2015 Report Share Posted October 27, 2015 changed player_zombieCheck = False and it fixed the kick problem thnx One of my players found a problem, if he leaves a vehicle in the safezone and is killed outside somewhere, when he respawns and comes back for the vehicle he can no long get into it (thinks its not his) , i cant get into it either except for a split second where i can tp it out of the zone and he can then enter it , any solution to that problem?Also, even though the zombies do nothing to players in the safezone there can be alot of them there depending on amount of players, would be good if all zeds where deleted in safezone (or tp away as in plotpole script) + if any Ai that enter could be deleted as well (this happens in infistars safezone script) Thnx for the script, i like it alot Link to comment Share on other sites More sharing options...
Donnovan Posted October 27, 2015 Author Report Share Posted October 27, 2015 Players in safezone are in captive mode (player setCaptive true;) so AI will not mess with then.If the player dies, the vehicle is liberated, so if someone enter the vehicle, he will be the new owner of the vehicle.Are you sure no one entered the vehicle before he was able to get back to it? Link to comment Share on other sites More sharing options...
Tang0 Posted October 27, 2015 Report Share Posted October 27, 2015 Yes sure as he had it locked 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