нажатие клавиш

Raise

Участник
Автор темы
57
11
Версия MoonLoader
.027.0-preview
Lua:
local enteStats = function()
    lua_thread.create(function()
        check = true
        wait(0)
        sampSendChat("/mn")
    end)
end

мне нужно что бы после sampSendChat("/mn")

нажимало 3 раза стрелочку вниз
нажимало enter
и еще раз ентер
 
Последнее редактирование модератором:
Решение
Должно работать, если не будет, то отпишешь.
Lua:
local sampev = require 'samp.events' --подключение библиотеки samp.lua

active = false

function main()
    if not isSampLoaded() or not isSampfuncsLoaded() then return end
    while not isSampAvailable() do wait(100) end
    sampRegisterChatCommand('example',function () --все это произайдет при прописывании команды /example
        sampSendChat('/mn')
        active = true
    end)
    wait(-1)
end

function sampev.onShowDialog(dialogId, dialogStyle, dialogTitle, okButtonText, cancelButtonText, dialogText) --хук диалога
    if active then
        if dialogId == id then --вместо id тебе нужно указать id диалога /mn
            sampSendDialogResponse(dialogId,1,2,-1)
        end
        if...

Bredd Lane

Известный
423
348
Должно работать, если не будет, то отпишешь.
Lua:
local sampev = require 'samp.events' --подключение библиотеки samp.lua

active = false

function main()
    if not isSampLoaded() or not isSampfuncsLoaded() then return end
    while not isSampAvailable() do wait(100) end
    sampRegisterChatCommand('example',function () --все это произайдет при прописывании команды /example
        sampSendChat('/mn')
        active = true
    end)
    wait(-1)
end

function sampev.onShowDialog(dialogId, dialogStyle, dialogTitle, okButtonText, cancelButtonText, dialogText) --хук диалога
    if active then
        if dialogId == id then --вместо id тебе нужно указать id диалога /mn
            sampSendDialogResponse(dialogId,1,2,-1)
        end
        if dialogId == id then --вместо id нужно указать id диалога который откроется после нажатия на 3-й лист
            sampSendDialogResponse(dialogId,1,0,-1)
        end
        if dialogId == id then --вместо id нужно указать id диалога который откроется после нажатия на 1-й лист
            sampSendDialogResponse(dialogId,1,0,-1)
        end
        active = false
    end
end
 
  • Нравится
Реакции: TheBrox