Jump to content
Sign in to follow this  
f2k sel

Marker problem on dedicated server

Recommended Posts

I've been trying to help some guys with a small program, it all works a part from a maker issue.

In the editor I have a marker and you can rotate it to set the direction of moved vehicles.

In single player this works but when run on a dedicated server the direction isn't reset.

part of script.

// null=[trigname,"marker1",5] execvm "clear.sqf"
_clear = _this select 0;// trigger name
_carpark = _this select 1;// marker name for car placement
_delay = _this select 2;// delay before removal 

while {true} do {

_vehicles = [];

sleep _delay;// time before empty vehicle is removed

_vehicles = entities "landvehicle"; 

{
  if ( _x iskindOf "landvehicle" and count crew _x == 0) then {
   sleep 0.1;
      if ( [_clear, getpos _x] call BIS_fnc_inTrigger) then {
        _position = getmarkerpos _carpark findEmptyPosition [ 1 , 100 ,typeof _x];
          _x setpos  _position;
           _x setdir markerdir _carpark;// only works in single player
         };};

} foreach _vehicles
};

I don't do mp scripting so can't test myself, but does anyone have a clue about this?

Thanks Sel.

Share this post


Link to post
Share on other sites

youll have to use add public event handler and have it for both local player and the server - how i use JIP markers

Share this post


Link to post
Share on other sites

Thanks but after reading it makes no sense to me as I don't do any MP, if if they really want it they can sort it out themselves.

Share this post


Link to post
Share on other sites

creating the marker

if (isServer) then 
			{

			_marker = createMarker [_markname, position _preplacedmkr];
			"terrorHelpers" setMarkerShape "ELLIPSE";
			"terrorHelpers" setMarkerType "DOT";
			"terrorHelpers" setMarkerSize [150, 150];
			"terrorHelpers" setMarkerColor "ColorRed";			
			} 		
				else 
				{			

				objmkr = [_markname, _preplacedmkr]; publicVariable "objmkr";			
				};

init

if (isServer) then 
{
"objmkr" addPublicVariableEventHandler 
{
	_marker = createMarker [((_this select 1) select 0), position ((_this select 1) select 1)];
	"terrorHelpers" setMarkerShape "ELLIPSE";
	"terrorHelpers" setMarkerType "DOT";
	"terrorHelpers" setMarkerSize [150, 150];
	"terrorHelpers" setMarkerColor "ColorRed";
};
};

Share this post


Link to post
Share on other sites

I must be having a really thick day but I still don't get what creating markers has to do with getting the direction of a pre placed marker in MP.

Share this post


Link to post
Share on other sites

ah ok, the marker needs to be moved either locally for the player, or for both server and local player (from what i can tell).

i had problems with JIP and MP getting a marker to show up on both. Then i had issues getting it to follow a moving unit. SO by making sure the same marker was created on all connected clients/and server- it seemed to work. worth a try :) if not when i get a chance i can look for you.

probably not explained that very well lol.

Share this post


Link to post
Share on other sites

Cheers, I'll give them a few things to try and see what happens.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×