- 131
- 29
- Версия MoonLoader
- .026-beta
наговнокодил тут штуку:
function findNearest3dTextByString(searchText)
local closestTextDist = 9999
local closestTextPos = {0, 0, 0}
for i = 0, 2281337 do
if sampIs3dTextDefined(i) then
local text, color, posX, posY, posZ, Wdist, Wh, onplayer, onTransport = sampGet3dTextInfoById(i)
local x,y,z = getCharCoordinates(PLAYER_PED)
local dist = getDistanceBetweenCoords3d(x,y,z,posX,posY,posZ)
if string.match(text, searchText) then
if dist < closestTextDist then
closestTextDist = dist
closestTextPos = {posX, posY, posZ}
end
end
end
end
if closestTextDist < 9999 then
return closestTextPos[1], closestTextPos[2], closestTextPos[3], closestTextDist
end
end