Results 1 to 9 of 9

Thread: Vehicle Location Markers

  1. #1

    Question Vehicle Location Markers

    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

    Code:
    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

  2. #2
    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
    Last edited by F2k Sel; Jul 20 2012 at 20:02.

  3. #3

    hustings cerpuer

    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.

  4. #4
    Anyone got a clue?

  5. #5
    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.

  6. #6
    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.

  7. #7
    Master Gunnery Sergeant twirly's Avatar
    Join Date
    Sep 13 2010
    Location
    Gods Own (NZ)
    Posts
    1,302
    Quote Originally Posted by RCO_ACOG View Post

    Code:
            unitList = allUnits;
            j = count unitList;
            i = 0;
                   
                    for "i" from 0 to j do {
    F2k Sel is correct about this..... this cannot work. It will count one too many and cause you grief!

    "Learn by doing!" - Quoted from a post by Imutep

    OUTERRA - OUTERRA - OUTERRA - OUTERRA - BLOWMIND!

  8. #8
    Master Sergeant sxp2high's Avatar
    Join Date
    Jul 16 2009
    Location
    nearestLocation [(getPos player), "nameCity"];
    Posts
    605
    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...

  9. #9
    Quote Originally Posted by sxp2high View Post
    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

Similar Threads

  1. Location of vehicle lockout check
    By fasterthanlight in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 3
    Last Post: Dec 6 2010, 01:43
  2. Make units disembark their vehicle at a very specific location?
    By McNools in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 0
    Last Post: Nov 29 2010, 18:41
  3. Setting random start location for player using markers
    By redmotion in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 4
    Last Post: Jul 5 2010, 11:49
  4. Abnormal location of [0,0,0] pos of vehicle
    By chris330 in forum OFP : MISSION EDITING & SCRIPTING
    Replies: 7
    Last Post: Jan 13 2007, 19:32
  5. vehicle respawn & teammate location prob
    By Lister in forum OFP : MISSION EDITING & SCRIPTING
    Replies: 7
    Last Post: Jun 22 2005, 22:37

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •