Jump to content

Global Chat Mut Problem


Tekken

Recommended Posts

Hi guys i added a mute verification on globalchat but is not working

function globalMessage(thePlayer, cmd, ...) 
        if isPlayerMuted ( playersource ) then 
            outputChatBox ("You are muted!", playersource, 255, 128, 22, true) 
            return 
        end 
        local message = table.concat ( { ... }, " " ); 
        local name = getPlayerName(thePlayer); 
        local account = getAccountName ( getPlayerAccount ( thePlayer ) ) 
        if isObjectInACLGroup("user." .. account, aclGetGroup("Admin")) then 
        outputChatBox("#DEFF00#FFFFFF"..name..": #FFFFFF"..message,root, 255, 255, 255, true) 
             return 
         
        end 
                 
        if isObjectInACLGroup("user." .. account, aclGetGroup("Moderator")) then 
        outputChatBox("#DEFF00#FFFFFF"..name..": #FFFFFF"..message,root, 255, 255, 255, true) 
             return 
        else 
        outputChatBox("#00E6FF#FFFFFF"..name..": #FFFFFF"..message,root, 255, 255, 255, true) 
             return        
        end 
    end 
    addCommandHandler("global",  globalMessage); 
      
    addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function() 
        for index,player in pairs(getElementsByType("player")) do 
            bindKey(player,"x", "down", "chatbox", "global"); 
        end 
    end) 
    addEventHandler("onPlayerJoin", getRootElement(), 
function() 
  bindKey(source, "x", "down", "chatbox", "global"); 
end 
)  

Link to comment
  
function globalMessage(thePlayer, cmd, ...) 
        if isPlayerMuted ( thePlayer ) then 
            outputChatBox ("You are muted!", thePlayer, 255, 128, 22, true) 
            return 
        end 
        local message = table.concat ( { ... }, " " ); 
        local name = getPlayerName(thePlayer); 
        local account = getAccountName ( getPlayerAccount ( thePlayer ) ) 
        if isObjectInACLGroup("user." .. account, aclGetGroup("Admin")) then 
        outputChatBox("#DEFF00#FFFFFF"..name..": #FFFFFF"..message,root, 255, 255, 255, true) 
             return 
        
        end 
                
        if isObjectInACLGroup("user." .. account, aclGetGroup("Moderator")) then 
        outputChatBox("#DEFF00#FFFFFF"..name..": #FFFFFF"..message,root, 255, 255, 255, true) 
             return 
        else 
        outputChatBox("#00E6FF#FFFFFF"..name..": #FFFFFF"..message,root, 255, 255, 255, true) 
             return       
        end 
    end 
    addCommandHandler("global",  globalMessage); 
      
    addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function() 
        for index,player in pairs(getElementsByType("player")) do 
            bindKey(player,"x", "down", "chatbox", "global"); 
        end 
    end) 
    addEventHandler("onPlayerJoin", getRootElement(), 
function() 
  bindKey(source, "x", "down", "chatbox", "global"); 
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...