Jump to content

Auto Safezones v2 - v4.4 > v5.0


Drunken Cheetah
 Share

Recommended Posts

Before we begin, this has been made for and tested on the latest release for AsYetUntitled. 

 

Description: 
Automatically creates a safezone, based on empty markers. (You can use locations also, just change it in the script.); This version allows it to change every X minutes based on your adjusted settings.

 

THIS SCRIPT UTILIZES THE LIFE_SERVER FOLDER. BEFORE CONTINUING MAKE SURE TO MAKE A BACKUP, I AM NOT RESPONSIBLE FOR ANY MISTAKES MADE.

Create a new folder in your life_server folder called Scripts. Place it in life_server >> Functions >> Scripts
After that, create a new document called fn_safezoneAuto.sqf 

Inside that add the following;
 

https://gyazo.com/5b3639948e99dc664b3f437cb0fd6c5b

Save that file, and head over to life_server >> config.cpp add the following in TON_systems

 

class missions {
			file = "\life_server\Functions\Scripts";
			class safezoneAuto {};			
		};

 

save that file, and head to life_server >> init.sqf and add the following after: 

life_wanted_list = [];

 

>> 

 

[] execVM "\life_server\Functions\Scripts\fn_safezoneAuto.sqf";

Save that file, and repack your life_server PBO.

Head over to your mission file, and open up the config >> config_master.hpp; add the following 

 

//Safezones by Drunken Cheetah
		use_autosafezone = true; 		//Enable or Disable Safezones
		timer_safezones = true; 		//Timer Safezones means every X amount of minutes, the safezone will change. 'use_autosafezone' must be true if this line is true.
		time_to_change = 30; 			// In minutes. e.g: 30 = 30 minutes
		size_of_zone = 450;				//450x450

 

save that file and edit your mission.sqm

In your desired locations for the safezones place empty markers, call them

safe_kavala, safe_zaros, safe_pyrgos, safe_athira, safe_sofia

 

If you dont wish to use empty markers, get locations. Once you've got your locations, simply edit the fn_safezoneAuto.sqf file at line 10.

 

Thats all there is to it. Make sure you save all files, and start your server. Since this script is a server sided script, it will run when you start it.

  • Like 1
Link to comment
Share on other sites

  • 4 weeks later...
  • 1 month later...

 

#include "\life_server\script_macros.hpp"
private ["_safe","_zone",_timeCheck","_turnOn",_timer","_size"];
_turnOn = if(!(LIFE_SETTINGS(getNumber,"use_autosafezone")isEqualTo 1)) exitWith {};
_safe = (getMarkerPos(selectRandom["safe_kavala",safe_zaros","safe_pyrgos","safe_athira","safe_sofia"]));
_timer = (LIFE_SETTINGS(getNumber, "time_to_change"));
_size = (LIFE_SETTINGS(getNumber,"size_of_zone"));

_timeCheck = if (!(LIFE_SETTINGS(getNumber, "timer_safezones") isEqualTo 1)) then {
 _markZone = createMarker["safeZone", _safe];
    "safeZone" setMarkerColor "ColorGreen";
    "safeZone" setMarkerType "Empty";
    "safeZone" setMarkerShape "ELLIPSE";
    "safeZone" setMarkerBrush "DIAGGRID";
    "safeZone" setMarkerSize [_size,_size];
    "safeZone" setMarkerDir 0;
}else{
    _markZone = createMarker["safeZone",_safe];
    "safeZone" setMarkerColor "ColorGreen";
    "safeZone" setMarkerType "Empty";
    "safeZone" setMarkerShape "ELLIPSE";
    "safeZone" setMarkerBrush "DIAGGRID";
    "safeZone" setMarkerSize [_size,_size];
    "safeZone" setMarkerDir 0;

    sleep (_timer * 60);
    deleteMarker "safeZone";
    [] spawn TON_fnc_safezoneAuto;
};

*****************************************************************
in init.sqf
/* Miscellaneous mission-required stuff */
life_wanted_list = [];
[] execVM "\life_server\Functions\Scripts\fn_safezoneAuto.sqf";

***************************************************************
Not Work ...

 

 

 

Link to comment
Share on other sites

11 hours ago, chisfroome said:

 

#include "\life_server\script_macros.hpp"
private ["_safe","_zone",_timeCheck","_turnOn",_timer","_size"];
_turnOn = if(!(LIFE_SETTINGS(getNumber,"use_autosafezone")isEqualTo 1)) exitWith {};
_safe = (getMarkerPos(selectRandom["safe_kavala",safe_zaros","safe_pyrgos","safe_athira","safe_sofia"]));
_timer = (LIFE_SETTINGS(getNumber, "time_to_change"));
_size = (LIFE_SETTINGS(getNumber,"size_of_zone"));

_timeCheck = if (!(LIFE_SETTINGS(getNumber, "timer_safezones") isEqualTo 1)) then {
 _markZone = createMarker["safeZone", _safe];
    "safeZone" setMarkerColor "ColorGreen";
    "safeZone" setMarkerType "Empty";
    "safeZone" setMarkerShape "ELLIPSE";
    "safeZone" setMarkerBrush "DIAGGRID";
    "safeZone" setMarkerSize [_size,_size];
    "safeZone" setMarkerDir 0;
}else{
    _markZone = createMarker["safeZone",_safe];
    "safeZone" setMarkerColor "ColorGreen";
    "safeZone" setMarkerType "Empty";
    "safeZone" setMarkerShape "ELLIPSE";
    "safeZone" setMarkerBrush "DIAGGRID";
    "safeZone" setMarkerSize [_size,_size];
    "safeZone" setMarkerDir 0;

    sleep (_timer * 60);
    deleteMarker "safeZone";
    [] spawn TON_fnc_safezoneAuto;
};

*****************************************************************
in init.sqf
/* Miscellaneous mission-required stuff */
life_wanted_list = [];
[] execVM "\life_server\Functions\Scripts\fn_safezoneAuto.sqf";

***************************************************************
Not Work ...

 

 

 

"Not Work" - Does not help me in anyway shape or form. Please elaborate, what isn't working?

Link to comment
Share on other sites

  • 7 months later...
On 2/9/2021 at 4:22 AM, chisfroome said:

 

#include "\life_server\script_macros.hpp"
private ["_safe","_zone",_timeCheck","_turnOn",_timer","_size"];
_turnOn = if(!(LIFE_SETTINGS(getNumber,"use_autosafezone")isEqualTo 1)) exitWith {};
_safe = (getMarkerPos(selectRandom["safe_kavala",safe_zaros","safe_pyrgos","safe_athira","safe_sofia"]));
_timer = (LIFE_SETTINGS(getNumber, "time_to_change"));
_size = (LIFE_SETTINGS(getNumber,"size_of_zone"));

_timeCheck = if (!(LIFE_SETTINGS(getNumber, "timer_safezones") isEqualTo 1)) then {
 _markZone = createMarker["safeZone", _safe];
    "safeZone" setMarkerColor "ColorGreen";
    "safeZone" setMarkerType "Empty";
    "safeZone" setMarkerShape "ELLIPSE";
    "safeZone" setMarkerBrush "DIAGGRID";
    "safeZone" setMarkerSize [_size,_size];
    "safeZone" setMarkerDir 0;
}else{
    _markZone = createMarker["safeZone",_safe];
    "safeZone" setMarkerColor "ColorGreen";
    "safeZone" setMarkerType "Empty";
    "safeZone" setMarkerShape "ELLIPSE";
    "safeZone" setMarkerBrush "DIAGGRID";
    "safeZone" setMarkerSize [_size,_size];
    "safeZone" setMarkerDir 0;

    sleep (_timer * 60);
    deleteMarker "safeZone";
    [] spawn TON_fnc_safezoneAuto;
};

*****************************************************************
in init.sqf
/* Miscellaneous mission-required stuff */
life_wanted_list = [];
[] execVM "\life_server\Functions\Scripts\fn_safezoneAuto.sqf";

***************************************************************
Not Work ...

 

 

 

 

#include "\life_server\script_macros.hpp"
/*
    File Name: fn_safezoneAuto.sqf
	Author: Drunken Cheetah  
	Desc: Creates Auto Safezones
*/
private ["_safe","_zone","_timeCheck","_turnOn","_timer","_size"];
_turnOn = if(!(LIFE_SETTINGS(getNumber,"use_autosafezone")isEqualTo 1)) exitWith {};
_safe = (getMarkerPos(selectRandom["safe_kavala","safe_zaros","safe_pyrgos","safe_athira","safe_sofia"]));
_timer = (LIFE_SETTINGS(getNumber, "time_to_change"));
_size = (LIFE_SETTINGS(getNumber,"size_of_zone"));

_timeCheck = if(!(LIFE_SETTINGS(getNumber, "timer_safezones") isEqualTo 1)) then {
 _markZone = createMarker["safeZone",_safe];
    "safeZone" setMarkerColor "ColorGreen";
    "safeZone" setMarkerType "Empty";
    "safeZone" setMarkerShape "ELLIPSE";
    "safeZone" setMarkerBrush "DIAGGRID";
    "safeZone" setMarkerSize [_size,_size];
    "safeZone" setMarkerDir 0;
}else{
    _markZone = createMarker["safeZone",_safe];
    "safeZone" setMarkerColor "ColorGreen";
    "safeZone" setMarkerType "Empty";
    "safeZone" setMarkerShape "ELLIPSE";
    "safeZone" setMarkerBrush "DIAGGRID";
    "safeZone" setMarkerSize [_size,_size];
    "safeZone" setMarkerDir 0;

    sleep (_timer * 60);
    deleteMarker "safeZone";
    [] spawn TON_fnc_safezoneAuto;
};

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.