Отправка в чат инпут

7 СМЕРТНЫХ ГРЕХОВ

Известный
Автор темы
515
159
Версия MoonLoader
.026-beta
Не могу понять почему кидает цифры а не текст
1679054334524.png
LUA:
local new, str, sizeof = imgui.new, ffi.string, ffi.sizeof
local textBuffer = new.char[256]()

--mimgui--
if imgui.InputText(u8"Первая строка", textBuffer, sizeof(textBuffer)) then end
if imgui.Button(u8'Отправить') then
    sampAddChatMessage(u8:decode(textBuffer[0]), -1)
end
 
Решение
Не могу понять почему кидает цифры а не текст
LUA:
local new, str, sizeof = imgui.new, ffi.string, ffi.sizeof
local textBuffer = new.char[256]()

--mimgui--
if imgui.InputText(u8"Первая строка", textBuffer, sizeof(textBuffer)) then end
if imgui.Button(u8'Отправить') then
    sampAddChatMessage(u8:decode(textBuffer[0]), -1)
end
u8:decode(ffi.string(textBuffer)) забыл в строку перевести

why ega

РП игрок
Модератор
2,541
2,233
Не могу понять почему кидает цифры а не текст
LUA:
local new, str, sizeof = imgui.new, ffi.string, ffi.sizeof
local textBuffer = new.char[256]()

--mimgui--
if imgui.InputText(u8"Первая строка", textBuffer, sizeof(textBuffer)) then end
if imgui.Button(u8'Отправить') then
    sampAddChatMessage(u8:decode(textBuffer[0]), -1)
end
u8:decode(ffi.string(textBuffer)) забыл в строку перевести