local SEAvailable, SE = pcall(require, 'samp.events') -- require SAMP Events
if SEAvailable then -- if SAMP Events is available
function SE.onServerMessage(color, text) -- creating message hook
local nick, id, string = text:match("^%[A%]%s*(%S+)%[(%d+)%]:%s*(.+)")
if nick and id and string then -- if message is under pattern
local command, params = string:match("^/(%S+)%s*(.+)")
if command and params then -- if message contains command with params
if command:find('kick') then -- if this command is kick, then check params
local kickId, kickReason = params:match("^(%d+)%s*(.+)")
if kickId and kickReason then
sampSendChat('/kick '..kickId..' '..kickReason)...