Fix online list show faction
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user