function renderESPBox()
for i = 0, sampGetMaxPlayerId() do
if sampIsPlayerConnected(i) then
local result, handle = sampGetCharHandleBySampPlayerId(i)
if result and doesCharExist(handle) and isCharOnScreen(handle) and handle ~= PLAYER_PED then
-- Получаем координаты головы (кость 8) и ног
local headX, headY, headZ = getBodyPartCoordinates(8, handle)
headZ = headZ + 0.35
local footX, footY, footZ = getCharCoordinates(handle)
footZ = footZ - 1.0
-- Конвертируем в экранные координаты
local sHeadX, sHeadY = convert3DCoordsToScreen(headX, headY, headZ)
local sFootX, sFootY = convert3DCoordsToScreen(footX, footY, footZ)
if sHeadX and sFootX then
local height = math.abs(sHeadY - sFootY)
local width = height / 1.8 -- пропорция тела
local color = 0xFFFFFFFF -- белый (ARGB)
-- 4 линии = прямоугольник
renderDrawLine(sHeadX - width/2, sHeadY, sHeadX + width/2, sHeadY, 2, color) -- верх
renderDrawLine(sHeadX - width/2, sFootY, sHeadX + width/2, sFootY, 2, color) -- низ
renderDrawLine(sHeadX - width/2, sHeadY, sHeadX - width/2, sFootY, 2, color) -- лево
renderDrawLine(sHeadX + width/2, sHeadY, sHeadX + width/2, sFootY, 2, color) -- право
end
end
end
end
end