Jump to content
Sign in to follow this  
hogmason

delet player player markers on player disconect WORKED OUT!!!!

Recommended Posts

Ok so a few months ago i started a post regarding how to delete player markers when the player disconects. This post had a heap of response from other members

and none of us new how this could be achieved any way i was dicking around last night and found an easy way to do this.

Now this has been tested on a dedi and works fine. THis will delete the players marker when he is killed and when he disconects from the server.

in your init place

[player] execVM "player_mkrs_INIT.sqf";

player addEventHandler ["killed", {_this execVM "player_mkrs_INIT.sqf"}];

player_mkrs_INIT.sqf

{
[player] execVM "player_mkrs.sqf";
}
forEach units (group player);


player_mkrs.sqf


_HOG_player_UNITS = _this select 0;
_HOG_player_TEXT = (name _HOG_player_UNITS);
_HOG_player_COLOUR = "ColorGreen";
_HOG_player_TYPE = "mil_triangle";
_HOG_player_SIZE = setMarkerSize [0.5,0.5];
_HOG_player_mkrName = Format ["mkr_%1",random 100000];

       _HOG_player_marker = createMarkerLocal [_HOG_player_mkrName,getPosATL _HOG_player_UNITS];
	_HOG_player_marker setMarkerTypeLocal _HOG_player_TYPE;
	_HOG_player_marker setMarkerColorLocal _HOG_player_COLOUR;
	_HOG_player_marker setMarkerTextLocal _HOG_player_TEXT;
                         _HOG_player_marker setMarkerSizeLocal _HOG_player_SIZE;
	_HOG_player_marker setMarkerDirLocal (direction _HOG_player_UNITS);

         while {alive _HOG_player_UNITS} do 
	     {
	        _HOG_player_marker setMarkerPosLocal getPosATL _HOG_player_UNITS;
	        _HOG_player_marker setMarkerDirLocal (direction _HOG_player_UNITS);
               sleep 0.5;
         };
               deleteMarker _HOG_player_marker;

Hope this helps as i know a few of you guys / gals are looking for a way to do this

any feedback bugs or ideas would be great as i will do a bit of work and more testing and release it as a script in my upcoming script pack

Share this post


Link to post
Share on other sites

The event handler you used is killed, means when he dies, the script will execute, how about "onPlayerDisconnenct"? I think it will work only when he disconnect and not when he dies.

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  

×