local lower, sub, char, upper = string.lower, string.sub, string.char, string.upper
local concat = table.concat
-- initialization table
local lu_rus, ul_rus = {}, {}
for i = 192, 223 do
local A, a = char(i), char(i + 32)
ul_rus[A] = a
lu_rus[a] = A
end
local E, e = char(168), char(184)
ul_rus[E] = e
lu_rus[e] = E
function string.nlower(s)
s = lower(s)
local len, res = #s, {}
for i = 1, len do
local ch = sub(s, i, i)
res[i] = ul_rus[ch] or ch
end
return concat(res)
end
local tb = {
'куплю',
'покупаю',
'скупаю',
'продам',
'продаю',
'возьму',
'сдам' -- и так далее
}
function samp.onServerMessage(color, text)
text = string.nlower(text)
if status_script then
for i = 1, #tb do
if text:find(tb[i]) then
return false
end
end
end
end