Jump to content

Custom scoreboard column


CallumD

Recommended Posts

I am trying to add a column on scoreboard to show all players' wanted level. I have managed to add the column (called "wanted") but I don't get how to keep the column up-to-date with the latest wanted levels of every player. I get how to setElementData but I don't get how to trigger it. There is no event for when you become wanted.

Link to comment

i know this is not perfect, but it should work

function getwanted()
setTimer(dely, 100, 1)
local players = getElementsByType ( "player" ) 
for theKey,thePlayer in ipairs(players) do 
local level = getPlayerWantedLevel ( thePlayer )
setElementData ( thePlayer, "wanted", level )
end
end
function dely()
getwanted()
end
addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), getwanted )

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