Вы находитесь на странице: 1из 3

local se = require "samp.

events"

local skip = [[
[���������] {DC4747}�� ������� ���� ���������, ����������� ������� Y �� ������ �
���
[���������] {DC4747}�� ������ ������ ������ � ���� ���������� ��������� /report
� ����� �������� �� ������ ���������� ������ ���������� ������� ����� � ���������
�� �� �������� ����� {FFFFFF}������, ���, ���������{6495ED} ��� �� ������� �����-
������ ����������
������ �� �������� {FFFFFF}VIP{6495ED} ���� ������ ������������, ��������� /help
[������������ VIP]
������ �� �������� {FFFFFF}VIP{6495ED} ���� ������� �����������, ��������� /help
[������������ VIP]
� �������� ����� ����� ���������� ������ {FFFFFF}����������, ����������, ���������
����
� �������� ���-�� ����� ���������� ������ {FFFFFF}����������, ����������, ���������
����
��������, ������� ������ ��� �� �����! ��� ����: {FFFFFF}arizona-rp.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- �������� ������� �������: /menu /help /gps /settings
- �������� ����� � ������ ����� � ������� $300 000!
- ��� ����: arizona-rp.com (������ �������/�����)
[�������� ��� ������] {ffffff}��������� ������ �����, ������� ������� ������� ��
����: ��� ������ � ���� ����
[�������� ��� ������] {ffffff}���������: {FF6666}/help � ������� � ����� Vice City
[������ Vice City] {ffffff}��������! �� ������� Vice City ��������� ����
[���������] �� ������ ������ ��������� ��������� /gps - ��������� ��������
���� ��� ������������ ����� �������� ��������� �� ���� � �� ���� �� ����� �������
����� ������� �� ������ ������� ��� ���������, ���� ���� ��� ������
[���������] � ������ �������� ����� �������� �����. ������� ���� ������� - 2
������!
]]

function se.onServerMessage(color, text)


-- \\ ���� ����� ����� ��������
for line in string.gmatch(skip, "[^\n]+") do
if string.find(text, line, 1, true) then
return false
end
end

-- \\ ���� ������ �� ���


if color == 0x73B461FF and string.find(text, "^%[ News .. %]") then
return false
end

-- \\ ���� ��������������
if string.find(text, "^[A-z0-9_]%[%d+%] ����� ������ �������$") then
return false
end

-- \\ ����� �������� /ad ��� ������ ����������


if color == 0x73B461FF then
if string.find(text, "�������������� ���������") then
return false
end

local ad, sender, tel = string.match(text, "^���������:%s(.+)%.


%s��������:%s([A-z0-9_]+)%[%d+%]%s���%.%s(%d+)")
if ad ~= nil then
text = string.format("AD: {73B461}%s {D5A457}| ���: %s ( %s )",
ad, tel, sender:gsub("_", " "))
return { 0xD5A457FF, text }
end

local ad, sender, tel = string.match(text, "^{%x+}%[VIP%]%s���������:


%s(.+)%.%s��������:%s([A-z0-9_]+)%[%d+%]%s���%.%s(%d+)")
if ad ~= nil then
text = string.format("VIP AD: %s | ���: %s ( %s )", ad, tel,
sender:gsub("_", " "))
return { 0xF2A024FF, text }
end
end

-- \\ ������� �� ���������������
if string.find(text, "�������������") then
if color == -10270721 then
return { 0x00AB54FF, text }
elseif color == -2686721 then
return { 0xFF4040FF, text }
end
end

-- \\ ������ ����� �� ������ ������ ������� ����� ������� �����


if color == 0x31B404FF and string.find(text, "^[A-z0-9_]+ ������� ����� ���")
then
return { 0xDDDDDDFF, text }
end

do -- \\ ������ ������ ����� /vr ����


local ad_tag = "^%[?�?�?�?�?�?�?�?%]?%s?"
-- if ad_tag ~= "" then return false end -- �������� ���������
��������� /vr
if string.find(text, ad_tag .. "%[VIP%]") and color == 1687547391 then
return { 0x2FAA5BFF, text }
end

if string.find(text, ad_tag .. "%[PREMIUM%]") and color == -213517057


then
return { 0xFFAA00FF, text }
end

if string.find(text, ad_tag .. "%[ADMIN%]") and color == -54114817 then


return { 0xFF4040FF, text }
end
end

do -- \\ ����� ������������� ��������� � ��� ��� ������� ���


local sec = string.match(text, "^�� ���������. ��������� ���� ��������
(%d+) ������")
if sec ~= nil then
local end_mute = os.time() + tonumber(sec)
local get = function(count)
local normal = count + (86400 - os.date("%H", 0) * 3600)
if count < 3600 then
return os.date("%M:%S", normal)
else
return os.date("%H:%M:%S", normal)
end
end
text = string.gsub(text, "%d+ ������", get(end_mute -
os.time()) .. " (�� " .. os.date("%H:%M:%S", end_mute) .. ")")
return { color, text }
end
end

do -- \\ ����������� ����� ��� ��������� � ���� ������


local id, message = string.match(text, "^[A-z0-9_]+%[(%d+)%] �������:
{B7AFAF} (.+)")
if id ~= nil then
local clist = sampGetPlayerColor(tonumber(id))
local a, r, g, b = explode_argb(clist)
return { join_argb(r, g, b, a), text }
end
end

do -- \\ OOC ��� (\b) ����� ���������� ��� �������


local id, message = string.match(text, "^%(%( .+%[(%d+)%]: {B7AFAF}(.+)
{FFFFFF} %)%)$")
id = tonumber(id)
if id ~= nil and select(1, sampGetCharHandleBySampPlayerId(id)) then
message = string.format("(( {B7AFAF}%s{FFFFFF} ))", message)
if #message > 128 then message = "(( {B7AFAF}...{FFFFFF} ))" end
setPlayerChatBubble(id, -1, 15, 6000, message)
end
end
end

function setPlayerChatBubble(playerId, color, dist, duration, message)


local bs = raknetNewBitStream()
raknetBitStreamWriteInt16(bs, playerId)
raknetBitStreamWriteInt32(bs, color)
raknetBitStreamWriteFloat(bs, dist)
raknetBitStreamWriteInt32(bs, duration)
raknetBitStreamWriteInt8(bs, #message)
raknetBitStreamWriteString(bs, message)
raknetEmulRpcReceiveBitStream(59, bs)
raknetDeleteBitStream(bs)
end

function explode_argb(argb)
local a = bit.band(bit.rshift(argb, 24), 0xFF)
local r = bit.band(bit.rshift(argb, 16), 0xFF)
local g = bit.band(bit.rshift(argb, 8), 0xFF)
local b = bit.band(argb, 0xFF)
return a, r, g, b
end

function join_argb(a, r, g, b)
local argb = b
argb = bit.bor(argb, bit.lshift(g, 8))
argb = bit.bor(argb, bit.lshift(r, 16))
argb = bit.bor(argb, bit.lshift(a, 24))
return argb
end

Вам также может понравиться