Jump to content

please help me in bad words


ABu-ALi_

Recommended Posts

hi all

i try to make script bad words

but not working :(

this code server:

function BadWords ( message, messageType ) 
    if message == fuck then 
        setPlayerMuted(source, true) 
        outputChatBox ( getPlayerName ( source ).." has mute bad words", getRootElement(), 255, 255, 0, true ) 
    end 
end 
addEventHandler ( "onPlayerChat", getRootElement(), BadWords ) 

if player say 'fuck' he will mute

but this code not working :(

please help me :(

Link to comment
function BadWords ( message, messageType ) 
    if message == ':O' then 
        setPlayerMuted(source, true) 
        outputChatBox ( getPlayerName ( source ).." has mute bad words", getRootElement(), 255, 255, 0, true ) 
    end 
end 
addEventHandler ( "onPlayerChat", getRootElement(), BadWords ) 

Link to comment
  
Bad = {":O", "fuck"} 
  
function BadWords ( message, messageType ) 
    local Findingdots = string.gsub(message, "([%s%_%*%+%?%.%(%)%[%]%{%}%\%/%|%^%$%-])", '') 
    for i, Findingbad in ipairs(Bad) do 
        if string.find( message, Findingbad) then 
            setPlayerMuted(source, true) 
            outputChatBox ( getPlayerName ( source ).." has mute bad words", getRootElement(), 255, 255, 0, true ) 
        elseif string.find( Findingdots, Findingbad) then 
            setPlayerMuted(source, true) 
            outputChatBox ( getPlayerName ( source ).." has mute bad words", getRootElement(), 255, 255, 0, true ) 
        end 
    end 
end 
addEventHandler ( "onPlayerChat", getRootElement(), BadWords ) 
  

Edited by Guest
Link to comment
  • Moderators
 

Bad = {":O", ":O"}

 

function BadWords ( message, messageType )

    local Findingdots = string.gsub(message, "([%s%_%*%+%?%.%(%)%[%]%{%}%\%/%|%^%$%-])", '')

    for i, Findingbad in ipairs(Bad) do

        if string.find( message, Findingbad) then

            setPlayerMuted(source, true)

            outputChatBox ( getPlayerName ( source ).." has mute bad words", getRootElement(), 255, 255, 0, true )

        elseif string.find( Findingdots, Findingbad) then

            setPlayerMuted(source, true)

            outputChatBox ( getPlayerName ( source ).." has mute bad words", getRootElement(), 255, 255, 0, true )

        end

    end

end

addEventHandler ( "onPlayerChat", getRootElement(), BadWords )

 [code]

Epic fail ^^ but very nice code if it works :mrgreen:

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...