function onReceivePacket(id, bs)
if id == 215 then
raknetBitStreamIgnoreBits(bs, 8)
if raknetBitStreamReadInt16(bs) == 2 then
raknetBitStreamReadInt32(bs)
local e = {}
for i = 1, raknetBitStreamReadInt8(bs) do
local l = raknetBitStreamReadInt32(bs)
table.insert(e, raknetBitStreamReadString(bs, l))
end
if table.getn(e) > 0 then
local text = e[1]
lua_thread.create(function()
if text:find("хотите забрать его себе") then
sendDialogResponse(1,0,'')
end
end)
end
end
end
end
function sendDialogResponse(button, list, text)
local bs = raknetNewBitStream()
local bytes = {2, 0, 0, 0, 0, 0, 16, 0, 0, 0, 79, 110, 68, 105, 97, 108, 111, 103, 82, 101, 115, 112, 111, 110, 115,
101, 8, 0, 0, 0, 100, 0, 0, 0, 0, 100}
raknetBitStreamWriteInt8(bs, 215)
for i = 1, #bytes do
raknetBitStreamWriteInt8(bs, bytes[i])
end
raknetBitStreamWriteInt32(bs, button)
raknetBitStreamWriteInt8(bs, 100)
raknetBitStreamWriteInt32(bs, list)
raknetBitStreamWriteInt8(bs, 115)
raknetBitStreamWriteInt32(bs, #text)
raknetBitStreamWriteString(bs, text)
raknetSendBitStreamEx(bs, 1, 7, 1)
raknetDeleteBitStream(bs)
end