Jump to content

alc Group Show


Wei

Recommended Posts

exports [ "scoreboard" ]:addScoreboardColumn ( "Group" ) 
  
addEventHandler ( "onPlayerLogin", root, 
    function ( ) 
        setElementData ( source, "Group", aclGroupGetName ( aclGetGroup ( "Admin" ) ) ) 
    end 
) 

??

Link to comment
exports [ "scoreboard" ]:addScoreboardColumn ( "Group" ) 
  
addEventHandler ( "onPlayerLogin", root, 
    function ( ) 
        setElementData ( source, "Group", aclGroupGetName ( aclGetGroup ( "Admin" ) ) ) 
    end 
) 

??

Lol this says that anyone is admin for me because i have modyfied acl

Link to comment

Sorry, my mistake :/

exports [ "scoreboard" ]:addScoreboardColumn ( "Group" ) 
local group = "" 
  
addEventHandler ( "onPlayerLogin", root, 
    function ( _, account ) 
        if ( isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( account ) ), aclGetGroup ( "Admin" ) ) ) then 
            group = "Admin" 
        elseif ( isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( account ) ), aclGetGroup ( "Console" ) ) ) then 
            group = "Console" 
        elseif ( isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( account ) ), aclGetGroup ( "SuperModerator" ) ) ) then 
            group = "Super Moderator" 
        elseif ( isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( account ) ), aclGetGroup ( "Moderator" ) ) ) then 
            group = "Moderator" 
        end 
        setElementData ( source, "Group", tostring ( group ) ) 
    end 
) 

idk if is any function to get group name...

Link to comment
Sorry, my mistake :/
exports [ "scoreboard" ]:addScoreboardColumn ( "Group" ) 
local group = "" 
  
addEventHandler ( "onPlayerLogin", root, 
    function ( _, account ) 
        if ( isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( account ) ), aclGetGroup ( "Admin" ) ) ) then 
            group = "Admin" 
        elseif ( isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( account ) ), aclGetGroup ( "Console" ) ) ) then 
            group = "Console" 
        elseif ( isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( account ) ), aclGetGroup ( "SuperModerator" ) ) ) then 
            group = "Super Moderator" 
        elseif ( isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( account ) ), aclGetGroup ( "Moderator" ) ) ) then 
            group = "Moderator" 
        end 
        setElementData ( source, "Group", tostring ( group ) ) 
    end 
) 

idk if is any function to get group name...

Now it doesn't show anything ...

Link to comment
exports [ "scoreboard" ]:addScoreboardColumn ( "Group" ) 
local group = "" 
  
addEventHandler ( "onPlayerLogin", root, 
    function ( _, account ) 
        if ( isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( account ) ), aclGetGroup ( "Admin" ) ) ) then 
            group = "Admin" 
            setElementData ( source, "Group", tostring ( group ) ) 
        elseif ( isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( account ) ), aclGetGroup ( "Console" ) ) ) then 
            group = "Console" 
            setElementData ( source, "Group", tostring ( group ) ) 
        elseif ( isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( account ) ), aclGetGroup ( "SuperModerator" ) ) ) then 
            group = "Super Moderator" 
            setElementData ( source, "Group", tostring ( group ) ) 
        elseif ( isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( account ) ), aclGetGroup ( "Moderator" ) ) ) then 
            group = "Moderator" 
           setElementData ( source, "Group", tostring ( group ) ) 
        end 
    end 
) 

Link to comment
exports [ 'scoreboard' ]:addScoreboardColumn ( 'Group' ) 
  
addEventHandler ( 'onPlayerLogin', root, 
    function ( _, uAccount ) 
        local sGroup = 'None' 
        local sAccount = getAccountName ( uAccount ) 
        if isObjectInACLGroup ( 'user.' .. sAccount, aclGetGroup ( 'Admin' ) ) then 
            sGroup = 'Admin' 
        elseif isObjectInACLGroup ( 'user.' .. sAccount, aclGetGroup ( 'Console' ) ) then 
            sGroup = 'Console' 
        elseif isObjectInACLGroup ( 'user.' .. sAccount, aclGetGroup ( 'SuperModerator' ) ) then 
            sGroup = 'Super Moderator' 
        elseif isObjectInACLGroup ( 'user.' .. sAccount, aclGetGroup ( 'Moderator' ) ) then 
            sGroup = 'Moderator' 
        end 
        setElementData ( source, 'Group', sGroup ) 
    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...