ShowDialog

Jendosik

Участник
Автор темы
211
12
Версия MoonLoader
.027.0-preview
пч выводит ток 1 строку хотя я укажал там 5 в чём проблема
Lua:
require "lib.moonloader"
local imgui = require 'imgui'
local encoding = require 'encoding'
local inicfg = require 'inicfg'
local samp = require 'samp.events'
local main_color = 0x02274D
local main_color2 = 0x50BD27
local main_color1 = 0xE60020
local main_color3 = 0x138D75
encoding.default = 'CP1251'
u8 = encoding.UTF8



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


    while true do
        wait(0)
    end
end


function samp.onShowDialog(dialogId, style, title, button1, button2, text)
   if dialogId == 999 then
local text1 = sampGetListboxItemText(text, 5)
print(text1)
if text1:find('') then
    sampAddChatMessage('test'..text1, -1)
end
    end
   end
 

qdIbp

Автор темы
Проверенный
1,386
1,141
а зачем ты это добавил?
обрубок кода, либо готовится делать что-то масштабнее


На попробуй
Lua:
require('lib.moonloader')
local samp = require('samp.events')
local inicfg = require('inicfg')

local imgui = require('imgui')
local encoding = require('encoding')
encoding.default = 'CP1251'
u8 = encoding.UTF8

local main_color = 0x02274D
local main_color2 = 0x50BD27
local main_color1 = 0xE60020
local main_color3 = 0x138D75

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

    --[[while true do
        wait(0)
    end]] -- Если не работаешь с беск  циклом используй беск.задержку
    wait(-1)
end

function samp.onShowDialog(dialogId, style, title, button1, button2, text)
       if dialogId == 999 then
        local text1 = sampGetListboxItemText(5)
        print(text1)
        if string.find(text1,'') then
            sampAddChatMessage('test'..text1, -1)
        end
    end
end