Add Trading

This commit is contained in:
VegaZ
2018-12-26 22:59:15 +01:00
parent b3e12588cf
commit ec1cc4b237
7 changed files with 829 additions and 144 deletions

View File

@@ -38,7 +38,35 @@ namespace reallife_gamemode.Server.Events
GroundItem.PickUpGroundItem(player);
}
[RemoteEvent("keyPress:E")]
[RemoteEvent("keyPress:LEFT_ARROW")]
public void KeyPressLeftArrow(Client player)
{
if (!player.IsLoggedIn()) return;
List<Client> nearbyPlayers = NAPI.Player.GetPlayersInRadiusOfPlayer(3, player);
if (nearbyPlayers.Count > 0)
{
List<string> nearbyPlayerList = new List<string>();
foreach (Client nearPlayer in nearbyPlayers)
{
if (nearPlayer.Name != player.Name)
{
nearbyPlayerList.Add(nearPlayer.Name);
}
else
{
continue;
}
}
player.TriggerEvent("showPlayerInteraction", JsonConvert.SerializeObject(nearbyPlayerList));
}
else
{
player.SendNotification("~r~Es ist niemand in deiner N\u00e4he!", false);
}
}
[RemoteEvent("keyPress:E")]
public void KeyPressE(Client player)
{
if (!player.IsLoggedIn()) return;