~DarkRacer~ Posted March 25, 2014 Share Posted March 25, 2014 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
Anubhav Posted March 25, 2014 Share Posted March 25, 2014 -- server exports['scoreboard']:scoreboardSetColumnPriority( "name" , 2 , root ) exports['scoreboard']:scoreboardAddColumn( "id" , root , 20, "id" , 1 ) You forget one argument of serverSetColumnPriority Link to comment
~DarkRacer~ Posted March 25, 2014 Author Share Posted March 25, 2014 -- server exports['scoreboard']:scoreboardSetColumnPriority( "name" , 2 , root ) exports['scoreboard']:scoreboardAddColumn( "id" , root , 20, "id" , 1 ) You forget one argument of serverSetColumnPriority Its optional and it didnt work Link to comment
Weii. Posted March 25, 2014 Share Posted March 25, 2014 exports['scoreboard']:scoreboardAddColumn( "id" , getRootElement() , 20, "id" , 0 ) Maybe this will work, happend to me before that I had column before name, I can't realy remember how I made it Link to comment
Moderators Citizen Posted March 25, 2014 Moderators Share Posted March 25, 2014 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
Weii. Posted March 25, 2014 Share Posted March 25, 2014 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: Link to comment
~DarkRacer~ Posted March 25, 2014 Author Share Posted March 25, 2014 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: 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
~DarkRacer~ Posted March 25, 2014 Author Share Posted March 25, 2014 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: 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
Weii. Posted March 25, 2014 Share Posted March 25, 2014 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") Link to comment
~DarkRacer~ Posted March 25, 2014 Author Share Posted March 25, 2014 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
~DarkRacer~ Posted March 25, 2014 Author Share Posted March 25, 2014 i have a question, is there a way to change the width of the name column? i took a look inside the resource script but its just too complicated i couldn't find that part. Link to comment
DNL291 Posted March 25, 2014 Share Posted March 25, 2014 exports['scoreboard']:scoreboardAddColumn(columnName, root, width) exports['scoreboard']:scoreboardSetColumnPriority(columnName, priority) Link to comment
Moderators Citizen Posted March 25, 2014 Moderators Share Posted March 25, 2014 well take a look at this: 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
~DarkRacer~ Posted March 26, 2014 Author Share Posted March 26, 2014 well take a look at this: 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 Citizen Posted March 27, 2014 Moderators Share Posted March 27, 2014 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now