- 315
- 58
Подскажите пожалуйста как сделать, телепорт по объекту ид 874 работает, но как сделать что бы он зафризился на месте последнего телепорта, так как он подезмлёй это делает и падает когда заканчивается подбор объекта 874, нужно что бы он дальше ждал появления этого объекта и не падал под землёй вниз(кд появления объекта 3 минуты)
Lua:
function main()
if not isSampLoaded() or not isSampfuncsLoaded() then return end
while not isSampAvailable() do wait(100) end
getLastUpdate() -- вызываем функцию получения последнего ID сообщения
sampRegisterChatCommand('telegram',function() -- тестовая команда
sampAddChatMessage('[Telegram] Отправляю тестовое сообщение',-1)
sendTelegramNotification('Тестовое сообщение от '..sampGetPlayerNickname(select(2, sampGetPlayerIdByCharHandle(PLAYER_PED)))) -- отправляем сообщение юзеру
end)
lua_thread.create(get_telegram_updates)
sampRegisterChatCommand('rmine', function()
window.v = not window.v
imgui.Process = window.v
end)
while true do
wait(0)
if en.v then
lockPlayerControl(true)
freezeCharPosition(PLAYER_PED, true)
for _, v in pairs(getAllObjects()) do
local asd
if sampGetObjectSampIdByHandle(v) ~= -1 then
asd = sampGetObjectSampIdByHandle(v)
end
if isObjectOnScreen(v) then
local _, x, y, z = getObjectCoordinates(v)
local x1, y1 = convert3DCoordsToScreen(x,y,z)
local model = getObjectModel(v)
local x2,y2,z2 = getCharCoordinates(PLAYER_PED)
local x10, y10 = convert3DCoordsToScreen(x2,y2,z2)
local distance = string.format("%.1f", getDistanceBetweenCoords3d(x, y, z, x2, y2, z2))
if model == 874 and getDistanceBetweenCoords3d(x, y, z, x2, y2, z2) <= 1000000 then
lockPlayerControl(true)
freezeCharPosition(PLAYER_PED, true)
renderFontDrawText(font, (asd and "model = "..model.."; id = "..asd or "model = "..model).."; distance: "..distance.."; coords: x:"..x.."y:"..y.."z:"..z, x1, y1, -1)
setCharCoordinates(1,x,y,z-3)
end
end
end
end
end
end