sampSendDialogResponse

user1241

Активный
Автор темы
419
44
Версия MoonLoader
.026-beta
я ваще отупел. не могу понять, как нажимать кнопку в диалоге ._,
Lua:
require 'lib.moonloader'
local packet32 = {220, 18, 14, 0, 108, 97, 117, 110, 99, 104, 101, 100, 65, 112, 112, 124, 51, 50, 0, 0, 0, 0}

function main()
    if not isSampLoaded() then return end
    while not isSampAvailable() do wait(100) end
 
    sampRegisterChatCommand('fmem', fcmem)
 
    while true do
        wait(0)
    end
end

function fcmem(value)
    if value == '' then
        sampAddChatMessage('/fmem [LSPD | SFPD | LVPD | RCSD]', -1)
    end
    if value == 'LSPD' then
        lua_thread.create(function ()
         
        sampSendChat('/phone')
        sendRawBytes(packet32)
        wait(1000)
        sampSendDialogResponse(nil, 1, 1, nil)
        end)
    end
end

function sendRawBytes(bytesTable)
    local bs = raknetNewBitStream()
    for i, byte in ipairs(bytesTable) do raknetBitStreamWriteInt8(bs, byte) end
    raknetSendBitStream(bs)
    raknetDeleteBitStream(bs)
end
1786127441261.png
 

bubbles

Участник
11
15
Привет. У тебя ничего не работает из-за того, что ты не передаешь ID диалога в sampSendDialogResponse

sampSendDialogResponse(id, button, listitem, input)
Аргументы:
int id ид диалога
int button ид кнопки (0 - отмена / 1 - ок)
int listitem номер элемента списка (от 0)
zstring input текст введенный в поле
 

pewpewpewpew

Известный
Модератор
811
254
тащи от сюда