pcode '04D2' call caused an unhandled exception stack traceback: [C]: in function 'planeGotoCoords'

Dewize

Потрачен
Автор темы
442
88
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Версия MoonLoader
.027.0-preview
[ML] (error) piloti.lua: opcode '04D2' call caused an unhandled exception
stack traceback:
[C]: in function 'planeGotoCoords'
H:\Edik\SAMP\Âñ¸ äëÿ ñáîðêè\sborka\moonloader\piloti.lua:44: in function <H:\Edik\SAMP\Âñ¸ äëÿ ñáîðêè\sborka\moonloader\piloti.lua:42>
[ML] (error) piloti.lua: Script died due to an error. (196046D4)



Код:
local plane_handle = storeCarCharIsInNoSave(PLAYER_PED)
local plane_points = {
    { 0, 0, 50, 50, 100 }, -- x, y, z, z1, z2
    { 1446.6956787109, -2499.0393066406, 54.890331268311, 30, 30 }
}


function plane_go()
    for index, point in ipairs(plane_points) do
        planeGotoCoords(plane_handle, table.unpack(point))
        while getDistanceBetweenCoords3d(getCharCoordinates(PLAYER_PED), point[1], point[2], point[3]) > 10 do
            lua_thread.create(function()
                wait(0)
            end)   
        end
    end     
end
 

wojciech?

Известный
Проверенный
406
360
Lua:
local plane_points = {
    { 0, 0, 50, 50, 100 }, -- x, y, z, z1, z2
    { 1446.6956787109, -2499.0393066406, 54.890331268311, 30, 30 }
}
lua_thread.create(plane_go, plane_points)

function plane_go(points)
    if not isCharInAnyPlane(PLAYER_PED) then return false end
    local plane_handle = storeCarCharIsInNoSave(PLAYER_PED)
    for index, point in ipairs(points) do
        planeGotoCoords(plane_handle, table.unpack(point))
        while getDistanceBetweenCoords3d(getCharCoordinates(PLAYER_PED), point[1], point[2], point[3]) > 10 do
            if not isCharInAnyPlane(PLAYER_PED) then return false end
            wait(0)
        end
    end     
end
 

Dewize

Потрачен
Автор темы
442
88
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Lua:
local plane_points = {
    { 0, 0, 50, 50, 100 }, -- x, y, z, z1, z2
    { 1446.6956787109, -2499.0393066406, 54.890331268311, 30, 30 }
}
lua_thread.create(plane_go, plane_points)

function plane_go(points)
    if not isCharInAnyPlane(PLAYER_PED) then return false end
    local plane_handle = storeCarCharIsInNoSave(PLAYER_PED)
    for index, point in ipairs(points) do
        planeGotoCoords(plane_handle, table.unpack(point))
        while getDistanceBetweenCoords3d(getCharCoordinates(PLAYER_PED), point[1], point[2], point[3]) > 10 do
            if not isCharInAnyPlane(PLAYER_PED) then return false end
            wait(0)
        end
    end    
end

lua_thread.create(plane_go, plane_points) это куда? Потому что у меня вышла вот такая ошибка


[ML] (error) piloti.lua: attempt to call a nil value
stack traceback:
stack traceback:
[C]: in function 'create'
H:\Edik\SAMP\Всё для сборки\sborka\moonloader\piloti.lua:13: in main chunk
[ML] (error) piloti.lua: Script died due to an error. (1321561C)

up

Up
 
Последнее редактирование:

wojciech?

Известный
Проверенный
406
360
Lua:
local plane_points = {
    { 0, 0, 50, 50, 100 }, -- x, y, z, z1, z2
    { 1446.6956787109, -2499.0393066406, 54.890331268311, 30, 30 }
}

function plane_go(points)
    if not isCharInAnyPlane(PLAYER_PED) then return false end
    local plane_handle = storeCarCharIsInNoSave(PLAYER_PED)
    for index, point in ipairs(points) do
        planeGotoCoords(plane_handle, table.unpack(point))
        while getDistanceBetweenCoords3d(getCharCoordinates(PLAYER_PED), point[1], point[2], point[3]) > 10 do
            if not isCharInAnyPlane(PLAYER_PED) then return false end
            wait(0)
        end
    end   
end

function main()
    repeat wait(0) until isSampAvailable()

    sampRegisterChatCommand("plane_go", function()
        lua_thread.create(plane_go, plane_points)
    end)

    wait(-1)
end