не работает крестик в менюшке imgui

sarygaexbo

Новичок
Автор темы
6
0
Версия MoonLoader
Другое
я сегодня начал учиться луа написал простой код, по гайду TheChampGuess
почему то не работает крестик в меню луа, помогите

script_name('SCBSs') --название скрипта
script_author ('SBCS') --автор скрипта
script_description('Commands') --описание скрипта

require "lib.moonloader" --подключение библиотеки
require "lib.vkeys"
require "lib.samp.events"

local sampev = require "lib.samp.events"
local keys = require "vkeys"
local imgui = require "imgui"

local tag = 'Bhack: ' --локальная переменная
local Activeta = 0
local color_bg = 0x2BA189
local color_bg_text = "(2BA189)"
local white_color = "(FFFFFF)"

local main_window_state = imgui.ImBool(false)
local text_buffer = imgui.ImBuffer(256)

local encoding = require "encoding"
encoding.default = "CP1251"
u8 = encoding.UTF8



function main()
if not isSampLoaded () or not isSampfuncsLoaded () then return end
while not isSampAvailable() do wait (100) end

sampRegisterChatCommand("img", cmd_imgui)

imgui.Procces = false

if Activeta == 1 then
sampAddChatMessage(tag .. "саня лох", 0x2BA189)
else
sampAddChatMessage(tag .. "самогон", 0x2BA189)
end

--Блок выполняется один раз после старта сампа
while true do
wait(0)

if main_window_state.v == false then
imgui.Procces = false
end

--Блок выполняющийся бесконечно (пока самп активен)
end
end

function cmd_imgui(arg)
main_window_state.v = not main_window_state.v
imgui.Process = main_window_state.v
end

function imgui.OnDrawFrame()
imgui.Begin("Start imgui", main_window_state)
imgui.Text ("some text")
imgui.End()
end
 

IlyaHL2

Активный
210
53
Lua:
script_name('SCBSs') --название скрипта
script_author ('SBCS') --автор скрипта
script_description('Commands') --описание скрипта

require "lib.moonloader" --подключение библиотеки
require "lib.vkeys"
local sampev = require "lib.samp.events"
local keys = require "vkeys"
local imgui = require "imgui"

local tag = 'Bhack: ' --локальная переменная
local Activeta = false
local color_bg = 0x2BA189
local color_bg_text = "(2BA189)"
local white_color = "(FFFFFF)"

local main_window_state = imgui.ImBool(false)
local text_buffer = imgui.ImBuffer(256)

local encoding = require "encoding"
encoding.default = "CP1251"
u8 = encoding.UTF8

function main()
while not isSampAvailable() do wait (100) end
    sampRegisterChatCommand("img", cmd_imgui)
    if Activeta then
        sampAddChatMessage(tag .. "саня лох", color_bg)
    else
        sampAddChatMessage(tag .. "самогон", color_bg)
    end

--Блок выполняется один раз после старта сампа
    while true do
        wait(0)
    imgui.Process = main_window_state.v

--Блок выполняющийся бесконечно (пока самп активен)
    end
end

function cmd_imgui()
    main_window_state.v = not main_window_state.v
    imgui.Process = main_window_state.v
end

function imgui.OnDrawFrame()
    if main_window_state.v then
        imgui.Begin("Start imgui", main_window_state)
            imgui.Text("some text")
        imgui.End()
    end
end

мне 12 лет я первый раз сам пишу, как я могу писать без ошибок?
ооо, лучше начинай с какого-нибудь более простого языка, чтобы понять азы написания кода, и не пытаться прыгнуть выше головы
 

sarygaexbo

Новичок
Автор темы
6
0
Lua:
script_name('SCBSs') --название скрипта
script_author ('SBCS') --автор скрипта
script_description('Commands') --описание скрипта

require "lib.moonloader" --подключение библиотеки
require "lib.vkeys"
local sampev = require "lib.samp.events"
local keys = require "vkeys"
local imgui = require "imgui"

local tag = 'Bhack: ' --локальная переменная
local Activeta = false
local color_bg = 0x2BA189
local color_bg_text = "(2BA189)"
local white_color = "(FFFFFF)"

local main_window_state = imgui.ImBool(false)
local text_buffer = imgui.ImBuffer(256)

local encoding = require "encoding"
encoding.default = "CP1251"
u8 = encoding.UTF8

function main()
while not isSampAvailable() do wait (100) end
    sampRegisterChatCommand("img", cmd_imgui)
    if Activeta then
        sampAddChatMessage(tag .. "саня лох", color_bg)
    else
        sampAddChatMessage(tag .. "самогон", color_bg)
    end

--Блок выполняется один раз после старта сампа
    while true do
        wait(0)
    imgui.Process = main_window_state.v

--Блок выполняющийся бесконечно (пока самп активен)
    end
end

function cmd_imgui()
    main_window_state.v = not main_window_state.v
    imgui.Process = main_window_state.v
end

function imgui.OnDrawFrame()
    if main_window_state.v then
        imgui.Begin("Start imgui", main_window_state)
            imgui.Text("some text")
        imgui.End()
    end
end


ооо, лучше начинай с какого-нибудь более простого языка, чтобы понять азы написания кода, и не пытаться прыгнуть выше головы
А ты хорош в луа? мне еще помощь нужна