Jump to content

Antiinsult


Recommended Posts

Posted

It must be only for normal message.

Insults = { 
    -- Note: USE lowercase LETTERS 
    -- Format: { "Insult Word", "Replace Word" }, 
    { "bitch", "cow" }, 
} 
  
function chatL ( msg, msgType ) 
    if (not msgType == 0) then return end 
     
    for k,v in ipairs (Insults) do 
        if string.find( string.lower ( msg ),v[1]) then 
            msg = msg:gsub ( msg, v[2] ) 
        end 
    end 
    cancelEvent ( ) 
    outputChatBox(getPlayerName ( source )..": #ffffff"..msg,root,0,255,0,true) 
end 
addEventHandler( "onPlayerChat", getRootElement(), chatL ) 

Please do not PM me with scripting related question nor support, use the forums instead.

Posted
You can remove the chat part from it.

How? and in any file?

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted

At "fr_server.lua".

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Ok i openned what part i have to remove?

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted

What you mean?

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted

It will crash the script and freeroam.

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted

Open fr_server.lua and replace this (at line 399):

addEventHandler('onPlayerChat', g_Root, 
    function(msg, type) 
        if type == 0 then 
            cancelEvent() 
            local r, g, b = getPlayerNametagColor(source) 
            outputChatBox(getPlayerName(source) .. '#FFFFFF: #FFFFFF' .. msg:gsub('#%x%x%x%x%x%x', ''), g_Root, r, g, b, true) 
            outputServerLog( "CHAT: " .. getPlayerName(source) .. ": " .. msg ) 
        end 
    end 
) 

For this:

Insults = { 
    -- Note: USE lowercase LETTERS 
    -- Format: { "Insult Word", "Replace Word" }, 
    { "bitch", "cow" }, 
} 
  
function chatL ( msg, msgType ) 
    if (not msgType == 0) then return end 
    
    for k,v in ipairs (Insults) do 
        if string.find( string.lower ( msg ),v[1]) then 
            msg = msg:gsub ( msg, v[2] ) 
        end 
    end 
    cancelEvent ( ) 
    outputChatBox(getPlayerName ( source )..": #ffffff"..msg,root,0,255,0,true) 
end 
addEventHandler( "onPlayerChat", getRootElement(), chatL ) 

Please do not PM me with scripting related question nor support, use the forums instead.

Posted

still not working :(

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted
still not working :(

Ok, try to delete at the line 399 in the freeroam file

Delete this:

addEventHandler('onPlayerChat', g_Root, 
    function(msg, type) 
        if type == 0 then 
            cancelEvent() 
            local r, g, b = getPlayerNametagColor(source) 
            outputChatBox(getPlayerName(source) .. '#FFFFFF: #FFFFFF' .. msg:gsub('#%x%x%x%x%x%x', ''), g_Root, r, g, b, true) 
            outputServerLog( "CHAT: " .. getPlayerName(source) .. ": " .. msg ) 
        end 
    end 
) 

To Visit Us

Press Here: mtasa://5.9.206.180:22002

b648040241b8f01.png

0d0a7bb38ca13e5.png

Posted

Wont work, and don't worry i fixed it my self ;) Thank you all

Special thanks to

@FatalTeror

@iMr.3a[Z]eF

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

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