Fix online list show faction

This commit is contained in:
CroniX
2021-01-23 17:06:09 +01:00
parent 9b5fcffdf6
commit dfc9be29c6
2 changed files with 11 additions and 10 deletions

View File

@@ -609,16 +609,17 @@ namespace ReallifeGamemode.Server.Events
if (!player.IsLoggedIn()) return;
using (var dbContext = new DatabaseContext())
{
string factionname = player.GetUser(dbContext).Faction.Name;
string FactionName;
List<Player> players = NAPI.Pools.GetAllPlayers();
var listPlayers = players.Select(p => new
{
Id = p.Handle.Value,
p.Name,
p.Ping,
}) ;
player.TriggerEvent("showPlayerlist", JsonConvert.SerializeObject(listPlayers), JsonConvert.SerializeObject(factionname));
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));
}
}