Jump to content

scoreboard help


Recommended Posts

hey everyone, i want to make an ID column in the scoreboard but the problem is that i want it to be before the 'name' column so i tried some of the functions that are already exist with the scoreboard mod but none worked.. here is the code:

  
    -- server 
    exports['scoreboard']:scoreboardSetColumnPriority( "name" , 2 ) 
    exports['scoreboard']:scoreboardAddColumn( "id" , getRootElement() , 20, "id" , 1 ) 
  

and no errors..

Link to comment
  • Moderators

From the wiki page for scoreboardAddColumn :

int priority = slot after "name" column ]

So it basically mean you can't put it before the name column.

You will have to modify the scoreboard resource to be able to support such modification or just to add directly the id column directly in the render function using the name column as example.

I'll give it a look later and do a fork of this script to support this.

Link to comment
From the wiki page for scoreboardAddColumn :
int priority = slot after "name" column ]

So it basically mean you can't put it before the name column.

You will have to modify the scoreboard resource to be able to support such modification or just to add directly the id column directly in the render function using the name column as example.

I'll give it a look later and do a fork of this script to support this.

well take a look at this:

jhfxcn.jpg

here is the code:

  
    --server 
    exports['scoreboard']:scoreboardSetColumnPriority( "name" , 2 , getRootElement() ) 
    exports['scoreboard']:scoreboardAddColumn( "id" , getRootElement() , 20, "id" , 1 ) 
    exports['scoreboard']:scoreboardAddColumn( "job" , getRootElement() , 20, "job" , 3 ) 
  

i took a look at the scoreboard_client.lua script but i couldn't find the part that defines the priority of the name column.. i think i should just add the id column directly as you said to the script, i will try that out.

Link to comment
exports['scoreboard']:scoreboardSetColumnPriority( "Name" , 2) -- here should be uppercase Name 
exports['scoreboard']:scoreboardAddColumn( "id" , root , 20, "id" , 1 ) 

I've tryed stuff and that works

Proof:

6b3c6e2ee0e6a4e5330fba1f171444e6.png

i tried your way (upper-casing the first letter) but it didn't work. :/

result is the same as my previous post

Link to comment
i tried your way (upper-casing the first letter) but it didn't work. :/

result is the same as my previous post

Try removing a priority at job like

exports['scoreboard']:scoreboardAddColumn( "job" , getRootElement() , 20, "job") 

Worked .. Thanks!

i removed all the priorities of the columns except for the id column, i set it to 1.

here is the code:

  
    exports['scoreboard']:scoreboardSetColumnPriority( "name" , 2 , root ) 
    exports['scoreboard']:scoreboardAddColumn( "id" , root , 20, "id", 1 ) 
    exports['scoreboard']:scoreboardAddColumn( "job", getRootElement() , 70 , "job" ) 
    -- other columns that i don't wanna show... 
  

Link to comment
  • Moderators
well take a look at this:

jhfxcn.jpg

here is the code:

  
    --server 
    exports['scoreboard']:scoreboardSetColumnPriority( "name" , 2 , getRootElement() ) 
    exports['scoreboard']:scoreboardAddColumn( "id" , getRootElement() , 20, "id" , 1 ) 
    exports['scoreboard']:scoreboardAddColumn( "job" , getRootElement() , 20, "job" , 3 ) 
  

.

Next time, you will provide the screenshot earlier, you won't cut part of the code involved in your problem and you won't say the priority isnt working when it's obviously working. Thanks.

Link to comment
well take a look at this:

jhfxcn.jpg

here is the code:

  
    --server 
    exports['scoreboard']:scoreboardSetColumnPriority( "name" , 2 , getRootElement() ) 
    exports['scoreboard']:scoreboardAddColumn( "id" , getRootElement() , 20, "id" , 1 ) 
    exports['scoreboard']:scoreboardAddColumn( "job" , getRootElement() , 20, "job" , 3 ) 
  

.

Next time, you will provide the screenshot earlier, you won't cut part of the code involved in your problem and you won't say the priority isnt working when it's obviously working. Thanks.

Dude, chill! it wasn't working and you know that, and why would i post this topic if its "obviously working"? i didn't lie .. the set priority function wasn't doing any effect on the column that what i meant with not working !. And Yes i will cut the code that involved to my problem, what do you expect ? to show you my whole 1265 lines of my gamemode's main server script?.

Thanks to all of you, again.

Link to comment
  • Moderators

Sorry, I didn't mean't to be mean. It's just that I was looked like a lier because you didn't provide the usefull screenshot you provided at the begining and you also removed this line:

exports['scoreboard']:scoreboardAddColumn( "job" , getRootElement() , 20, "job" , 3 ) 

Which was the code I was talking about by saying "part of the code involved" because it was obviously doing stuff highly related to your problem according to your screenshot.

You said that you were trying to put the id column before (so on the left of) the name column and that it didn't work. So I thought the id column was still placed after the name column (so on the right of it).

But we could see in the screenshot that it DID work. That's why you said you were lying since the priority for the id column was totally working.

I also read the wiki and it didn't provide accurate details on the priority attributes on the columns.

So yeah based, on what you said, the 2 lines of code you gave us and the what was written on the wiki page, I ended with the wrong diagnosis.

I wouldn't say it wasn't possible yet if you had link the screenshot in the initial post.

It was more like advices for your next help requests than blaming you.

Hope you won't mind.

Regards,

Citizen

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