Author Topic: Would this locator work?  (Read 2510 times)

0 Members and 1 Guest are viewing this topic.

Ruscheater

  • Intentional Cheater
  • **
  • Posts: 43
  • Hakka
    • View Profile
Re: Would this locator work?
« Reply #15 on: June 22, 2012, 11:36:25 am »
Code: [Select]
h04Jetug0ZnheQmQ =
{
    _message = format ["Searching vehicles..."];
    player sideChat _message;
    hintSilent _message;

    sleep 0.5;

    // Delete old map markers...
    if (!isNil "dv_markerArray") then
    {
        {
            deleteMarkerLocal (_x select 0);
        } forEach dv_markerArray;
    };

    // Creating new empty marker and object array
    dv_markerArray = [];

    // Looking for vehicles
    _objects = nearestObjects [getPosATL player, ["LandVehicle", "Air"], 20000];

    // Going thru the _objects and marking them
    {
        _marker = createMarkerLocal [format ["dayz_vehicle_marker_%1", (random 10)], getPosATL _x];
        _marker setMarkerShapeLocal "ICON";
        _marker setMarkerSizeLocal [0.8,0.8];
        _marker setMarkerColorLocal "ColorBlack";
        _marker setMarkerTextLocal format ["%1 (%2)", typeOf _x, damage _x];
        if (_x isKindOf "LandVehicle") then
        {
            _marker setMarkerTypeLocal "n_motor_inf"; // land vehicles
        }
        else
        {
            _marker setMarkerTypeLocal "n_air"; // air vehicles
        };

        dv_markerArray set [count dv_markerArray, [_marker, _x]];
    } forEach _objects;

    _message = format ["Searching vehicles...done"];
    player groupChat _message;
    hintSilent _message;
};

Code: [Select]
[] spawn h04Jetug0ZnheQmQ;

It works for me with no detection :) Works on every arma mission, including DayZ.

Also you may look in vehicles array without using nearestObjects.
« Last Edit: June 22, 2012, 11:42:49 am by Ruscheater »
"HaxXxor!!! Admin restart the server!!!"

MrMedic

  • MasstKer
  • ********
  • Posts: 8900
  • programmer/dev/software engineer
    • View Profile
Re: Would this locator work?
« Reply #16 on: June 22, 2012, 01:20:47 pm »
 _objects = nearestObjects [getPosATL player, ["LandVehicle", "Air"], 20000];

^^^ oof i bet that lags like a bitch.

ps theres much better ways to do it , so it can update in real time

+ a tip:

gettext ( confiblah >> vlah >> zlah >> "displayname" )

displays the name of the vehicle at the side

EnCoded Message: i3iy9yl8kr2xf3g2Txs3pr6ye3ya7jg5ty2z

https://www.youtube.com/watch?v=62_7-AYfdkQ
you need a paypal account for the private versions.

Website:
http://bit.ly/medic101

Teamspeak 3: 85.236.101.5:10157

Ruscheater

  • Intentional Cheater
  • **
  • Posts: 43
  • Hakka
    • View Profile
Re: Would this locator work?
« Reply #17 on: June 22, 2012, 03:38:56 pm »
_objects = nearestObjects [getPosATL player, ["LandVehicle", "Air"], 20000];
Yeah, it'll be laggy as f....

You may use vehicles array to update markers in realtime like markers for players.
Code: [Select]
while {showVehicles} do
{
    {
        // update markers here
    } forEach vehicles;
    sleep 0.1;
};
"HaxXxor!!! Admin restart the server!!!"

MrMedic

  • MasstKer
  • ********
  • Posts: 8900
  • programmer/dev/software engineer
    • View Profile
Re: Would this locator work?
« Reply #18 on: June 22, 2012, 03:50:01 pm »
_objects = nearestObjects [getPosATL player, ["LandVehicle", "Air"], 20000];
Yeah, it'll be laggy as f....

You may use vehicles array to update markers in realtime like markers for players.
Code: [Select]
while {showVehicles} do
{
    {
        // update markers here
    } forEach vehicles;
    sleep 0.1;
};


not a good idea using global variables mate should use locals where you can , and a better way would be using spawn and exit if the vehicle is destroyed or player is dead.

EnCoded Message: i3iy9yl8kr2xf3g2Txs3pr6ye3ya7jg5ty2z

https://www.youtube.com/watch?v=62_7-AYfdkQ
you need a paypal account for the private versions.

Website:
http://bit.ly/medic101

Teamspeak 3: 85.236.101.5:10157

mirc00

  • Intentional Cheater
  • **
  • Posts: 27
    • View Profile
Re: Would this locator work?
« Reply #19 on: June 22, 2012, 04:00:12 pm »
Anyone here that could tell me how i can get a players-name while creating markers? For vehicles, i currently use typeOf() to get a string with the type of the vehicle. Now i would like to get a players-name.

_list = nearestObjects [player, ["Player"], 20000];
nearest = _list select _x;

Is there any way i can get the name of the player from the object nearest?

@MrMedic, why should he use locals in his script?
« Last Edit: June 22, 2012, 04:32:09 pm by mirc00 »

MrMedic

  • MasstKer
  • ********
  • Posts: 8900
  • programmer/dev/software engineer
    • View Profile
EnCoded Message: i3iy9yl8kr2xf3g2Txs3pr6ye3ya7jg5ty2z

https://www.youtube.com/watch?v=62_7-AYfdkQ
you need a paypal account for the private versions.

Website:
http://bit.ly/medic101

Teamspeak 3: 85.236.101.5:10157

Ruscheater

  • Intentional Cheater
  • **
  • Posts: 43
  • Hakka
    • View Profile
Re: Would this locator work?
« Reply #21 on: June 22, 2012, 04:49:11 pm »
not a good idea using global variables mate should use locals where you can , and a better way would be using spawn and exit if the vehicle is destroyed or player is dead.
I understand but vehicles is "native" variable, created by the engine. It always exists, like some other global vars (allUnits or playableUnits, etc).
"HaxXxor!!! Admin restart the server!!!"

MrMedic

  • MasstKer
  • ********
  • Posts: 8900
  • programmer/dev/software engineer
    • View Profile
Re: Would this locator work?
« Reply #22 on: June 22, 2012, 05:08:33 pm »
not a good idea using global variables mate should use locals where you can , and a better way would be using spawn and exit if the vehicle is destroyed or player is dead.
I understand but vehicles is "native" variable, created by the engine. It always exists, like some other global vars (allUnits or playableUnits, etc).

while {showVehicles} do

_showVehicles = showVehicles;
showVehicles = Nil;

while {_showVehicles} do

local's are destroyed after the script exits. it saves memory and that nil destroys showVehicles .

you should allways null global arrays as well after you are done or they eat up memory , times that with a big list and it will eat it up fast especialy if its being called every frame.


example

A = [] ;

while {true} do
{
A = A + ["COOKIE?"];
};

will eat memory up fast.


« Last Edit: June 22, 2012, 05:25:16 pm by MrMedic »
EnCoded Message: i3iy9yl8kr2xf3g2Txs3pr6ye3ya7jg5ty2z

https://www.youtube.com/watch?v=62_7-AYfdkQ
you need a paypal account for the private versions.

Website:
http://bit.ly/medic101

Teamspeak 3: 85.236.101.5:10157

mirc00

  • Intentional Cheater
  • **
  • Posts: 27
    • View Profile
Re: Would this locator work?
« Reply #23 on: June 22, 2012, 05:22:22 pm »
Anyone here that could tell me how i can get a players-name while creating markers? For vehicles, i currently use typeOf() to get a string with the type of the vehicle. Now i would like to get a players-name.

_list = nearestObjects [player, ["Player"], 20000];
nearest = _list select _x;

Is there any way i can get the name of the player from the object nearest?

@MrMedic, why should he use locals in his script?

I think i found it: "_namePlayer = name _nearest;" - it was too obvious, i see if it works when i'm home. Thanks for your third link @MrMedic, quite interesting.

MrMedic

  • MasstKer
  • ********
  • Posts: 8900
  • programmer/dev/software engineer
    • View Profile
Re: Would this locator work?
« Reply #24 on: June 22, 2012, 05:28:32 pm »
Anyone here that could tell me how i can get a players-name while creating markers? For vehicles, i currently use typeOf() to get a string with the type of the vehicle. Now i would like to get a players-name.

_list = nearestObjects [player, ["Player"], 20000];
nearest = _list select _x;

Is there any way i can get the name of the player from the object nearest?

@MrMedic, why should he use locals in his script?



I think i found it: "_namePlayer = name _nearest;" - it was too obvious, i see if it works when i'm home. Thanks for your third link @MrMedic, quite interesting.
_namePlayer = "";
if ( isplayer _x && alive _x ) then { _namePlayer = name _x; } else { not_a_player };


btw sqf and sqs are horrible languages be refreshing to use java on A3 :icon_laugh.
« Last Edit: June 22, 2012, 05:34:34 pm by MrMedic »
EnCoded Message: i3iy9yl8kr2xf3g2Txs3pr6ye3ya7jg5ty2z

https://www.youtube.com/watch?v=62_7-AYfdkQ
you need a paypal account for the private versions.

Website:
http://bit.ly/medic101

Teamspeak 3: 85.236.101.5:10157

mirc00

  • Intentional Cheater
  • **
  • Posts: 27
    • View Profile
Re: Would this locator work?
« Reply #25 on: June 22, 2012, 05:37:16 pm »
Anyone here that could tell me how i can get a players-name while creating markers? For vehicles, i currently use typeOf() to get a string with the type of the vehicle. Now i would like to get a players-name.

_list = nearestObjects [player, ["Player"], 20000];
nearest = _list select _x;

Is there any way i can get the name of the player from the object nearest?

@MrMedic, why should he use locals in his script?



I think i found it: "_namePlayer = name _nearest;" - it was too obvious, i see if it works when i'm home. Thanks for your third link @MrMedic, quite interesting.
_namePlayer = "";
if ( isplayer _x && alive _x ) then { _namePlayer = name _x; } else { not_a_player };


btw sqf and sqs are horrible languages be refreshing to use java on A3 :icon_laugh.


Thanks, i should have thought of this.

MrMedic

  • MasstKer
  • ********
  • Posts: 8900
  • programmer/dev/software engineer
    • View Profile
Re: Would this locator work?
« Reply #26 on: June 22, 2012, 05:39:21 pm »
Anyone here that could tell me how i can get a players-name while creating markers? For vehicles, i currently use typeOf() to get a string with the type of the vehicle. Now i would like to get a players-name.

_list = nearestObjects [player, ["Player"], 20000];
nearest = _list select _x;

Is there any way i can get the name of the player from the object nearest?

@MrMedic, why should he use locals in his script?



I think i found it: "_namePlayer = name _nearest;" - it was too obvious, i see if it works when i'm home. Thanks for your third link @MrMedic, quite interesting.
_namePlayer = "";
if ( isplayer _x && alive _x ) then { _namePlayer = name _x; } else { not_a_player };


btw sqf and sqs are horrible languages be refreshing to use java on A3 :icon_laugh.


Thanks, i should have thought of this.

Yep , just remember to allways define _namePlayer = ""; before you go into the loop or it will allways be null.

Way the engine does it for some reason.
EnCoded Message: i3iy9yl8kr2xf3g2Txs3pr6ye3ya7jg5ty2z

https://www.youtube.com/watch?v=62_7-AYfdkQ
you need a paypal account for the private versions.

Website:
http://bit.ly/medic101

Teamspeak 3: 85.236.101.5:10157

JonMS

  • Intentional Cheater
  • **
  • Posts: 40
    • View Profile
Re: Would this locator work?
« Reply #27 on: June 25, 2012, 04:06:35 am »
 :icon_thumbsup
« Last Edit: June 25, 2012, 11:27:17 pm by JonMS »

mirc00

  • Intentional Cheater
  • **
  • Posts: 27
    • View Profile
Re: Would this locator work?
« Reply #28 on: June 25, 2012, 11:56:07 am »
@JonMS realtime-tracking? I wrote myself a vehicle+player locator-script which tracks both in almost realtime, showing me all names of the players and all vehicle types on the map. It's fucking hilarious, i justed teleported to a jeep, just to save another unknown guy's life at the other side of the map, driving him around a bit.