Jump to content

censorship help!


Try

Recommended Posts

Posted

Hello Guys!

Im scripting for BadWolf Server Clan!

I need a little help

The server have a Tags Script and when i put cancelEvent() at the censorship it don't cancel cuz the script

What i can do?

Posted

The Script im making trouble add tag for the players like [Admin] [Mod] ... and my censorship i made don't cancel the world cuz its a output from other script

Posted

Change line 415 in freeroam/fr_server.lua

addEventHandler('onPlayerChat', g_Root, 
    function(msg, type) 
  if type == 0 then 
    cancelEvent() 
    local account = getPlayerAccount(source) 
    local r, g, b = getPlayerNametagColor(source) 
    local name = getPlayerName(source) 
    local msg = msg:gsub('#%x%x%x%x%x%x', '') 
    if isObjectInACLGroup( 'user.'..getAccountName( account ), aclGetGroup( 'Admin' ) ) then   
      outputChatBox( "#FF0000[Admin]" .. name .. '#FFFFFF: #FFFFFF' .. msg, g_Root, r, g, b, true) 
    elseif isObjectInACLGroup( 'user.'..getAccountName( account ), aclGetGroup( 'Moderator' ) ) then   
      outputChatBox( "#FF8000[Moderator]" .. name .. '#FFFFFF: #FFFFFF' .. msg, g_Root, r, g, b, true) 
    elseif isObjectInACLGroup( 'user.'..getAccountName( account ), aclGetGroup( 'Member' ) ) then 
      outputChatBox( "#00FF00[Member]" .. name .. '#FFFFFF: #FFFFFF' .. msg, g_Root, r, g, b, true) 
   else   
      outputChatBox( "#FFFF00[Guest]" .. name .. '#FFFFFF: #FFFFFF' .. msg, g_Root, r, g, b, true) 
   end 
  end 
end 
) 

Posted
Change line 415 in freeroam/fr_server.lua
addEventHandler('onPlayerChat', g_Root, 
    function(msg, type) 
  if type == 0 then 
    cancelEvent() 
    local account = getPlayerAccount(source) 
    local r, g, b = getPlayerNametagColor(source) 
    local name = getPlayerName(source) 
    local msg = msg:gsub('#%x%x%x%x%x%x', '') 
    if isObjectInACLGroup( 'user.'..getAccountName( account ), aclGetGroup( 'Admin' ) ) then   
      outputChatBox( "#FF0000[Admin]" .. name .. '#FFFFFF: #FFFFFF' .. msg, g_Root, r, g, b, true) 
    elseif isObjectInACLGroup( 'user.'..getAccountName( account ), aclGetGroup( 'Moderator' ) ) then   
      outputChatBox( "#FF8000[Moderator]" .. name .. '#FFFFFF: #FFFFFF' .. msg, g_Root, r, g, b, true) 
    elseif isObjectInACLGroup( 'user.'..getAccountName( account ), aclGetGroup( 'Member' ) ) then 
      outputChatBox( "#00FF00[Member]" .. name .. '#FFFFFF: #FFFFFF' .. msg, g_Root, r, g, b, true) 
   else   
      outputChatBox( "#FFFF00[Guest]" .. name .. '#FFFFFF: #FFFFFF' .. msg, g_Root, r, g, b, true) 
   end 
  end 
end 
) 

did you actually read my post? i said we have a chat script made not in freeroam

Posted
function onPlayerChatCensor(Text, Type) 
    ChatCensored = false 
     
    if Text == 'fuk' then 
        ChatCensored = true 
    end 
end 
addEventHandler('onPlayerChat', root, onPlayerChatCensor) 
  
function onPlayerChatCustom(Text, Type) 
    cancelEvent() 
    if ChatCensored then return end 
     
    outputChatBox(Text) 
end 
addEventHandler('onPlayerChat', root, onPlayerChatCustom) 

onPlayerChatCensor must be called before onPlayerChatCustom, so load censor script first, or if both are in same script call onPlayerChatCensor's addEventHandler first

  • MTA Team
Posted

Uisaqin, that is still a(n) (epic) fail. It's impossible if you don't use EXPORTS. Also you can use "return".

Try - I don't think The_GTA gave you the player controller to release it on the community to claim ownership, The_GTA made it all and I recommend you add him as an owner too.

Posted
Uisaqin, that is still a(n) (epic) fail. It's impossible if you don't use EXPORTS. Also you can use "return".

epic fail. ok.

No one mentioned anything about separate resources or exports, just separate scripts.

Dunno what your saying about using return, i was demonstrating how to stop an event's execution from another, as im guessing cancelEvent() will not stop the next event functions being called. Not that it should, of course.

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