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

@@ -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);