Jump to content
Sign in to follow this  
Nissen

Vehicle Location Markers

Recommended Posts

So I am trying to set up a domi-insurgency mix gamemode for my clan, and want to give the some admins a script to track all vehicles an option to see all vehicles with an external script execution. I've got everything else planned out but need this type of script. Hopefully modeled after this script that lets my admins and moderators with the script track all the players in our server:

all_players_on_map.sqf

hint "Adding Player Markers";
player addAction["<t color=""#F0C21B"">Players on map</t>", "\RRG\ADMIN\all_players_on_map.sqf", "", 0];
       unitList = allUnits;
       j = count unitList;
       i = 0;
       markPos = true;

       while {markPos} do
       {
       unitList = allUnits;
       j = count unitList;
       i = 0;

               for "i" from 0 to j do
               {
                       unit = unitList select i;
                       pos = position unit;
                       deleteMarkerLocal ("playerMarker"+ (str i));
                       marker = "playerMarker" + (str i);
                       marker = createMarkerLocal [marker,pos];
                       marker setMarkerTypeLocal "dot";
                       marker setMarkerPosLocal (pos);
                       marker setMarkerColorLocal("ColorBlack");
                       marker setMarkerTextLocal format ["%1",name unit];
               };
               sleep 0.5;
       };

Thanks for your help, I'm stumped and the heads want me to dev this for them ;)

Share this post


Link to post
Share on other sites

I think your counting too many units.

if there are 4 players j = count unitList; returns 4 but for "i" from 0 to j do counts 5 even though it only reaches 4 as it includes 0, if that makes any sense.

Try for "i" from 0 to j-1 do

Edited by F2k Sel

Share this post


Link to post
Share on other sites

Im not asking for help on the players on map sript: its fine and works... I am asking if anyone can help create a script for displaying all vehicles on map, empty or not.

Share this post


Link to post
Share on other sites

Make a cycle of walking through all vehicles, delete old marker (store marker name\id\number with setVariable), add new local marker. Something like that.

Share this post


Link to post
Share on other sites

If the above works for you then a small change is all that should be needed.

you could try replacing unitList = allUnits; with unitlist = [0,0,0] nearEntities ["allvehicles",8000] ;

size will depend on the map, [0,0,0] should be the centre.

also if you use this marker setMarkerTextLocal format ["%1 %2",name unit,typeof unit];

it will also give the type of vehicle, you may want to use a switch case to check the side of the unit and change the colour of the marker.

I don't know why you set unitlist and j=count twice, once is enough inside the while only.

They've also added some new commands or improved entities making it quicker but I can't remember if it will help this situation.

Share this post


Link to post
Share on other sites


       unitList = allUnits;
       j = count unitList;
       i = 0;

               [color="#FF0000"]for "i" from 0 to j do {[/color]

F2k Sel is correct about this..... this cannot work. It will count one too many and cause you grief!

Share this post


Link to post
Share on other sites

Obvious DayZ cheater.

The vehicle marker code is on the same cheater forums where you got this from.

I banned soo many people for using that exact same code...

Share this post


Link to post
Share on other sites
Obvious DayZ cheater.

The vehicle marker code is on the same cheater forums where you got this from.

I banned soo many people for using that exact same code...

Ohh, give the guy a break if he wants to make it for his own server then he sh---ALLL GLORY TO THE HYPNOTOAD :eek:

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  

×