Jump to content

Проблема с string.lower


Recommended Posts

Доброго времени суток. Нужна ваша помощь. Проблема в том строка local messageS = string.lower(message) ничего не меняет. Что делать?

local badWords = { 
    {word = "один"}, 
    {word = "два"}, 
} 
  
function cWords(message, chatType) 
    if (chatType ~= 0) then return end 
    for i, badTable in pairs(badWords) do 
        local messageS = string.lower(message) 
        if (string.find(messageS, badTable.word)) then 
            local playerName = getPlayerName(source) 
            local r,g,b = getPlayerNametagColor(source) 
            setPlayerMuted(source, true) 
            setTimer(setPlayerMuted, 600000, 1, source, false) 
            outputChatBox (RGBToHex(r,g,b)..playerName.." #FFFFFFполучил мут на 10 минут", player, 0, 0, 0, true ) 
            outputDebugString(playerName.. " использовал слово >"..badTable.word.. "<", 3) 
            cancelEvent() 
            return 
        end 
    end 
end 
addEventHandler("onPlayerChat", root, cWords) 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...