diff --git a/ReallifeGamemode.Client/Gui/playerlist.ts b/ReallifeGamemode.Client/Gui/playerlist.ts index a674b624..454b0df0 100644 --- a/ReallifeGamemode.Client/Gui/playerlist.ts +++ b/ReallifeGamemode.Client/Gui/playerlist.ts @@ -25,7 +25,7 @@ export default function playerList(globalData: IGlobalData): void { 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)}',${JSON.stringify(player.FactionName)},'${JSON.stringify(player.Ping)}');`); }); } }); diff --git a/ReallifeGamemode.Client/assets/html/Playerlist/Tabliste.html b/ReallifeGamemode.Client/assets/html/Playerlist/Tabliste.html index 33d0bb9b..764b197a 100644 --- a/ReallifeGamemode.Client/assets/html/Playerlist/Tabliste.html +++ b/ReallifeGamemode.Client/assets/html/Playerlist/Tabliste.html @@ -16,7 +16,6 @@ ID Spielername - Level Fraktion Ping diff --git a/ReallifeGamemode.Client/assets/html/Playerlist/script.js b/ReallifeGamemode.Client/assets/html/Playerlist/script.js index 5cd805e7..2a0e2c30 100644 --- a/ReallifeGamemode.Client/assets/html/Playerlist/script.js +++ b/ReallifeGamemode.Client/assets/html/Playerlist/script.js @@ -1,7 +1,7 @@ -function ad_row(id, name, level, faction, ping) { +function ad_row(id, name, faction, ping) { var table_id = "t1"; var table = document.getElementById(table_id); var rows = table.getElementsByTagName('tr').length; @@ -10,17 +10,13 @@ function ad_row(id, name, level, faction, ping) { var td2 = document.createElement('td'); var td3 = document.createElement('td'); var td4 = document.createElement('td'); - var td5 = document.createElement('td'); - var test = level; - var test2 = faction; + var test = faction; td1.innerHTML = ''+id; td2.innerHTML = name.slice(1, -1); - td3.innerHTML = 'WIP'; - td4.innerHTML = 'WIP'; - td5.innerHTML = ''+ping; + td3.innerHTML = ''+faction; + td4.innerHTML = ''+ping; tr.appendChild(td1); tr.appendChild(td2); tr.appendChild(td3); tr.appendChild(td4); - tr.appendChild(td5); } \ No newline at end of file diff --git a/ReallifeGamemode.Server/Events/Key.cs b/ReallifeGamemode.Server/Events/Key.cs index c600cabc..2ec51b14 100644 --- a/ReallifeGamemode.Server/Events/Key.cs +++ b/ReallifeGamemode.Server/Events/Key.cs @@ -609,16 +609,17 @@ namespace ReallifeGamemode.Server.Events } [RemoteEvent("keyPress:O")] - public void KeyPressJ(Player player) + public void KeyPressO(Player player) { if (!player.IsLoggedIn()) return; List players = NAPI.Pools.GetAllPlayers(); - var listPlayers = players.Select(p => new - { - Id = p.Handle.Value, - p.Name, - p.Ping, - }); + var listPlayers = players.Select(p => new + { + Id = p.Handle.Value, + p.Name, + p.Ping, + FactionName = p.GetUser().Faction.Name, + }) ; player.TriggerEvent("showPlayerlist", JsonConvert.SerializeObject(listPlayers)); }