Jump to content

DisableChat no work HELP ME


Recommended Posts

Hello, Well I want this command by typing / chat, it blocks the chat for users, but it does not.

Could someone help me? I know I do not have many bugs may be something small, more like I always say. I can not keep looking because I have no time to even write the topic takes a lot more help, someone?

function bbc(source) 
  local accName = getAccountName(getPlayerAccount(source)) 
  if isObjectInACLGroup("user."..accName, aclGetGroup("Admin")) then  
    if blockc == true then 
      outputChatBox("#FFFF00* GM "..getPlayerName(source).."#00FF00 normalizou o chat para demais usuários.", getRootElement(), 255, 255, 255, true) 
      blockc = false 
    else 
      outputChatBox("#FFFF00* GM "..getPlayerName(source).."#00FF00 trancou o chat para demais usuários.", getRootElement(), 255, 255, 255, true) 
      blockc = true    
    end 
  else 
    return outputChatBox("#ffff00Access denied.", source, 255, 255, 255, true) 
  end 
  return 0 
end 
addCommandHandler("chat", bbc) 

Link to comment
I don't understand what you said.
        function bbc(source) 
      local accName = getAccountName(getPlayerAccount(source)) 
      if isObjectInACLGroup("user."..accName, aclGetGroup("Admin")) then 
        if blockc == true then 
          outputChatBox("#FFFF00* GM "..getPlayerName(source).."#00FF00 normalizou o chat para demais usuários.", getRootElement(), 255, 255, 255, true) 
          blockc = false 
        else 
          outputChatBox("#FFFF00* GM "..getPlayerName(source).."#00FF00 trancou o chat para demais usuários.", getRootElement(), 255, 255, 255, true) 
          cancelEvent() 
          blockc = true   
        end 
      else 
        return outputChatBox("#ffff00Access denied.", source, 255, 255, 255, true) 
      end 
      return 0 
    end 
    addCommandHandler("chat", bbc) 

Edited by Guest
Link to comment
local blockc = false 
  
function bbc ( source ) 
    local accName = getAccountName ( getPlayerAccount ( source ) ) 
    if isObjectInACLGroup ( "user."..accName, aclGetGroup ( "Admin" ) ) then 
        if ( blockc == true ) then 
            outputChatBox ( "#FFFF00* GM ".. getPlayerName ( source ) .."#00FF00 normalizou o chat para demais usuários.", getRootElement(), 255, 255, 255, true ) 
            blockc = false 
        else 
            outputChatBox ( "#FFFF00* GM ".. getPlayerName ( source ) .."#00FF00 trancou o chat para demais usuários.", getRootElement(), 255, 255, 255, true ) 
            blockc = true   
        end 
    else 
        outputChatBox ( "#ffff00Access denied.", source, 255, 255, 255, true ) 
    end 
end 
addCommandHandler ( "chat", bbc ) 
  
addEventHandler ( "onPlayerChat", root, 
    function ( ) 
        if ( blockc ) then 
            cancelEvent ( ) 
        end 
    end 
) 

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