someone pm'ed me about making a KOTH script for esp so he could tell the difference between players and enemy's so i figured id give it a shot, heres my first attempt at it so dont expect much but imo its the cleanest way without being to taxing on performance. if someone wants to hook me up with an executor you would get access to whatever i write
result
script
Code:
onEachFrame
{
{
_distance = round (_x distance player);
if (_distance < 801 && _x != player) then
{
_color = [0,0,0,1];
_side = side _x;
switch (_side) do
{
case WEST: {_color = [0,0,1,1]};
case EAST: {_color = [1,0,0,1]};
case INDEPENDENT: {_color = [0,1,0,1]};
case CIVILIAN: {_color = [0.4,0,1,1]};
};
_distance = round (_x distance player);
_posID = _x modelToWorldVisual [0,0,0];
_posBase = eyePos _x;
_posTL1 = [(_posBase select 0) - 0.35, _posBase select 1, (_posBase select 2) - 4.9];
_posBL1 = [(_posBase select 0) - 0.35, _posBase select 1, (_posBase select 2) - 6.5];
_posTR1 = [(_posBase select 0) + 0.35, _posBase select 1, (_posBase select 2) - 4.9];
_posBR1 = [(_posBase select 0) + 0.35, _posBase select 1, (_posBase select 2) - 6.5];
_posTL2 = [_posBase select 0, (_posBase select 1) - 0.35, (_posBase select 2) - 4.9];
_posBL2 = [_posBase select 0, (_posBase select 1) - 0.35, (_posBase select 2) - 6.5];
_posTR2 = [_posBase select 0, (_posBase select 1) + 0.35, (_posBase select 2) - 4.9];
_posBR2 = [_posBase select 0, (_posBase select 1) + 0.35, (_posBase select 2) - 6.5];
if (_distance < 101) then
{
drawIcon3D ["", _color, _posID, 0, 00, 45, format ["%1: %2m", name _x, _distance], 0, 0.023];
} else {drawIcon3D ["", _color, _posID, 0, 00, 45, format ["*%1m",_distance], 0, 0.023]};
drawLine3D [_posTL1, _posTR1, _color];
drawLine3D [_posTL1, _posBL1, _color];
drawLine3D [_posTR1, _posBR1, _color];
drawLine3D [_posBL1, _posBR1, _color];
drawLine3D [_posTL2, _posTR2, _color];
drawLine3D [_posTL2, _posBL2, _color];
drawLine3D [_posTR2, _posBR2, _color];
drawLine3D [_posBL2, _posBR2, _color];
};
} forEach allUnits;
};
this is just a modified version of my group marker script from this video to suite more from a cheaters perspective
map marker result
script
Code:
mapOpen = false;
while {true} do
{
if (visibleMap) then
{
_markers = [];
{
_data = [];
_markName = name _x;
_mrk = createMarkerLocal [_markName, position _x];
_markName setMarkerColorLocal ([side _x, true] call BIS_fnc_sideColor);
_markName setMarkerShapeLocal "ICON";
_markName setMarkerTypeLocal "mil_dot";
_markName setMarkerTextLocal name _x;
_data pushBack _x;
_data pushBack _markName;
_markers pushBack _data;
} forEach allUnits;
while {mapOpen} do
{
if !(visibleMap) then{mapOpen = false;};
{
_marker = _x select 1; _unit = _x select 0;
_marker setMarkerPosLocal position _unit;
_marker setMarkerTextLocal name _x;
} forEach _markers;
sleep 0.01;
};
};
sleep 0.1;
};
edit: also started experimenting with ctrlCreate since im used to using the editor to create dialogs. just tinkering with it and only lists rifles as it was a test to learn but why not
result
script
Code:
disableSerialization;
while{true} do
{
waitUntil{!isNull (findDisplay 602)};
_rifles = [];
selWeapon = "";
_wepList = (findDisplay 602) ctrlCreate ["RscText", -1];
_button = (findDisplay 602) ctrlCreate ["RscButton",-1];
_listBox = (findDisplay 602) ctrlCreate ["RscListBox",1500];
_w = (safeZoneW/6);
_h = (safeZoneH/18);
_x = 0.098 * safezoneW + safezoneX;
_y1 = 0.3 * safezoneH + safezoneY;
_wepList ctrlSetText "Weapon List";
_button ctrlSetText "Get Weapon";
_wepList ctrlSetPosition [_x,_y1+0.2,_w,_h];
_listBox ctrlSetPosition [_x,_y1+0.3,_w,_h + 0.2];
_button ctrlSetPosition [_x,_y1+0.1,_w,_h];
_button ctrlSetBackgroundColor [0,0,0,0.7];
_button ctrlSetTextColor [1,1,1,1];
_button buttonSetAction "if (selWeapon isEqualTo '') then {
hint 'No Weapon Selected';
} else
{
hint format ['%1', selWeapon];
[player, selWeapon, 3, 0] call BIS_fnc_addWeapon;
}";
_button ctrlCommit 0;
_wepList ctrlCommit 0;
_listBox ctrlCommit 0;
_allRifle = "getText (_x >> 'baseWeapon') != 'hgun_PDW2000_F' && getText (_x >> 'cursor') isEqualTo 'arifle' && getNumber (_x >> 'scope') == 2" configClasses (configFile >> "cfgWeapons");
{
_weaponName = configName (_x);
_wepClass = getText (configFile >> "cfgWeapons" >> _weaponName >> "baseWeapon");
if (_wepClass != "") then
{
_rifles pushBackUnique _wepClass;
};
} forEach _allRifle;
{
_wepName = getText (configFile >> "cfgWeapons" >> _x >> "displayname");
lbAdd [1500, _wepName];
lbSetData [1500, _forEachIndex, _x];
} forEach _rifles;
while{!isNull (findDisplay 602)} do
{
_slot = lbCurSel 1500;
selWeapon = lbData [1500, _slot];
if(isNull (findDisplay 602)) exitWith {};
};
};