Perfect Posted April 25, 2014 Share Posted April 25, 2014 Hello, I am Currently using dxscoreboard and i downloaded some scripts which shows players kills/deaths/money on scoreboard But the problem is They are not in correct order. I mean i want them to be in after the column name. Name,Money,Kills,Deaths. If it provide any help, i look into those scripts and they use Scoreboard exported functions (not dxscoreboard). Can Someone Please Help Me ? Link to comment
Perfect Posted April 25, 2014 Author Share Posted April 25, 2014 Well, I didn't made this script. I download it from community. Here it is :- exports [ "scoreboard" ]:addScoreboardColumn ( "Money", 5 ) function updatePlayersMoney ( ) for index, player in ipairs ( getElementsByType "player" ) do setElementData ( player, "Money", getPlayerMoney ( player ) ) end -- End our loop. end -- End our function. setTimer ( updatePlayersMoney, 2500, 0 ) I want it in dxscoreboard and after name column (in 2nd column). Can You Help Me Please ? Link to comment
Karuzo Posted April 25, 2014 Share Posted April 25, 2014 name: The column name (also the element data name used to get information from). forElement: The player to who the column should be added for. width: Width of the column in pixels. friendlyName: Friendly name (displayed in the scoreboard) of the column. priority: The priority slot of the column (1-500). If slot isn't free, the column in that slot will be pushed forward. Just reading the wiki handles it. https://wiki.multitheftauto.com/wiki/Scoreboard Link to comment
Perfect Posted April 25, 2014 Author Share Posted April 25, 2014 name: The column name (also the element data name used to get information from). forElement: The player to who the column should be added for. width: Width of the column in pixels. friendlyName: Friendly name (displayed in the scoreboard) of the column. priority: The priority slot of the column (1-500). If slot isn't free, the column in that slot will be pushed forward. Just reading the wiki handles it. https://wiki.multitheftauto.com/wiki/Scoreboard I don't understand what its meant by forElement and Priority. And Which argument i can use for adding column 'money' in 2nd column (as it always shown in first column) Can You Please Provide Little Example For Adding Money In 2nd Column ? Link to comment
vx89 Posted April 25, 2014 Share Posted April 25, 2014 priority is basically the order, so if you want your new column as 2nd, then put 2. Or try neighbouring integers if that was a little off. If you are calling these functions server-side, then you can choose, if all players should see same columns, or some of them should see different columns, thats' what forElement is for. If you want all players to see same columns as everybody else, then just don't add forElement argument at all. Link to comment
alex17 Posted April 25, 2014 Share Posted April 25, 2014 exports.scoreboard:addScoreboardColumn('money',getRootElement(),2,45,'money') -- the first number is the order the second column size -- function updatePlayersMoney ( ) for index, player in ipairs ( getElementsByType "player" ) do setElementData ( player, "Money", getPlayerMoney ( player ) ) end -- End our loop. end -- End our function. setTimer ( updatePlayersMoney, 2500, 0 ) Link to comment
Perfect Posted April 26, 2014 Author Share Posted April 26, 2014 exports.scoreboard:addScoreboardColumn('money',getRootElement(),2,45,'money') -- the first number is the order the second column size -- function updatePlayersMoney ( ) for index, player in ipairs ( getElementsByType "player" ) do setElementData ( player, "Money", getPlayerMoney ( player ) ) end -- End our loop. end -- End our function. setTimer ( updatePlayersMoney, 2500, 0 ) Well, Thank You So Much For Doing It For me!! priority is basically the order, so if you want your new column as 2nd, then put 2. Or try neighbouring integers if that was a little off.If you are calling these functions server-side, then you can choose, if all players should see same columns, or some of them should see different columns, thats' what forElement is for. If you want all players to see same columns as everybody else, then just don't add forElement argument at all. Well, If i don't add forElement agument then it will think the next argument(width) is forElement, If i am right. scoreboardAddColumn ('Somename',somepixel,'somename',2) -- It will think 'somepixel' is forElement and 'somename' is width. Well Link to comment
Karuzo Posted April 26, 2014 Share Posted April 26, 2014 use root as the forelement.. Link to comment
Perfect Posted April 26, 2014 Author Share Posted April 26, 2014 use root as the forelement.. Yeah, I was thinking the same but when Alex17 said "If you want all players to see same columns as everybody else, then just don't add forElement argument at all." It confuses me. Well, can i just skip forelement and jump to other argument? Link to comment
vx89 Posted April 26, 2014 Share Posted April 26, 2014 Nope, you're correct, that you need to fill all the parameters to get to the one you want give a non-default value for. Link to comment
Perfect Posted April 28, 2014 Author Share Posted April 28, 2014 Nope, you're correct, that you need to fill all the parameters to get to the one you want give a non-default value for. Oh, Thanks For Information! 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