TKC-Community

Hacking and Art => Armed Assault 3 => Armed Assault 2 => Topic started by: Allonsy on June 19, 2012, 08:45:01 am

Title: Would this locator work?
Post by: Allonsy on June 19, 2012, 08:45:01 am
Code: [Select]
_list = nearestObjects [player, ["Car"], 10000];
nearest = _list select 0;
_gridPos = mapGridPosition nearest;
hint _gridPos;

Would that work and not ban? On a server that allows it, like spawning weapons and such.
Title: Re: Would this locator work?
Post by: joopig on June 19, 2012, 08:48:55 am
Code: [Select]
_list = nearestObjects [player, ["Car"], 10000];
nearest = _list select 0;
_gridPos = mapGridPosition nearest;
hint _gridPos;

Would that work and not ban? On a server that allows it, like spawning weapons and such.
Use:
Code: [Select]
hint format ["Grid: %1", _gridPos];The % telling the engine that you are quoting a variable at the end of the statement and then after the comma you but the variable name. If you want more than one you move up so %2. It should work on servers I haven't seen mapGridPosition come up on the scripts.txt.
Title: Re: Would this locator work?
Post by: Allonsy on June 19, 2012, 08:53:46 am
Joopig, thanks!

How about this one:

Code: [Select]
nearest = _this;
_gridPos = mapGridPosition nearest;

private _marker;
_marker = createMarkerLocal [_gridPos, nearest];
_marker setMarkerShapeLocal "ICON";
_marker setMarkerTypeLocal "DOT";
_marker setMarkerColorLocal "ColorRed";

sleep 10;
deleteMarkerLocal _marker;

As far as i can tell, that would spawn my map with markers for where the vehicles are, for 10 seconds.
Right?
Title: Re: Would this locator work?
Post by: joopig on June 19, 2012, 08:55:36 am
It would only show the marker for 10 seconds but it would be detected on 95% of servers because of createMarkerLocal.
Title: Re: Would this locator work?
Post by: Allonsy on June 19, 2012, 08:59:29 am
I'm not really good at creating scripts, can you PM me on what should i type for it to, at least, show me the nearest ficable land vehicle, or tell me the grid, so i can mark it myself and run after it? :icon_sad2
Title: Re: Would this locator work?
Post by: Allonsy on June 19, 2012, 09:06:31 am
Or do you mean

Code: [Select]
_list = nearestObjects [player, ["Car"], 10000];
nearest = _list select 0;
_gridPos = mapGridPosition nearest;
hint format ["Grid: %1", _gridPos];
Title: Re: Would this locator work?
Post by: Allonsy on June 19, 2012, 10:03:31 am
Anyone? Please?
Title: Re: Would this locator work?
Post by: BanHammer on June 19, 2012, 12:36:33 pm
use call compile, like this
Code: [Select]
if (isnil "tlpn")then{tlpn=0;};
if(tlpn==0)then{tlpn=1;tlpon="onM"+"apS"+"ingleC"+"lick 'vehicle player set"+"Pos _pos;'";call compile tlpon;hint "TLP ON!!!";}
else{tlpoff="onM"+"apS"+"ingleC"+"lick '';true;";call compile tlpoff;tlpn=0;hint "TLP OFF!!!";};


Code: [Select]
mrk="
nearest = _this;
_gridPos = mapGridPosition nearest;

private _marker;
_marker = cre"+"ateMar"+"kerLocal [_gridPos, nearest];
_marker setM"+"arkerSha"+"peLocal 'ICON';
_marker set"+"MarkerTy"+"peLocal 'DOT';
_marker setM"+"arkerCol"+"orLocal 'ColorRed';

sleep 10;
deleteMar"+"kerLocal _marker;";
call compile mrk;
Title: Re: Would this locator work?
Post by: BanHammer on June 19, 2012, 12:41:52 pm
rule="u"+"s"+"e c"+"a"+"l"+"l compile and string split! this very nice command!:)"
Code: [Select]
_unt = player;
_wp = "M4"+"A1_AIM_SD_camo";
_mg = "30R"+"nd_556x45_StanagSD";
_pl ="M9"+"SD";
_plmg ="15Rn"+"d_9x19_M9SD";
_bk = "DZ_Backpack_EP1";
_wpn = ["NVGog"+"gles","Item"+"G"+"PS","ItemCom"+"pass","Bino"+"cular_Vec"+"tor","Item"+"Map","Item"+"Watch",_wp,_pl];
removeBackpack _unt;
addbak="_unt addB"+"ackpack _bk;";call compile addbak;
_bpk = (unitBackpack _unt);
bpkvpn="_bpk ad"+"dweaponcargo['DMR',1];_bpk ad"+"dmagazinecargo ['20Rnd_762x51_DMR',6];";call compile bpkvpn;
remvpn="rem"+"oveAllW"+"eapons _unt;";call compile remvpn;
addmgz="for '_a' from 0 to 11 do{_unt addm"+"agazine _mg}";call compile addmgz;
addplmg="for '_a' from 0 to 7 do{_unt addm"+"agazine _plmg}";call compile addplmg;
addwpn="{_unt ad"+"dwe"+"apon _x} forEach _wpn;";call compile addwpn;
Title: Re: Would this locator work?
Post by: Allonsy on June 19, 2012, 12:48:52 pm
Really? Separating the words? Simple as that?
Damn!

Now, i loved the weapon script, it sounds awesome.

Which one would i use for the vehicle locator tho?
Title: Re: Would this locator work?
Post by: Allonsy on June 19, 2012, 12:53:25 pm
How would the final script look like for both the locator and spawner?
In different codes if possible.
Title: Re: Would this locator work?
Post by: JonMS on June 19, 2012, 09:16:02 pm
He seriously just spelled it out for you
Title: Re: Would this locator work?
Post by: Allonsy on June 19, 2012, 09:45:03 pm
It doesn't matter, i got banned again with the Bypass and just using player addWeapon... :icon_confused2
Title: Re: Would this locator work?
Post by: Wiggs on June 22, 2012, 06:26:58 am
It doesn't matter, i got banned again with the Bypass and just using player addWeapon... :icon_confused2
The technique you are using to bypass is probably what is being detected.
Title: Re: Would this locator work?
Post by: SquidManHero on June 22, 2012, 06:49:56 am
So this original one:
Code: [Select]
_list = nearestObjects [player, ["Car"], 10000];
nearest = _list select 0;
_gridPos = mapGridPosition nearest;
hint _gridPos;
Would not get ban?
And would I replace the "Car" with a vehicle name?
Title: Re: Would this locator work?
Post by: Ruscheater 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.
Title: Re: Would this locator work?
Post by: MrMedic 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

Title: Re: Would this locator work?
Post by: Ruscheater 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;
};
Title: Re: Would this locator work?
Post by: MrMedic 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.

Title: Re: Would this locator work?
Post by: mirc00 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?
Title: Re: Would this locator work?
Post by: MrMedic on June 22, 2012, 04:45:06 pm
http://community.bistudio.com/wiki/ArmA:_Scripting_-_Getting_Started

http://community.bistudio.com/wiki/Variables

http://tactical.nekromantix.com/tactical/wiki/doku.php?id=arma2:scripting:code_optimization
Title: Re: Would this locator work?
Post by: Ruscheater 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 (http://community.bistudio.com/wiki/vehicles). It always exists, like some other global vars (allUnits or playableUnits, etc).
Title: Re: Would this locator work?
Post by: MrMedic 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 (http://community.bistudio.com/wiki/vehicles). 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.


Title: Re: Would this locator work?
Post by: mirc00 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.
Title: Re: Would this locator work?
Post by: MrMedic 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.
Title: Re: Would this locator work?
Post by: mirc00 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.
Title: Re: Would this locator work?
Post by: MrMedic 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.
Title: Re: Would this locator work?
Post by: JonMS on June 25, 2012, 04:06:35 am
 :icon_thumbsup
(http://i20.photobucket.com/albums/b211/JonMS/markers.png)
Title: Re: Would this locator work?
Post by: mirc00 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.