Jump to content

[Help]scoreboard-rank


eoLShady

Recommended Posts

call(getResourceFromName("scoreboard"),"scoreboardAddColumn","Rank",1,110)

function setRank()
for _,player in ipairs(getElementsByType("player")) do
if isGuestAccount(getPlayerAccount(player)) then
setElementData(player,"Rank","Guest")
elseif isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)),aclGetGroup("Admin")) then
setElementData(player,"Rank","Admin")
elseif isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)),aclGetGroup("Everyone")) then
setElementData(player,"Rank","Member")
    end
  end
end
setTimer(setRank,500,0)

----
I want a color on the scoreboard.
for example : Rank : #aa0000Admin
Helpme!

Link to comment

I might be wrong but doesnt adding the color code render the color in the scoreboard?

If so, just replace Admin with #aa0000Admin

 

Just a tip though, this does not need to be on a timer. You can use event such as onPlayerLogin , onPlayerLogout and onPlayerJoin to set a player's Rank.
This will prevent your server from running the same checks every 500 ms while also keeping it updated.

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