File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -77,5 +77,22 @@ const examples = [
7777 ` ,
7878 dataSet : playerData
7979 } ,
80+ {
81+ name : 'Scoreboard of top players' ,
82+ description : 'Shows a top 5 of online players sorted by their zombie kills' ,
83+ input : `
84+ say "Top 5 players online by Kills:";
85+ {{!-- Sort the array of online players --}}
86+ {{#each (sort server.onlinePlayers "zombieKills" "desc")}}
87+ {{!-- @index is how many iterations we have done, so for a top 5 we only print when @index is smaller than 5 --}}
88+ {{#if (lt @index 5)}}
89+ say "{{this.name}} {{this.zombieKills}} Kills, {{this.deaths}} Deaths";
90+ say "KLR = {{round ( divide this.zombieKills (sum this.deaths 1)) 1}}";
91+ {{/if}}
92+ {{/each}}
93+ ` ,
94+ dataSet : playerData
95+ } ,
8096]
8197
98+
You can’t perform that action at this time.
0 commit comments