DeadTeamRacing Posted March 1, 2011 Share Posted March 1, 2011 Okey I have dxscoreboard and i have only ping in it so i am asking how to add more things like ID State like (dead waiting not ready or alive) then i have the res scorefps but it only works for the old scoreboard not for dx Thanks for help in advance Link to comment
proracer Posted March 1, 2011 Share Posted March 1, 2011 Use exports.scoreboard:scoreboardAddColumn More info here: https://wiki.multitheftauto.com/wiki/Resource:Dxscoreboard Link to comment
DeadTeamRacing Posted March 1, 2011 Author Share Posted March 1, 2011 So if i want a column named Fps with the res scorefps where should i put it and what should i put Link to comment
proracer Posted March 1, 2011 Share Posted March 1, 2011 (edited) So for example if you have FPS resource which saves element data with string: "FPS" you will do this... addEventHandler ( "onClientResourceStart", resourceRoot, function ( ) exports.scoreboard:scoreboardAddColumn ( "FPS" ) setElementData ( getLocalPlayer ( ), "FPS", 0 ) end ) -- please note that for to add column you must add it's name -- as same as the name when you set player's element data Edited March 1, 2011 by Guest Link to comment
DeadTeamRacing Posted March 1, 2011 Author Share Posted March 1, 2011 And how about state likee dead,alive,waiting,not ready And where i put this thing Link to comment
Castillo Posted March 1, 2011 Share Posted March 1, 2011 proracer, you are adding a column every time a player joins o_o Link to comment
Castillo Posted March 1, 2011 Share Posted March 1, 2011 and that if i'm right, it will add a column every time a resource is started. addEventHandler ( "onClientResourceStart", getRootElement(), function (resource) if resource == getThisResource() then exports.scoreboard:scoreboardAddColumn ( "FPS" ) setElementData ( getLocalPlayer ( ), "FPS", 0 ) end end ) Link to comment
proracer Posted March 1, 2011 Share Posted March 1, 2011 I also fixed that before ... DeadTeamRacing, doesn't DX Scoreboard have that columns as default? Link to comment
Moderators Citizen Posted March 1, 2011 Moderators Share Posted March 1, 2011 You have to create an element data like this: (Use the code of Solidsnake and add your element data:) addEventHandler ( "onClientResourceStart", getRootElement(), function (resource) if resource == getThisResource() then exports.scoreboard:scoreboardAddColumn ( "FPS" ) exports.scoreboard:scoreboardAddColumn ( "State" ) setElementData ( getLocalPlayer ( ), "FPS", 0 ) setElementData( getLocalPlayer ( ), "State", "Waiting" ) end end ) Add change his state whenever you want like this: setElementData( thePlayer, "State", "Alive" ) set it to "Alive" or "Waiting" or "Dead" Exemple: function onPlayerDead( ammo, attacker, weapon, bodypart ) setElementData( source, "State", "Dead" ) end addEventHandler( "onClientPlayerWasted", getRootElement(), onPlayerDead ) Link to comment
DeadTeamRacing Posted March 1, 2011 Author Share Posted March 1, 2011 im not sure if u understiid my point i just want that it shows whetever player is alive waiting or dead in the dxscoreboard Link to comment
Castillo Posted March 1, 2011 Share Posted March 1, 2011 What gamemode are you using? Link to comment
Moderators Citizen Posted March 1, 2011 Moderators Share Posted March 1, 2011 im not sure if u understiid my point i just want that it shows whetever player is alive waiting or dead in the dxscoreboard Yeah I understoud it The dxScoreboard make a getElementData each seconds ( maybe or 2 sec IDK ) so you just have to specify to your scoreboard the ElementData by this line: exports.scoreboard:scoreboardAddColumn( "theElementData" ) When the dxScoreboard knows the ElementData to get, you can: setElementData( thePlayer, "ElementData", theValue ) when and wherever you want and the scoreboard update the column automatically. That's right ? ( Maybe I'm wrong ? ) EDIT: I checked the dxscoreboard and I'm right Link to comment
Moderators Citizen Posted March 1, 2011 Moderators Share Posted March 1, 2011 ---------------------------------- Double Post: ---------------------------------- For the column ping in your scoreboard try this: add this with the others exports.scoreboard:scoreboardAddColumn: exports.scoreboard:scoreboardAddColumn( "PING" ) and put it anywhere: function refreshPing() local ping = getPlayerPing( getLocalPlayer() ) setElementData( getLocalPlayer(), "PING", ping ) end setTimer( refreshPing, 2000, 0 ) and It might works Link to comment
DeadTeamRacing Posted March 1, 2011 Author Share Posted March 1, 2011 the ping is there already Link to comment
Moderators Citizen Posted March 1, 2011 Moderators Share Posted March 1, 2011 no only ping lol sorry, I undestood that you want only the ping . My bad Link to comment
TAPL Posted March 4, 2011 Share Posted March 4, 2011 loool i thinks what you need to do is this: change your resource name from dxscoreboard to scoreboard Link to comment
Deagle Posted April 5, 2011 Share Posted April 5, 2011 and that if i'm right, it will add a column every time a resource is started. addEventHandler ( "onClientResourceStart", getRootElement(), function (resource) if resource == getThisResource() then exports.scoreboard:scoreboardAddColumn ( "FPS" ) setElementData ( getLocalPlayer ( ), "FPS", 0 ) end end ) Where i add this ? Link to comment
CowTurbo Posted April 6, 2011 Share Posted April 6, 2011 ping collumn is default there. Link to comment
DeadTeamRacing Posted April 13, 2011 Author Share Posted April 13, 2011 Sorry i updated newset dxscrbrd and i use the res. score fps topic closed? 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