Add Trading
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user