Помощь с биндером.

johann.

Новичок
Автор темы
1
0
Версия MoonLoader
.026-beta
Вообщем я почти совсем ничего не понимаю в lua, а потому и решил попросить помощи.
Взялся за написание самого простого биндера и столкнулся с такой проблемой, при открытии чата и при наборе текста когда я нажимаю на забиндженую кнопку выскакивает текст бар и чат закрывается, можно это как-то фиксануть?
 

Вложения

  • bind.lua
    413 байт · Просмотры: 7
Решение
Ну как вариант сделать проверку на то, что не открыт чат/диалог/консоль. =)
Lua:
require "lib.moonloader"

function main()
    if not isSampfuncsLoaded() or not isSampLoaded() then return end
    while not isSampAvailable() do wait(100) end
    while true do
        wait(0)
        if isKeyCheckAvailable() and isKeyJustPressed(VK_P) then
            sampSendChat("/phone")
        elseif isKeyCheckAvailable() and isKeyJustPressed(VK_L) then
            sampSendChat("/lock")
        elseif isKeyCheckAvailable() and isKeyJustPressed(VK_K) then
            sampSendChat("/key")
        end
    end
end

function isKeyCheckAvailable()
    if not isSampfuncsLoaded() then
        return not isPauseMenuActive()
      end
      local result = not...

Dmitriy Makarov

25.05.2021
Проверенный
2,479
1,113
Ну как вариант сделать проверку на то, что не открыт чат/диалог/консоль. =)
Lua:
require "lib.moonloader"

function main()
    if not isSampfuncsLoaded() or not isSampLoaded() then return end
    while not isSampAvailable() do wait(100) end
    while true do
        wait(0)
        if isKeyCheckAvailable() and isKeyJustPressed(VK_P) then
            sampSendChat("/phone")
        elseif isKeyCheckAvailable() and isKeyJustPressed(VK_L) then
            sampSendChat("/lock")
        elseif isKeyCheckAvailable() and isKeyJustPressed(VK_K) then
            sampSendChat("/key")
        end
    end
end

function isKeyCheckAvailable()
    if not isSampfuncsLoaded() then
        return not isPauseMenuActive()
      end
      local result = not isSampfuncsConsoleActive() and not isPauseMenuActive()
      if isSampLoaded() and isSampAvailable() then
        result = result and not sampIsChatInputActive() and not sampIsDialogActive()
      end
      return result
end

Сейчас вроде не должно быть такого, проверь.
 
  • Нравится
Реакции: johann.