require 'lib.moonloader'
local garajes={}
local beeped = false
function main()
while not isSampAvailable() do wait(0) end
start()
while true do
wait(0)
local beep = false
local mx, my, mz = getCharCoordinates(PLAYER_PED)
for i = 1, #garajes do
local dist = getDistanceBetweenCoords3d(mx, my, mz, garajes[i].x, garajes[i].y, garajes[i].z)
if dist < 4 and not beeped then
lua_thread.create(function()
beep = true
wait(1000) -- время скоко бибикать в мс(1 сек = 1000 мс)
beep = false
beeped = true
end)
else if dist > 4 then
beeped = false
end
end
end
if beep then
setGameKeyState(18, 128)
end
end
end
function start()
lua_thread.create(function()
while true do
for i = 0, 1000 do
if sampIs3dTextDefined(i) then
local text, clr, x, y, z, dist, _, plId, vehId = sampGet3dTextInfoById(i)
if text:find("Для въезда в гараж") then
local garaj = {x=x, y=y, z=z}
table.insert(garajes, garaj)
end
end
end
wait(100)
end
end)
end