We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2ff51b9 commit c85c508Copy full SHA for c85c508
src/components/examples.js
@@ -77,5 +77,22 @@ const examples = [
77
`,
78
dataSet: playerData
79
},
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
+ },
96
]
97
98
+
0 commit comments