TKC-Community
Hacking and Art => Armed Assault 3 => Armed Assault 2 => Topic started by: Allonsy on June 19, 2012, 08:45:01 am
-
_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.
-
_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:
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.
-
Joopig, thanks!
How about this one:
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?
-
It would only show the marker for 10 seconds but it would be detected on 95% of servers because of createMarkerLocal.
-
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
-
Or do you mean
_list = nearestObjects [player, ["Car"], 10000];
nearest = _list select 0;
_gridPos = mapGridPosition nearest;
hint format ["Grid: %1", _gridPos];
-
Anyone? Please?
-
use call compile, like this
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!!!";};
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;
-
rule="u"+"s"+"e c"+"a"+"l"+"l compile and string split! this very nice command!:)"
_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;
-
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?
-
How would the final script look like for both the locator and spawner?
In different codes if possible.
-
He seriously just spelled it out for you
-
It doesn't matter, i got banned again with the Bypass and just using player addWeapon... :icon_confused2
-
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.
-
So this original one:
_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?
-
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;
};
[] 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.
-
_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
-
_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.
while {showVehicles} do
{
{
// update markers here
} forEach vehicles;
sleep 0.1;
};
-
_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.
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.
-
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?
-
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
-
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).
-
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.
-
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.
-
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.
-
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.
-
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.
-
:icon_thumbsup
(http://i20.photobucket.com/albums/b211/JonMS/markers.png)
-
@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.