Scoreboard fix for console check and typo

This commit is contained in:
Vortrex
2020-12-26 02:01:24 -06:00
parent fc56cc10ef
commit 8b99a5ce72

View File

@@ -34,46 +34,48 @@ addEventHandler("OnDrawnHUD", function (event) {
let clients = getClients(); let clients = getClients();
for(let i in clients) { for(let i in clients) {
let name = element.name; if(!clients[i].console) {
let colour = COLOUR_WHITE; let name = clients[i].name;
let paused = false; let colour = COLOUR_WHITE;
let ping = "-1"; let paused = false;
let ping = "-1";
if(typeof playerNames[clients[i].name] != "undefined") {
name = playerNames[clients[i].name]; if(typeof playerNames[clients[i].name] != "undefined") {
} name = playerNames[clients[i].name];
}
if(typeof playerPaused[clients[i].name] != "undefined") {
paused = playerPaused[clients[i].name]; if(typeof playerPaused[clients[i].name] != "undefined") {
} paused = playerPaused[clients[i].name];
}
if(typeof playerColours[clients[i].name] != "undefined") { if(typeof playerColours[clients[i].name] != "undefined") {
colour = playerColours[clients[i].name]; colour = playerColours[clients[i].name];
} }
if(typeof playerPing[element.name] != "undefined") { if(typeof playerPing[clients[i].name] != "undefined") {
ping = toString(playerPing[element.name]); ping = toString(playerPing[clients[i].name]);
} }
// Player ID // Player ID
let text = String(clients[i].index); let text = String(clients[i].index);
let size = listFont.measure(text, 75, 0.0, 1.0, 10, false, false); let size = listFont.measure(text, 75, 0.0, 1.0, 10, false, false);
listFont.render(text, [game.width/2-100, scoreboardStart + (i*20)], 0, 0.5, 0.0, listFont.size, COLOUR_WHITE, false, false, false, true); listFont.render(text, [game.width/2-100, scoreboardStart + (i*20)], 0, 0.5, 0.0, listFont.size, COLOUR_WHITE, false, false, false, true);
// Player Name // Player Name
text = name; text = name;
size = listFont.measure(text, 100, 0.0, 1.0, 10, false, false); size = listFont.measure(text, 100, 0.0, 1.0, 10, false, false);
listFont.render(text, [game.width/2, scoreboardStart + (i*20)], 0, 0.5, 0.0, listFont.size, colour, false, false, false, true); listFont.render(text, [game.width/2, scoreboardStart + (i*20)], 0, 0.5, 0.0, listFont.size, colour, false, false, false, true);
// Ping // Ping
text = ping; text = ping;
size = listFont.measure(ping, 75, 0.0, 1.0, 10, false, false); size = listFont.measure(ping, 75, 0.0, 1.0, 10, false, false);
listFont.render(ping, [game.width/2+100, scoreboardStart + (i*20)], 0, 0.5, 0.0, listFont.size, COLOUR_WHITE, false, false, false, true); listFont.render(ping, [game.width/2+100, scoreboardStart + (i*20)], 0, 0.5, 0.0, listFont.size, COLOUR_WHITE, false, false, false, true);
// PAUSED Status (depends on resource "afk") // PAUSED Status (depends on resource "afk")
if(paused == true) { if(paused == true) {
size = listFont.measure("PAUSED", 100, 0.0, 1.0, 10, false, false); size = listFont.measure("PAUSED", 100, 0.0, 1.0, 10, false, false);
listFont.render("PAUSED", [game.width/2+200, scoreboardStart + (i*20)], 0, 0.5, 0.0, listFont.size, pausedColour, false, false, false, true); listFont.render("PAUSED", [game.width/2+200, scoreboardStart + (i*20)], 0, 0.5, 0.0, listFont.size, pausedColour, false, false, false, true);
}
} }
} }
} }