По луа скрипту

VRush

https://t.me/vrushscript
Автор темы
Проверенный
2,359
1,107
есть скриптик простой, но он тупит и в диалог не вписывает "200"
как сделать?
Вот сам скрипт

1:
sampev = require 'lib.samp.events'

function main()
    jopa = false
    repeat wait(0) until isSampAvailable()
    sampRegisterChatCommand("pt", po)
wait(-1)
end

function po(arg)
    jopa = true
end

function sampev.onShowDialog(id, style, caption)
    if jopa and id == 216 then
            sampCloseCurrentDialogWithButton(1)
            return false
        end
        if jopa and id == 217 then
            sampSendDialogResponse(217, 1, 3, input)
        end
        if jopa and id == 221 then
            sampSendDialogResponse(221, listitem, "200")
        end
end
 
Решение
Lua:
sampev = require 'lib.samp.events'

function main()
    repeat wait(0) until isSampAvailable()
    sampRegisterChatCommand("pt", cmd_pt)

    wait(-1)
end

function cmd_pt(arg)
    enab = not enab
    printStringNow(enab and "~g~ON" or "~r~OFF", 1000)
    arg_pt = arg
end

function sampev.onShowDialog(id, style, title, button1, button2, text)
     if enab and id == 216 then
          sampSendDialogResponse(216, 1, _, _)
          sampSendDialogResponse(217, 1, 3, _)
          sampSendDialogResponse(221, 1, _, arg_pt)
     end
end

The End

Участник
29
6
Я наверное тебя задолбал)
Сделай чтобы при входе писало что скрипт загружен
Lua:
function main()
    repeat wait(0) until isSampAvailable()
    sampAddChatMessage('• {FF7300}[Script] {FFFFFF}Загружен', -1)
    sampRegisterChatCommand("pt", cmd_pt)

    wait(-1)
end
 
  • Нравится
Реакции: VRush