GetScoreBoard

From NPC for VCMP 0.4 Servers
Revision as of 15:13, 30 December 2024 by Habi (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This function was added in v1.8 beta 5(not released as of 30.Dec.2024) and will not work on previous versions.


Description:
Gets the scoreboard along with ping of players.


Parameters:

process_scoreboard
process_scoreboard : A one parameter function like function(data) which will be called when scoreboard table arrives from server. On successful arrival, data will be an array of tables containing keys: ID,Score and Ping


Return Values:
true on success, false if scoreboard was already requested but it's not yet arrived.


Example

GetScoreBoard(function(data){ 
foreach(val in data)print("ID:"+val.ID+", Score: "+val.Score+", Ping: "+val.Ping+"\n");
});

Output: ID:0, Score: 200, Ping: 1