fix onlineliste
This commit is contained in:
@@ -617,29 +617,14 @@ namespace ReallifeGamemode.Server.Events
|
||||
{
|
||||
if (!player.IsLoggedIn()) return;
|
||||
List<Player> players = NAPI.Pools.GetAllPlayers();
|
||||
if(player.GetUser().Faction != null)
|
||||
{
|
||||
var listPlayers = players.Select(p => new
|
||||
{
|
||||
Id = p.Handle.Value,
|
||||
p.Name,
|
||||
p.Ping,
|
||||
FactionName = p.GetUser().Faction.Name,
|
||||
FactionName = p.GetUser().Faction?.Name ?? "Zivilist",
|
||||
}) ;
|
||||
player.TriggerEvent("showPlayerlist", JsonConvert.SerializeObject(listPlayers));
|
||||
}
|
||||
else
|
||||
{
|
||||
var listPlayers = players.Select(p => new
|
||||
{
|
||||
Id = p.Handle.Value,
|
||||
p.Name,
|
||||
p.Ping,
|
||||
FactionName = "Zivilist",
|
||||
});
|
||||
player.TriggerEvent("showPlayerlist", JsonConvert.SerializeObject(listPlayers));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[RemoteEvent("keyPress:K")]
|
||||
|
||||
Reference in New Issue
Block a user