Jump to content

[HELP] guiGridList


KoujiCM

Recommended Posts

Posted

Hello I would like to create list a of players,and wanted to do when player is in acl admin and smod his name appears in a different color than the others in the list

function createPlayerList ( ) 
    local playerList = guiCreateGridList ( 0.80, 0.10, 0.15, 0.60, true ) 
    local column = guiGridListAddColumn( playerList, "Player", 0.85 ) 
    if ( column ) 
        for id, player in ipairs ( getElementsByType ( "player" ) ) do 
            local row = guiGridListAddRow ( playerList ) 
            guiGridListSetItemText ( playerList, row, column, getPlayerName ( player ), false, false ) 
            guiGridListSetItemColor ( playerList, row, column, 255,0,0 ) 
        end 
    end 
end 
addEventHandler ( "onClientResourceStart", resourceRoot, createPlayerList ) 

Posted

You could either get the players server side and then send them to the client side to add them to the grid list, or you could set element data on each player, which would be the ACL the player is part of.

Posted
  
if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("Admin")) then 
   outputChatBox("Player is in ACL Admin") 
end 
  
if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("SuperModerator")) then 
   outputChatBox("Player is in ACL SuperModerator") 
end 
  

Now it's your turn :)

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