Вопрос по RakSamp

bomb_bartu

Участник
Автор темы
59
1
Версия SA-MP
  1. Другая
Что делать? Делал скрипт для прохождения начальных квестов на раксамп и wait() не работает. Пишет это: addon.lua:108: attempt to yield across C-call boundary
Код::
-- Require
local sampev = require("samp.events")
require("addon")
-- Локалы
local referal = ('Nick_Name')
local password = '1234567890'
-- Авто регистрация/вход, нажатие клавиш
function sampev.onShowDialog(id, style, title, btn1, btn2, text)
    if title:find('Пароль') then
        sendDialogResponse(id, 1, 0, password)
        wait(5000)
        quest1()
        return false
    end
    if title:find('Выберите ваш пол') then
        sendDialogResponse(id, 1, 0, "")
        return false
    end
    if title:find('Выберите цвет кожи') then
        sendDialogResponse(id, 1, 0, "")
        return false
    end
    if title:find('вы о нас узнали?') then
        sendDialogResponse(id, 1, 1, "")
        return false
    end
    if title:find('Введите ник пригласившего?') then
        sendDialogResponse(id, 1, 0, referal)
        return false
    end
    if title:find('Дополнительная') then
        sendDialogResponse(id, 0, 0, "")
        return false
    end
  
    if title:find('Игровое меню') then
        sendDialogResponse(id, 1, 11, "")
        return false
    end
    if id == 9476 then
        sendDialogResponse(id, 1, 0, "")
        return false
    end
  
    if id == 2 then
        sendDialogResponse(id, 1, -1, password)
        return false
    end
end

function sampev.onShowTextDraw(id, data)
    if id == 521 then
        newTask(function()
            wait(1000)
            sendClickTextdraw(id)
            wait(5000)
        end)
    end
end

function sendKey(id)
    key = id
    updateSync()
end
------------------------------
function quest(id)
    if not id then
        print("Ошибка в коде, проверь")
    end
    if id == 1 then
        wait(1000)
        coordStart(1773.677124, -1891.702271, 13.550444, 500, 4, false)
        wait(15000)
        print("Alt")
        print("Alt")
        print("Alt")
        print("Alt")
        print("Alt")
        print("Alt")
        sendKey(1024)
        wait(500)
        sendKey(1024)
        wait(500)
        sendKey(1024)
        wait(500)
        sendKey(1024)
        wait(500)
    end
end

function onRunCommand(cmd) --команды
    if cmd:find("^!key %d+$") then
        sendKey(tonumber(cmd:match("%d+")))
        return false
    end
    if cmd == "!quest1" then
        quest(1)
    end
    if cmd == "!quest2" then
        quest(2)
    end
    if cmd == "!quest3" then
        quest(3)
    end
    if cmd == "!quest4" then
        quest(4)
    end
    if cmd == "!quest5" then
        quest(5)
    end
    if cmd == "!quest6" then
        quest(6)
    end
end