local sampev = require 'lib.samp.events'
local textCoords = {x = nil, y = nil, z = nil}
function main()
while not isSampAvailable() do wait(0) end
while true do
wait(0)
if textCoords.x then
if isCharInArea3d(PLAYER_PED, textCoords.x - 3, textCoords.y - 3, textCoords.z - 3, textCoords.x + 3, textCoords.y + 3, textCoords.z + 3, false) then
sampAddChatMessage('ты рядом с текстом', -1)
end
--или
x, y, z = getCharCoordinates(PLAYER_PED)
if getDistanceBetweenCoords3d(x, y, z, textCoords.x, textCoords.y, textCoords.z) <= 3 then
sampAddChatMessage('ты рядом с текстом', -1)
end
end
end
end
function sampev.onCreate3DText(id, color, position, distance, testLOS, attPid, attVid, text)
if text:find('текст 3д текста') then
textCoords.x = position.x
textCoords.y = position.y
textCoords.z = position.z
end
end