Jump to content
Sign in to follow this  
AbrahamLincoln

Marker Script Help

Recommended Posts

I have this ''player marker'' script , which works perfectly fine but there's only 1 small problem (atleast I think that) When other player (DISCONECTS) marker stays on map , it just doesnt dissapear ....

When player dies marker dissapears nd when player respawns marker is back on him (this works) so why it's not deleting when player disconects.

I hope this is the right place for my topic.

Thank you for your help advance !

Abe

This goes in init.sqf

deleteMarker _markerobjp;

[] execVM "marker.sqf";

waituntil {(alive player)};

_unit = player;

_nameP = name _unit;

_markerobjp = createMarker [_namep,[0,0]];

_markerobjp setMarkerShape "ICON";

_markerobjp setMarkerType "mil_dot";

_markerobjp setMarkerColor "ColorGreen";

_markerobjp setMarkerText _nameP;

_markerobjp setMarkerSize [1,1];

while {alive _unit} do {

_markerobjp setmarkerdir (getdir _unit);

_markerobjp setMarkerPos (getPos _unit);

_markerobjp setMarkerText _nameP;

sleep 1;

};

deleteMarker _markerobjp;

[] execVM "marker.sqf";

exit;

Share this post


Link to post
Share on other sites

init.sqf

if (isServer) then {
   onPlayerDisconnected 'deleteMarker (str _name)';
};

Not sure if it'll work.

Share this post


Link to post
Share on other sites

_name should be passed as a string so double stringing it may cause it not to work.

Share this post


Link to post
Share on other sites

Thanks for trying cuel but it didn't work , same problem all the time, when ppl dissconects marker stays.

Yesterday after 4-5 hours of playing online, there were like 100+ markers at spawn cuz of my problem ....

Share this post


Link to post
Share on other sites

Not my handy work (apologise to author cant remember)- but try this - should work

init.sqf

TAG_onPlayerDisconnected = compile preprocessFileLineNumbers "removeMapMarkers.sqf";

if (isserver) then
{
  onPlayerDisconnected { _uid call TAG_onPlayerDisconnected; };
}; 

removeMapMarkers.sqf

_disconnected = objnull;
{
  if (getPlayerUID _x == _this) then
  {
     _disconnected = _x;
      _uid = getPlayerUID _x; 
      deletemarker _uid;
      deletemarker _x;
  };
} forEach playableUnits;

Share this post


Link to post
Share on other sites

Yeah it kind a helped me but still only some markers dissapears when ppl dissconects or I kick/ban him.

Some markers still appears on map even ppl is not in server ..... maybe there's problem with my marker script which I posted here ?

nd thanks for trying !

Share this post


Link to post
Share on other sites

nope i get the same - back in 1.60 i think they amended the markers to be visible to all - or something along those lines - after that this script went a bit funny

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  

×