From 7fb5f3abfa89f6fed0344b11bba04f9c36e443cf Mon Sep 17 00:00:00 2001 From: Fabian Fabian Date: Wed, 4 Sep 2019 22:45:20 +0200 Subject: [PATCH] added factionname in online list --- ReallifeGamemode.Client/Gui/playerlist.ts | 2 +- ReallifeGamemode.Client/assets/html/Playerlist/script.js | 2 +- ReallifeGamemode.Server/Events/Key.cs | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ReallifeGamemode.Client/Gui/playerlist.ts b/ReallifeGamemode.Client/Gui/playerlist.ts index e4be88ad..5e30dd01 100644 --- a/ReallifeGamemode.Client/Gui/playerlist.ts +++ b/ReallifeGamemode.Client/Gui/playerlist.ts @@ -16,7 +16,7 @@ export default function playerList() { mp.gui.cursor.show(true, true); pList = JSON.parse(playersJson); pList.forEach((player) => { - playerlistBrowser.execute(`ad_row('${JSON.stringify(player.Id)}','${JSON.stringify(player.Name)}',0,0,'${JSON.stringify(player.Ping)}');`); + playerlistBrowser.execute(`ad_row('${JSON.stringify(player.Id)}','${JSON.stringify(player.Name)}',0,'${JSON.stringify(player.fac)}','${JSON.stringify(player.Ping)}');`); }); } else { playerlistBrowser.destroy(); diff --git a/ReallifeGamemode.Client/assets/html/Playerlist/script.js b/ReallifeGamemode.Client/assets/html/Playerlist/script.js index 5cd805e7..3ddc1f80 100644 --- a/ReallifeGamemode.Client/assets/html/Playerlist/script.js +++ b/ReallifeGamemode.Client/assets/html/Playerlist/script.js @@ -16,7 +16,7 @@ function ad_row(id, name, level, faction, ping) { td1.innerHTML = ''+id; td2.innerHTML = name.slice(1, -1); td3.innerHTML = 'WIP'; - td4.innerHTML = 'WIP'; + td4.innerHTML = ''+faction; td5.innerHTML = ''+ping; tr.appendChild(td1); tr.appendChild(td2); diff --git a/ReallifeGamemode.Server/Events/Key.cs b/ReallifeGamemode.Server/Events/Key.cs index 642b01be..80b93763 100644 --- a/ReallifeGamemode.Server/Events/Key.cs +++ b/ReallifeGamemode.Server/Events/Key.cs @@ -304,7 +304,8 @@ namespace ReallifeGamemode.Server.Events { Id = p.Handle.Value, p.Name, - p.Ping + p.Ping, + fac = p.GetUser().Faction.Name }); player.TriggerEvent("showPlayerlist", JsonConvert.SerializeObject(listPlayers)); }