ev = require("lib.samp.events")
texts = {}
function main()
while not isSampAvailable() do wait(100) end
while true do wait(0)
if #texts > 0 then
for i = 1, #texts do
renderFontDrawText(font, texts[i].text, texts[i].x, texts[i].y, -1)
end
end
end
end
function ev.onCreate3DText(id, color, position, distance, testLOS, attachedPlayerId, attachedVehicleId, text)
local x, y = convert3dCoordsToScreen(position.x, position.y, position.z)
table.insert(texts, {text = text, x = x, y = y, id = id})
end
function ev.onRemove3DTextLabel(id)
if #texts > 0 then
for i = 1, #texts do
if texts[i].id == id then
table.remove(texts, i) break
end
end
end
end