Jump to content

.


MR.KFO

Recommended Posts

Server side #

function isPlayerInGroup (plr, group)  
    if (plr and isElement (plr)) then 
        if (group and type (group) == "string" and aclGetGroup (group)) then 
            local acc = getPlayerAccount (plr) 
            if not isGuestAccount (acc) then 
                if isObjectInACLGroup ("user." .. getAccountName (acc), aclGetGroup (group)) then 
                    return true 
                else 
                    return false 
                end 
            else 
                return false 
            end 
        else 
            return false 
        end 
    else 
        return false 
    end 
end 
  
addEventHandler ("onPlayerLogin", root,  
    function () 
        if isPlayerInGroup (source, "KingServer") then 
            triggerClientEvent (source, "onAddPlayers", source, getPlayerName (source):gsub ("#%x%x%x%x%x%x", "")) 
        end 
    end 
) 
  
addEvent ("onGetPlayers", true) 
addEventHandler ("onGetPlayers", root,  
    function () 
        if isPlayerInGroup (source, "KingServer") then 
            triggerClientEvent (source, "onAddPlayers", source, getPlayerName (source):gsub ("#%x%x%x%x%x%x", "")) 
        end 
    end 
) 

Client side #

addEvent ("onAddPlayers",true) 
addEventHandler ("onAddPlayers", root,  
    function (name) 
        local Row = guiGridListAddRow (king) 
        guiGridListSetItemText (king, Row, 1, name, false, false) 
        guiGridListSetItemColor (king, Row, 1, 0, 255, 0) 
    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...