powiem wprost pr?buje napisa? autorski radar znajduj?cy si? w prawym g?rnym rogu ekranu. Niestety blipy nie chc? si? tworzy?, by? mo?e ja co? namiesza?em w kodzie wi?c prosz? o pomoc osoby lepsze w LUA odemnie.
kod blip?w:
[lua]
for i,b in pairs(getElementsByType('blip')) do
local bX, bY, bZ = getElementPosition(b);
local pX, pY, pZ = getElementPosition(localPlayer);
local _, _, crZ = getElementRotation(getCamera());
local dist = getDistanceBetweenPoints3D(bX, bY, bZ, pX, pY, pZ);
local maxdist = getBlipVisibleDistance(b);
if (dist <= maxdist and getElementDimension(localPlayer) == getElementDimension(b) and getElementInterior(b) == getElementInterior(getCamera())) then
local radius = dist/zoom;
local direction = math.atan2(bX - pX, bY - pY) + math.rad(crZ);
local blipX = w + math.sin(direction) * radius;
local blipY = h + math.sin(direction) * radius;
blipX = math.max(0, math.min(blipX, w));
blipY = math.max(0, math.min(blipY, h));
local path = ':radar/files/map_blips/radarBlip_'..getBlipIcon(b)..'.png';
if (path) then
local color = tocolor(getBlipColor(b));
local size = tonumber(getBlipSize(b));
dxDrawImage(x + blipX - size/2, y + blipY - size/2, size, size, path, 0, 0, 0, color);
... |