Jump to content
  • 0
Sign in to follow this  
juandayz

Markers in real time

Question

Hi, i need to know how to set up a updated marker every 10 sec or X time...

try whit this but isnt work:

updatemark.sqf

if(isServer) then{
    [] spawn {
        While{not isNull <myunit>; sleep 0.5} do{
            "myunit" setMarkerPos getPos <myunit>;
        };
    };
};

then i call it from init.sqf at very bottom whit:

[] execVM "custom\updatemarker.sqf";

Here is the unit what i need to be marked every time:

Spoiler

_unit_11 = objNull;
if (true) then
{
  _this = _group_2 createUnit ["INS_Bardak_DZ", [2011.6644, 2244.1541, 2.8610229e-006], [], 0, "CAN_COLLIDE"];
  _unit_11 = _this;
  _this setVehicleVarName "myunit";
  myunit = _this;
  _this setUnitAbility 0.60000002;
  if (false) then {_group_2 selectLeader _this;};
};

**another thing.. i need my unit in not allow damage mode...  i try whit allowdamage false;  but isnt work. i guess its no work cuz allowdamage its for use in local. Thers another way¿? any god mode for  units in moves?

 

any idea?

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

well can make this unit inmortal using hanndle damage. 

only needs an updated marker.. if anyone knows.....

here code for inmortal AI:

Spoiler

_unit_5 = objNull;
if (true) then
{
  _this = _group_2 createUnit ["US_Delta_Force_Undercover_Takistani06_EP1", [2012.5223, 2243.354], [], 0, "CAN_COLLIDE"];
  _unit_5 = _this;
  _this setDir 44.482033;
  _this setVehicleVarName "myunit";
  myunit = _this;
  _this addEventHandler ["handleDamage", {false}];
  _this setUnitAbility 0.60000002;
  if (true) then {_group_2 selectLeader _this;};
};

found a way to update marker. tnks anyway

Share this post


Link to post
Share on other sites
  • 0

setVehicleVarName is not Multiplayer syncronized. So you might have a scope issue in there, except from the fact, that you need to make sure  the Server actually loads the file AFTER the Unit and Marker has been created.

So for incidence:

 

juan_unit = _group createUnit [bla,bla,bla,bla];
juan_unit setDir 44.482033;
juan_unit setUnitAbility 0.60;
juan_unit removeAllEventHandlers ["handleDamage"];
juan_unit addEventHandler ["handleDamage", {juan_unit setDamage 0;}];
juan_unit allowDamage false;
_group selectLeader juan_unit;

juan_unit spawn {
	while {alive _this} do {
		"myMarker" setMarkerPos (getPosATL _this);
	};
};

 

Share this post


Link to post
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
Answer this question...

×   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.

Loading...
Sign in to follow this  

  • Advertisement
  • Supporters
  • Discord

×
×
  • Create New...