local ffi = require 'ffi'
ffi.cdef[[
typedef unsigned char BYTE;
typedef struct Vector3D { float x, y, z; } RwV3D;
typedef struct CLumiousPolygon {
RwV3D position;
RwV3D right;
RwV3D top;
RwV3D at;
float distanceToCamera;
BYTE colorID;
BYTE _f35;
BYTE _f36;
BYTE _f37;
} CLumiousPolygon;
]]
local lum_polygons = ffi.cast('CLumiousPolygon*', 0xC7CB58)
local colors = {
[1] = { 0xFF00FF00, "Зелёный" },
[2] = { 0xFFFFFF00, "Жёлтый" },
[3] = { 0xFFFF0000, "Красный" }
}
function main()
if not isSampLoaded() or not isSampfuncsLoaded() then return end
repeat wait(100) until isSampAvailable()
local font = renderCreateFont('Tahoma', 15, 0x5)
while true do wait(0)
if sampIsLocalPlayerSpawned() then
for i = 0, 31 do
if lum_polygons[i] ~= ffi.NULL then
local pos = lum_polygons[i].position
if isPointOnScreen(pos.x, pos.y, pos.z, 300) then
local cx, cy, cz = getCharCoordinates(PLAYER_PED)
local x, y = convert3DCoordsToScreen(pos.x, pos.y, pos.z)
local sx, sy = convert3DCoordsToScreen(cx, cy, cz)
renderDrawLine(sx, sy, x, y, 2, colors[lum_polygons[i].colorID][1])
renderFontDrawText(font, colors[lum_polygons[i].colorID][2], x + 1, y + 4, colors[lum_polygons[i].colorID][1])
end
end
end
end
end
end