Jump to content

Admin chat


Recommended Posts

function adminchat(thePlayer, ...) 
  
    local word = {...} 
    local message = table.concat(word, " ") 
     
    local account = getPlayerAccount ( thePlayer ) 
     
    if isObjectInACLGroup ( "user." .. getAccountName(account), aclGetGroup ( "Admin" ) )   then 
        outputChatBox ( "#C6FA78[Admin]" .. getPlayerName ( thePlayer ) .. ": " .. message, getRootElement(), 255, 255, 255, true ) 
    else 
        outputChatBox("#C6FA78No.", getRootElement(), 255, 255, 255, true) 
    end 
end 
  
addCommandHandler("a", adminchat) 

Worked, thanks! But it displays as: (color here)[Admin]Charlie: a test. And I didn't put that a there. Help!

As far as i know, you wont require a table, it only contains errors...

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