function onReceiveRpc(id, bs)
if id == 93 then
local ip, port = sampGetCurrentServerAddress()
local color = raknetBitStreamReadInt32(bs)
local len = raknetBitStreamReadInt32(bs)
local text = raknetBitStreamReadString(bs, len)
-- hook phone number
if getNumber.active then
if text:find('{FFFFFF}(.+)%[(%d+)%]:%s+{33CCFF}(%d+)') then
local name, id, phone = text:match('{FFFFFF}(.+)%[(%d+)%]:%s+{33CCFF}(%d+)')
if id == getNumber.id then
getNumber.value = phone
getNumber.active = false
end
end
end
if ip == '80.66.82.147' then
local isAd, group, serverId, sender, senderId, msg = text:find('^%[РЕКЛАМА%]%s%['), text:match('^[%[РЕКЛАМА%] %s]*%[(.-)%]%s{FFFFFF}%[(%d+)%](%w+_%w+)%[(%d+)%]:%s(.+)$')
if group and sender and senderId then
if group == 'PREMIUM' and not GROUP.PREMIUM.state[0] then return true end
if group == 'FOREVER' and not GROUP.FOREVER.state[0] then return true end
if group == 'VIP' and not GROUP.VIP.state[0] then return true end
table.insert(log, {
group = group,
tag = GROUP[group].icon..(isAd and ' '..faicons('sack_dollar') or ''),
text = ('%s | %s[%s]: %s'):format(serverId, sender, senderId, u8(msg)),
serverId = ServerId,
sender = sender,
senderId = senderId
})
SCROLL = true
return false
end
else
local isAd, group, sender, senderId, msg = text:find('^%[РЕКЛАМА%]%s%['), text:match('^[%[РЕКЛАМА%] %s]*%[(.-)%]%s{FFFFFF}(%w+_%w+)%[(%d+)%]:%s(.+)$')
if group and sender and senderId then
if group == 'PREMIUM' and not GROUP.PREMIUM.state[0] then return true end
if group == 'FOREVER' and not GROUP.FOREVER.state[0] then return true end
if group == 'VIP' and not GROUP.VIP.state[0] then return true end
table.insert(log, {
group = group,
tag = GROUP[group].icon..(isAd and ' '..faicons('sack_dollar') or ''),
text = ('%s[%s]: %s'):format(sender, senderId, u8(msg)),
sender = sender,
senderId = senderId
})
SCROLL = true
return false
end
end