Как отловить SAMP сообщение в чат?

Статус
В этой теме нельзя размещать новые ответы.

invilso.

Известный
Автор темы
259
89
Версия MoonLoader
.027.0-preview
Как я могу отловить самповское сообщение в чат?
Например такое:
Код:
Lost connection to the server. Reconnecting..
И могу ли я как-то убить самп очень быстро через луа? То есть аналог отправки kill -9 PID
 
Решение
Lost connection to the server. Reconnecting..
Дополню ответ выше.
Lua:
--[[
    ID's:
        31 — This server is full
        32 — Server closed the connection
        33 — Lost connection to the server
        36 — You are banned from this server
]]

function onReceivePacket(id, bs)
    if id == ID then
        -- Code
    end
end

Или через SAMP Events:
Lua:
local sampev = require "samp.events"

--[[
    onConnectionNoFreeSlot — This server is full
    onConnectionClosed — Server closed the connection
    onConnectionLost — Lost connection to the server
    onConnectionBanned — You are banned from this server
]]

-- Example
function sampev.onConnectionLost()
    -- Code
end
...

whyega52

Eblang головного мозга
Модератор
2,837
2,776
Как я могу отловить самповское сообщение в чат?
Например такое:
Код:
Lost connection to the server. Reconnecting..
 
  • Нравится
Реакции: invilso.

Dmitriy Makarov

25.05.2021
Проверенный
2,511
1,138
Lost connection to the server. Reconnecting..
Дополню ответ выше.
Lua:
--[[
    ID's:
        31 — This server is full
        32 — Server closed the connection
        33 — Lost connection to the server
        36 — You are banned from this server
]]

function onReceivePacket(id, bs)
    if id == ID then
        -- Code
    end
end

Или через SAMP Events:
Lua:
local sampev = require "samp.events"

--[[
    onConnectionNoFreeSlot — This server is full
    onConnectionClosed — Server closed the connection
    onConnectionLost — Lost connection to the server
    onConnectionBanned — You are banned from this server
]]

-- Example
function sampev.onConnectionLost()
    -- Code
end
И могу ли я как-то убить самп очень быстро через луа? То есть аналог отправки kill -9 PID
Может быть это:
 
  • Нравится
Реакции: invilso.
Статус
В этой теме нельзя размещать новые ответы.