cannot resume non-suspended coroutine

mcholland.

Новичок
Автор темы
16
4
Версия MoonLoader
.026-beta
если active2 = true вылазит ошибка:
[ML] (error) scriptname: cannot resume non-suspended coroutine
stack traceback:
[C]: in function 'sampGetPlayerNickname'
...\moonloader\script.lua:53: in function <E:\GAMES\GTA xxlhuff\moonloader\check TD id.lua:9>
[ML] (error) auto z: Script died due to an error. (131213D4)

строчка 53:
Lua:
local suspects = sampGetPlayerNickname(suspectid)

Lua:
-- функция main
while true do
    wait(0)
    if active2 then
        active = false
        local x, y, z = getCharCoordinates(PLAYER_PED)
        local anybody, suspecthandle = findAllRandomCharsInSphere(x, y, z, 25, true, false)
        if anybody then
            local _, suspectid = sampGetPlayerIdByCharHandle(suspecthandle)
            local suspects = sampGetPlayerNickname(suspectid)
            -- далее код
        end
    end
end

помогите с решением, спасибо
 
Последнее редактирование:
Решение
если active2 = true вылазит ошибка:
[ML] (error) scriptname: cannot resume non-suspended coroutine
stack traceback:
[C]: in function 'sampGetPlayerNickname'
...\moonloader\script.lua:53: in function <E:\GAMES\GTA xxlhuff\moonloader\check TD id.lua:9>
[ML] (error) auto z: Script died due to an error. (131213D4)

строчка 53:
Lua:
local suspects = sampGetPlayerNickname(suspectid)

Lua:
-- функция main
while true do
    if active2 then
        active = false
        local x, y, z = getCharCoordinates(PLAYER_PED)
        local anybody, suspecthandle = findAllRandomCharsInSphere(x, y, z, 25, true, false)
        if anybody then
            local _, suspectid = sampGetPlayerIdByCharHandle(suspecthandle)
            local suspects =...

YarikVL

Известный
Проверенный
4,751
1,814
если active2 = true вылазит ошибка:
[ML] (error) scriptname: cannot resume non-suspended coroutine
stack traceback:
[C]: in function 'sampGetPlayerNickname'
...\moonloader\script.lua:53: in function <E:\GAMES\GTA xxlhuff\moonloader\check TD id.lua:9>
[ML] (error) auto z: Script died due to an error. (131213D4)

строчка 53:
Lua:
local suspects = sampGetPlayerNickname(suspectid)

Lua:
-- функция main
while true do
    if active2 then
        active = false
        local x, y, z = getCharCoordinates(PLAYER_PED)
        local anybody, suspecthandle = findAllRandomCharsInSphere(x, y, z, 25, true, false)
        if anybody then
            local _, suspectid = sampGetPlayerIdByCharHandle(suspecthandle)
            local suspects = sampGetPlayerNickname(suspectid)
            -- далее код
        end
    end
end

помогите с решением, спасибо
Попробуй эти строчки:
Lua:
local res, suspectid = sampGetPlayerIdByCharHandle(suspecthandle)
local suspects = sampGetPlayerNickname(suspectid)
Заменить на:
Lua:
local res, suspectid = sampGetPlayerIdByCharHandle(suspecthandle)
if res then
    suspects = sampGetPlayerNickname(suspectid)
end