RakSAMP Arizona Не получается отправить пакет

alex777777777

Участник
Автор темы
43
5
У меня не получается ответить Джереми, я бы хотел сделать так
Чтобы на этот текст
" window.executeEvent('cef.modals.closeModal', "
отправлялся этот
"answer.npcDialog|0"
Я не знаю правильно ли я все делаю, пробовал и так и сяк не получается
Arizona-Events: https://www.blast.hk/threads/235586/
 
Решение
1:
function sendTable(tab)
    local bs = bitStream.new()
    for i = 1, table.getn(tab) do bs:writeUInt8(tab[i]) end
    local result = bs:sendPacket()
end

function onReceivePacket(id, bs)
    if id ~= 220 then return end

    bs:ignoreBits(8)
    if bs:readInt8() ~= 17 then return end

    bs:ignoreBits(32)
    local length = bs:readInt16()
    local encoded = bs:readInt8()
    local str = (encoded ~= 0) and bs:readEncoded(length + encoded) or bs:readString(length)


    if str:find('event%.npcDialog%.initializeDialog') then
    print(str)
        newTask(function()
            wait(100)
            sendTable({220, 18, 18, 0, 97, 110, 115, 119, 101, 114, 46, 110, 112, 99, 68, 105, 97, 108, 111, 103, 124, 48, 0, 0, 0, 0})...

CastelloFAM

Иуда
232
78
1:
function sendTable(tab)
    local bs = bitStream.new()
    for i = 1, table.getn(tab) do bs:writeUInt8(tab[i]) end
    local result = bs:sendPacket()
end

function onReceivePacket(id, bs)
    if id ~= 220 then return end

    bs:ignoreBits(8)
    if bs:readInt8() ~= 17 then return end

    bs:ignoreBits(32)
    local length = bs:readInt16()
    local encoded = bs:readInt8()
    local str = (encoded ~= 0) and bs:readEncoded(length + encoded) or bs:readString(length)


    if str:find('event%.npcDialog%.initializeDialog') then
    print(str)
        newTask(function()
            wait(100)
            sendTable({220, 18, 18, 0, 97, 110, 115, 119, 101, 114, 46, 110, 112, 99, 68, 105, 97, 108, 111, 103, 124, 48, 0, 0, 0, 0})
            wait(100)
            sendTable({220, 18, 18, 0, 97, 110, 115, 119, 101, 114, 46, 110, 112, 99, 68, 105, 97, 108, 111, 103, 124, 49, 0, 0, 0, 0})
        end)
    end
end

Вроде это
 
  • Нравится
Реакции: alex777777777