Jump to content
Sign in to follow this  
zanlow

Marker follow next available group leader ?

Recommended Posts

Hey there,

I have been trying to attach a marker to a specific unit on the map. The init.sqf contains this code

[] spawn {
 while {not isnull Unit1} do { "mkr_unit1" setmarkerpos getpos Unit1; sleep 0.5; };
};

A unit is named "Unit1" and the marker that is following the unit is named "mkr_unit1"

The problem I am trying to solve is this, if the unit is the leader of a group and the unit is killed, the marker stays where the unit was killed at. I am trying to find a way to have the marker switch itself onto the person who becomes the next leader of the group once the original leader dies.

Could anyone steer me in the right direction towards a possible answer to this problem ?

Share this post


Link to post
Share on other sites

I'm not sure if it will work but try this

in squad leader's init:

mygroup = group this; 

then in your init.sqf instead of unit1

leader mygroup

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  

×