Jump to content

outputchatbox | ACL GROUP | HELP !


Annas

Recommended Posts

i have a RPG server , and i try to made a ACL GROUP NAMED 'Supporters"

i try to make a chat for them (if you are in acl group "Supporters" then you can chat in it by pressing "./sup TEXT" and if you are not in acl group "Supporters" you cant see this chat ..

i made this code but not working

(members in acl supporter can talk with it) (WORKING)

(normal members can see the supporter chat :( (HELP ME)

i wish you understand me ..

THE CODE :

SERVER SIDE :

function adminPrivateChat(plr, cmd, ...) 
    local accName = getAccountName ( getPlayerAccount ( plr ) ) 
    if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Supporters" ) ) then 
        local message = table.concat({...}, " ") 
        for index, players in pairs(getElementsByType("player")) do 
            if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Supporters" ) ) then 
                outputChatBox("#000000(CST Supporter) "..getPlayerName(plr).. ": #FFFFFF"..message, players, 255, 255, 255, true) 
            end 
        end 
    end 
end 

Link to comment

Try this it should work

function adminPrivateChat(plr, cmd, ...) 
    local accName = getAccountName ( getPlayerAccount ( plr ) ) 
    if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Supporters" ) ) then 
        local message = table.concat({...}, " ") 
        for index, players in pairs(getElementsByType("player")) do 
            if isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(players)), aclGetGroup ( "Supporters" ) ) then 
                outputChatBox("#000000(CST Supporter) "..getPlayerName(plr).. ": #FFFFFF"..message, players, 255, 255, 255, true) 
            end 
        end 
    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...