Крашит при вводе команды

bolshoy

Активный
Автор темы
324
46
Крашит при вводе команды в чем проблема библиотеки все стоят
Код:
local sampev = require 'samp.events'
local vk = require 'vkeys'
local imgui = require 'imgui'

local bindWindow = false

function main()
    while not isSampAvailable() do
        wait(100)
    end

    if not imgui or not vk then
        sampAddChatMessage("{FF0000}Ошибка: Библиотеки не загружены!", -1)
        return
    end

    sampAddChatMessage("{9900FF}By Morty | /bullbind - показать бинды", -1)

    sampRegisterChatCommand('bullbind', function()
        bindWindow = not bindWindow
    end)

    while true do
        wait(0)

        if wasKeyPressed(vk.VK_1) then
            sampSendChat("/usemed")
        elseif wasKeyPressed(vk.VK_2) then
            sampSendChat("/armour")
        elseif wasKeyPressed(vk.VK_3) then
            sampSendChat("/sellgun Water_Melon Deagle 50")
        elseif wasKeyPressed(0x58) then -- X
            sampSendChat("/usedrugs 3")
        elseif wasKeyPressed(0x4C) then -- L
            sampSendChat("/lock")
        end

        if bindWindow then
            imgui.SetNextWindowSize(imgui.ImVec2(200, 150), imgui.ImGuiCond_FirstUseEver)
            if imgui.Begin("BullBinds by Morty", imgui.ImBool(bindWindow), imgui.WindowFlags_NoResize) then
                imgui.Text("Горячие клавиши:")
                imgui.Separator()
                imgui.TextColored(imgui.ImVec4(1, 0.5, 0, 1), "1: /usemed")
                imgui.TextColored(imgui.ImVec4(1, 0.5, 0, 1), "2: /armour")
                imgui.TextColored(imgui.ImVec4(1, 0.5, 0, 1), "3: /sellgun")
                imgui.TextColored(imgui.ImVec4(1, 0.5, 0, 1), "X: /usedrugs 3")
                imgui.TextColored(imgui.ImVec4(1, 0.5, 0, 1), "L: /lock")
                imgui.Separator()
                imgui.Text("Закрыть - /bullbind")
                imgui.End()
            end
        end
    end
end
 
  • Клоун
Реакции: Corenale

Dimon7724

Новичок
14
1
Крашит при вводе команды в чем проблема библиотеки все стоят
Код:
local sampev = require 'samp.events'
local vk = require 'vkeys'
local imgui = require 'imgui'

local bindWindow = false

function main()
    while not isSampAvailable() do
        wait(100)
    end

    if not imgui or not vk then
        sampAddChatMessage("{FF0000}Ошибка: Библиотеки не загружены!", -1)
        return
    end

    sampAddChatMessage("{9900FF}By Morty | /bullbind - показать бинды", -1)

    sampRegisterChatCommand('bullbind', function()
        bindWindow = not bindWindow
    end)

    while true do
        wait(0)

        if wasKeyPressed(vk.VK_1) then
            sampSendChat("/usemed")
        elseif wasKeyPressed(vk.VK_2) then
            sampSendChat("/armour")
        elseif wasKeyPressed(vk.VK_3) then
            sampSendChat("/sellgun Water_Melon Deagle 50")
        elseif wasKeyPressed(0x58) then -- X
            sampSendChat("/usedrugs 3")
        elseif wasKeyPressed(0x4C) then -- L
            sampSendChat("/lock")
        end

        if bindWindow then
            imgui.SetNextWindowSize(imgui.ImVec2(200, 150), imgui.ImGuiCond_FirstUseEver)
            if imgui.Begin("BullBinds by Morty", imgui.ImBool(bindWindow), imgui.WindowFlags_NoResize) then
                imgui.Text("Горячие клавиши:")
                imgui.Separator()
                imgui.TextColored(imgui.ImVec4(1, 0.5, 0, 1), "1: /usemed")
                imgui.TextColored(imgui.ImVec4(1, 0.5, 0, 1), "2: /armour")
                imgui.TextColored(imgui.ImVec4(1, 0.5, 0, 1), "3: /sellgun")
                imgui.TextColored(imgui.ImVec4(1, 0.5, 0, 1), "X: /usedrugs 3")
                imgui.TextColored(imgui.ImVec4(1, 0.5, 0, 1), "L: /lock")
                imgui.Separator()
                imgui.Text("Закрыть - /bullbind")
                imgui.End()
            end
        end
    end
end
У тебя либы не подгружаются!
 
  • Эм
Реакции: Corenale