Resource:Scoreboard: Difference between revisions
Jump to navigation
Jump to search
m (Scoreboard moved to Resource:Scoreboard) |
m (setScoreboardForced is triggered from server and the function specified was the triggered clientside function.) |
||
Line 12: | Line 12: | ||
bool addScoreboardColumn( string columnName, [ element visibleToElement = getRootElement(), int columnPosition = #columns - 1, float columnSize = 0.1 ] ) | bool addScoreboardColumn( string columnName, [ element visibleToElement = getRootElement(), int columnPosition = #columns - 1, float columnSize = 0.1 ] ) | ||
bool removeScoreboardColumn( string columnName ) | bool removeScoreboardColumn( string columnName ) | ||
bool | bool setPlayerScoreboardForced( player thePlayer, bool forced ) | ||
table getScoreboardColumns( ) --returns an ordered array of {name=columnName,size=columnSize} entries | table getScoreboardColumns( ) --returns an ordered array of {name=columnName,size=columnSize} entries | ||
bool resetScoreboardColumns( ) --leaves only "name, ping" | bool resetScoreboardColumns( ) --leaves only "name, ping" |
Revision as of 09:12, 30 May 2008
The scoreboard displays connected players, teams, pings and other data in a gridlist for players ingame. It also has a javascript-enabled web interface, so it can be viewed from a browser.
When you add a column to the scoreboard, it's linked to the element data field of the same name, so if you add the "score" column, element data in the field "score" will be shown for all players and teams.
Exported serverside functions
You can call them from another resource using call():
call(getResourceFromName("scoreboard"), "addScoreboardColumn", "wanted level")
bool addScoreboardColumn( string columnName, [ element visibleToElement = getRootElement(), int columnPosition = #columns - 1, float columnSize = 0.1 ] ) bool removeScoreboardColumn( string columnName ) bool setPlayerScoreboardForced( player thePlayer, bool forced ) table getScoreboardColumns( ) --returns an ordered array of {name=columnName,size=columnSize} entries bool resetScoreboardColumns( ) --leaves only "name, ping"
Issues/TODO
- Columns name must be unique, you can't add a column with the same name to different elements yet
- Scoreboard data for web listing is being sent all at once, should allow sending of separate chunks