Jump to content

Make an scoreboard?


Recommended Posts

Posted

Hey all, i want to make a scoreboard. Yes...one that could load players, teams, if a player is on a team move it under team row.

What do i will need?

And how can i start?

"El conocimiento jamás debe detenerse, por que es lo único que nos salvará cuando no nos quede más".

Att: -|TG|-Mister[Q]<.

Posted

I think, i need to use:

getElementsByType

getPlayerName

getPlayerTeam

getTeamName

Sure?

"El conocimiento jamás debe detenerse, por que es lo único que nos salvará cuando no nos quede más".

Att: -|TG|-Mister[Q]<.

Posted

Bonsai, why you always say that i cant? Just if you dont wanna help just ignore my post ...

"El conocimiento jamás debe detenerse, por que es lo único que nos salvará cuando no nos quede más".

Att: -|TG|-Mister[Q]<.

Posted

Out from this pointless confrontation that you're having over here, I recommend you to begin with the following piece of code:

local scoreboard = {data = {}} 
function scoreboard:generate () 
    local data = {players = {}, teams = {}) 
    for i,v in ipairs(getElementsByType("team")) do 
        data.teams[v] = {} 
    end 
    for i,v in ipairs(getElementsByType("player")) do 
        local team = getPlayerTeam(v) 
        if not team then 
            table.insert(data.players, v) 
        else 
            table.insert(data.teams[team], v) 
        end 
    end 
    self.data = data 
end 

Once held all the necessary data on a table, you will simply need to use dx functions whilst looping over it.

Posted
Bonsai, why you always say that i cant? Just if you dont wanna help just ignore my post ...

Because its always the same.

You ask what functions you have to use.

Someone posts them.

After that you ask for an example, whatever you mean by that.

But it feels like you never actually finish something, considering your skills don't seem to improve at all.

I would like to help you, but you always ask this weird questions.

You should at least have tried something on your own before you post here, so you can ask about some specific problem.

Posted

How to make arithmetic with this string?

code:

function addHeight(extra) 
extraHeight = extraHeight + extra 
end 
addCommandHandler("addh", addHeight) 

"El conocimiento jamás debe detenerse, por que es lo único que nos salvará cuando no nos quede más".

Att: -|TG|-Mister[Q]<.

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