Jump to content

outputChatBox bug


Dice

Recommended Posts

Why isnt the chatbox coming out in color.

  
function adminChat(thePlayer, commandName, text) 
         local user = "user."..getAccountName ( getPlayerAccount ( thePlayer ) ) 
        local playerName = getPlayerName ( thePlayer ) 
         for id, player in ipairs ( aclGroupListObjects ( aclGetGroup ( "Admin" ) ) or  aclGroupListObjects ( aclGetGroup ( "SuperModerator" ) ) ) do 
            if player == user then 
                outputChatBox( "#FF0000[#CCCCCCAdmin#FF0000] #FF0000".. playerName.. "#CCCCCC: #FF0000"..text, player, 255, 255, 255, true) 
            end 
        end 
    end 
addCommandHandler( "achat", publicChat ) 
  

EDIT: matter of fact its not working at all...it just shows it to everyone not to admins only

Link to comment
function adminChat(thePlayer, commandName, text) 
         local user = "user."..getAccountName ( getPlayerAccount ( thePlayer ) ) 
        local playerName = getPlayerName ( thePlayer ) 
         for id, player in ipairs ( aclGroupListObjects ( aclGetGroup ( "Admin" ) ) or  aclGroupListObjects ( aclGetGroup ( "SuperModerator" ) ) ) do 
            if player == user then 
                outputChatBox( "#FF0000[#CCCCCCAdmin#FF0000] #FF0000".. playerName.. "#CCCCCC: #FF0000"..text, thePlayer, 255, 255, 255, true) 
            end 
        end 
    end 
addCommandHandler( "achat", publicChat ) 

Link to comment
function adminChat ( thePlayer, commandName, ... ) 
    local text = table.concat ( { ... }, " " ) 
    local playerName = getPlayerName ( thePlayer ) 
    for _, player in ipairs ( getElementsByType ( "player" ) ) do 
        local account = getAccountName ( getPlayerAccount ( player ) ) 
        if ( isObjectInACLGroup ( "user.".. account, aclGetGroup ( "Admin" ) ) or isObjectInACLGroup ( "user.".. account, aclGetGroup ( "SuperModerator" ) ) ) then 
            outputChatBox ( "#FF0000[#CCCCCCAdmin#FF0000] #FF0000".. playerName .."#CCCCCC: #FF0000".. text, player, 255, 255, 255, true ) 
        end 
    end 
end 
addCommandHandler ( "achat", publicChat ) 

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