add onlinewanteds in factionmenü

This commit is contained in:
michael.reiswich
2021-01-29 19:54:48 +01:00
parent 42b294d805
commit 88e7df88c2
6 changed files with 171 additions and 1 deletions

View File

@@ -672,6 +672,27 @@ namespace ReallifeGamemode.Server.Managers
}
}
[RemoteEvent("CLIENT:wantedlist")]
public void wantedlist(Player player)
{
if (!player.IsLoggedIn()) return;
List<Player> players = NAPI.Pools.GetAllPlayers();
if (player.GetUser().Wanteds > 0)
{
var listPlayers = players.Select(p => new
{
Id = p.Handle.Value,
p.Name,
wanted = p.GetUser().Wanteds,
}) ;
player.TriggerEvent("showWantedlist", JsonConvert.SerializeObject(listPlayers));
}
else
{
player.SendNotification("~r~[Fehler] ~w~Es gibt derzeitig keine Verbrecher!");
}
}
[RemoteEvent("CLIENT:InteractionMenu_FindHouse")]
public void InteractionMenu_House(Player player)
{