Jump to content

[RELEASE] WAI Addon: Need certain Weapon/Item to see Marker


Guest

Recommended Posts

What this does:

i wrote a little script for my server which shows the Mission Map Markers only to players who have a ItemRadio in their inventory! Of course you could also change that Item to something different!

I have also modified the Missions itself so that there are no global Messages anymore. On my Server you get reminded every X minutes per systemChat that a mission is running, but only if you have the Radio in inventory.

 

What you need to do:

Open the dayz_server\WAI\missions\compile\markers.sqf and replace its content with:

//WAI MissionMarker Addon by *hs-s.com | waTTe - www.banditparty.de
if(!isServer) exitWith {};
private ["_position","_name","_units"];
_position = _this select 0;
_name = _this select 1;
_units = [];
WAIMissionMarker = [_position, _name];
while{missionrunning} do {
{
_units = [];
   if ((side _x) == West) then {  
		if("ItemRadio" in weapons _x) then { //Change Item/Weapon here use 'in magazines' if the item is no tool or weapon 
			_units set [count _units, _x];
		};
   };
} forEach allUnits;
{
 (owner _x) publicVariableClient "WAIMissionMarker" 
} foreach _units;
markerready = true;
uiSleep 120; //Change time here (in seconds) but dont make it too big or the script wont check for new players with the Item in inventory
};
//diag_log(format["WAI MISSION: %1 started at %2!",_name,_position]); // This was only for testing

Now create a missionmarker.sqf in your MissionFile/Custom/ folder and paste this:

//WAI MissionMarker Addon by *hs-s.com | waTTe - www.banditparty.de	
private["_position","_name","_text","_Marker","_dot"];
_position = _this select 0;
	_name = _this select 1;
	//diag_log(format["Position: %1 Name: %2",_position, _name]);
	_text = format["%1 Mission active - Check your Map for the location",_name];
	systemChat _text;
			_Marker = createMarkerLocal ["Mission", _position];
			_Marker setMarkerColorLocal "ColorRed";
			_Marker setMarkerShapeLocal "ELLIPSE";
			_Marker setMarkerBrushLocal "Solid";
			_Marker setMarkerSizeLocal [300,300];
			_Marker setMarkerTextLocal _name;
			_dot = createMarkerLocal ["dot", _position];
			_dot setMarkerColorLocal "ColorBlack";
			_dot setMarkerTypeLocal "mil_dot";
			_dot setMarkerTextLocal _name;
			uiSleep 120; //Change time here again - makes sure that the Marker gets reset every 2 minutes, if you put the Weapon/Item down, the Marker will be removed after max. x seconds
			deleteMarkerLocal _Marker;
			deleteMarkerLocal _dot;

Third and last step, open your MissionFile init.sqf and insert in the "if (!isDedicated) then {" Area

"WAIMissionMarker" addPublicVariableEventHandler { WAIMissionMarker execVM 'Custom\missionmarker.sqf'; };

Done - hf

Link to comment
Share on other sites

  • 4 weeks later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...