DNL291 Posted July 28, 2013 Share Posted July 28, 2013 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 ) Link to comment
-.Paradox.- Posted July 28, 2013 Author Share Posted July 28, 2013 You can remove the chat part from it. How? and in any file? Link to comment
-.Paradox.- Posted July 28, 2013 Author Share Posted July 28, 2013 Ok i openned what part i have to remove? Link to comment
iMr.3a[Z]eF Posted July 29, 2013 Share Posted July 29, 2013 Why not set the code at the freeroam? Link to comment
iMr.3a[Z]eF Posted July 29, 2013 Share Posted July 29, 2013 I'm mean if you merge the codes with freeroam maybe it will works Link to comment
-.Paradox.- Posted July 29, 2013 Author Share Posted July 29, 2013 It will crash the script and freeroam. Link to comment
iMr.3a[Z]eF Posted July 29, 2013 Share Posted July 29, 2013 Oh ok do as Castillo said, post the freeroam the file "fr_server.lua" Link to comment
DNL291 Posted July 29, 2013 Share Posted July 29, 2013 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 ) Link to comment
iMr.3a[Z]eF Posted July 29, 2013 Share Posted July 29, 2013 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 ) Link to comment
-.Paradox.- Posted July 29, 2013 Author Share Posted July 29, 2013 Wont work, and don't worry i fixed it my self Thank you all Special thanks to @FatalTeror @iMr.3a[Z]eF Link to comment
xXMADEXx Posted July 29, 2013 Share Posted July 29, 2013 In the 'freeroam/fr_server.lua' the chat lines should be 401-422. Just remove those lines and it should work. Link to comment
iMr.3a[Z]eF Posted July 30, 2013 Share Posted July 30, 2013 Wont work, and don't worry i fixed it my self Thank you allSpecial thanks to @FatalTeror @iMr.3a[Z]eF You are very welcome. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now