long story short - i created markers for players that join the server which will follow them around the map - i used uid to assign the marker which is created and setmarker text - to the players name
On joining the marker is there and shows in MP.
Problem...
On disconnection i use the same uid to deletemarker - nothing not a thing. even tried mpframe work - couldnt get it to work.
so does anybody know the way to delete such markers
code as follows
activated via [] execVM "marker.sqf"; - tried onplayerconnected [_id,_name] etc - _name comes back as "ANY" - think its the name given to the server. Anyway...
marker.sqf
Code:_caller = name player; _uid = getPlayerUID player; [nil,nil,rHINT, format["%1 connected",_uid]] call RE; if (isserver) then { //also tried createmarkerlocal :( _marker = createMarker [_uid, position player]; _uid setMarkerText _uid; //can change this to _caller - shows players name _uid setMarkerType "NATO_base"; _uid setMarkerColor "ColorRed"; while {!isnull player} do { _uid setmarkerpos getpos player; sleep 5; }; } else { _marker = createMarker [_uid, position player]; _uid setMarkerText _uid; //can change this to _caller - shows players name _uid setMarkerType "NATO_base"; _uid setMarkerColor "ColorRed"; while {!isnull player} do { _uid setmarkerpos getpos player; sleep 5; }; };
following code is called when player disconnects -
defined in the init as ..
onPlayerDisconnected "[_id, _name, _uid] execVM 'removenamedmarkers.sqf';"; - this hints the exact uid (as shown in the their defined marker within game) when someone leaves.
removenamedmarkers.sqf
lobbed as much delete marker stuff in there to see if any work - nope!Code:deletemarkers1 = { deletemarker format ["%1",_named]; deletemarker format ["%1",_idname]; deletemarker _uid; deletemarkerlocal _named; deletemarker _named; deletemarkerlocal _idname; deletemarkerlocal format ["%1",_named]; deletemarkerlocal format ["%1",_idname]; }; _uid = _this select 2; _caller = _this select 1; _named = str(_uid); _idname = _uid; [nil,nil,rHINT, format["%1 disconnecting",_idname]] call RE; [nil,nil,"per",rSPAWN,[], {[] call deletemarkers1}];
So no idea how to get this working - any help would be much appreciated - spent way too long on this
HOME
Reply With Quote

