Скрипт не работает

CeSum

Участник
Автор темы
30
0
Версия MoonLoader
.027.0-preview
Lua:
function main()
    while not isSampAvailable() do wait(0) end
    sampAddChatMessage("{FF4500}[CarFind] {FFF101}Use /cfind [id/off]")
    sampRegisterChatCommand("cfind",function(arg)
        if arg == "off" then
            removeWaypoint()
            sampAddChatMessage("{FF4500}[CarFind] {FFF101} Waypoint is removed")
        end
        local id = tonumber(arg)
        while true do
            wait(0)
            local result, handle = sampGetCarHandleBySampVehicleId(id)
            if result then
                local x, y, z = getCarCoordinates(handle)
                sampAddChatMessage("{FF4500}[CarFind] {FFF101} Car is found! Waypoint is placed!")
                placeWaypoint(x, y, z)
            end
        end
    wait(-1)
    end)
end

Не работает, при загрузке в логах сразу терминатед
 

YarikVL

Известный
Проверенный
4,812
1,819
Lua:
function main()
    while not isSampAvailable() do wait(0) end
    sampAddChatMessage("{FF4500}[CarFind] {FFF101}Use /cfind [id/off]")
    sampRegisterChatCommand("cfind",function(arg)
        if arg == "off" then
            removeWaypoint()
            sampAddChatMessage("{FF4500}[CarFind] {FFF101} Waypoint is removed")
        end
        local id = tonumber(arg)
        while true do
            wait(0)
            local result, handle = sampGetCarHandleBySampVehicleId(id)
            if result then
                local x, y, z = getCarCoordinates(handle)
                sampAddChatMessage("{FF4500}[CarFind] {FFF101} Car is found! Waypoint is placed!")
                placeWaypoint(x, y, z)
            end
        end
    wait(-1)
    end)
end

Не работает, при загрузке в логах сразу терминатед
sampAddChatMessage имеет два аргумента ( вроде ).
Зачем тебе wait(-1) если это надо для неиспользование бесконечного цикла.
И зачем скобка после end на 20 строке.
Исправь и кинь мунлог, может ещё будут ошибки
 

МамкинХацкер

Активный
334
79
  • Нравится
Реакции: YarikVL