- 27
- 3
- Версия MoonLoader
- .026-beta
Lua:
function renderPlayerRanks()
if hideranks[0] then return end
for id, rank in pairs(rankLabels) do
if sampIsPlayerConnected(id) then
local exists, ped = sampGetCharHandleBySampPlayerId(id)
if exists and doesCharExist(ped) then
local px, py, pz = getCharCoordinates(ped)
if isPointOnScreen(px, py, pz, 0) then
local cx, cy, cz = getActiveCameraCoordinates()
if isLineOfSightClear(
cx, cy, cz,
px, py, pz + 0.8,
true,
false,
false,
true,
false,
false,
false,
false
) then
local dist = getDistanceBetweenCoords3d(
cx, cy, cz,
px, py, pz
)
if dist <= 30.0 then
local sx, sy = convert3DCoordsToScreen(
px,
py,
pz + 1.0
)
local finalY = sy - 55
if afkRenderState[id] then
if afkLastSeen[id] and os.clock() - afkLastSeen[id] > 1.5 then
afkRenderState[id] = nil
afkLastSeen[id] = nil
end
end
if afkRenderState[id] then
finalY = finalY - 70
end
if sy > 0 and finalY > 0 then
local len = renderGetFontDrawTextLength(rankFont, rank)
renderFontDrawText(
rankFont,
rank,
sx - (len / 2),
finalY,
0xFFFFFFFF
)
end
end
end
end
end
end
end
end