try pay when player is nearby target

This commit is contained in:
Michael
2020-06-06 12:28:30 +02:00
parent 9f52b2b559
commit 3e79992a33
3 changed files with 12 additions and 5 deletions

View File

@@ -184,8 +184,9 @@ namespace ReallifeGamemode.Server.Events
pay_amount = player.GetData<int>("pay_amount");
}
player.TriggerEvent("SERVER:InteractionMenu_OpenMenu", JsonConvert.SerializeObject(accountData), factionleader, faction, group, factionInvite, groupInvite, ticket_boolean, ticket_amount, pay_amount);
}
player.TriggerEvent("SERVER:InteractionMenu_OpenMenu", JsonConvert.SerializeObject(accountData), factionleader, faction, group, factionInvite, groupInvite, ticket_boolean, ticket_amount, pay_amount);
}
[RemoteEvent("keyPress:E")]
public void KeyPressE(Player player)

View File

@@ -611,6 +611,8 @@ namespace ReallifeGamemode.Server.Managers
int amount = Int32.Parse(stringAmount);
Player target = PlayerService.GetPlayerByNameOrId(nameOrId);
List<Player> nearbyPlayers = NAPI.Player.GetPlayersInRadiusOfPlayer(3, player);
if (target == null || !target.IsLoggedIn())
{
ChatService.PlayerNotFound(player);
@@ -620,6 +622,10 @@ namespace ReallifeGamemode.Server.Managers
{
player.SendNotification("~r~Du kannst dir selber kein Geld geben!");
}
else if(!nearbyPlayers.Contains(target))
{
player.SendNotification("~r~Dieser Spieler befindet sich nicht in deiner nähe!");
}
else
{
string playername = NAPI.Player.GetPlayerName(player);