code formatiert
This commit is contained in:
@@ -23,7 +23,7 @@ namespace ReallifeGamemode.Server.Bank
|
||||
private static ColShape _colShape;
|
||||
private static ColShape _factioncolShape;
|
||||
public static Vector3 Position { get; }
|
||||
|
||||
|
||||
|
||||
public static void Setup()
|
||||
{
|
||||
@@ -61,8 +61,8 @@ namespace ReallifeGamemode.Server.Bank
|
||||
if (client.IsInVehicle || !client.IsLoggedIn()) return;
|
||||
|
||||
if (client.GetUser().FactionLeader == true)
|
||||
{
|
||||
client.TriggerEvent("showFactionBankMenuLeader", client.GetUser().Faction.BankAccount.Balance.ToString());
|
||||
{
|
||||
client.TriggerEvent("showFactionBankMenuLeader", client.GetUser().Faction.BankAccount.Balance.ToString());
|
||||
}
|
||||
client.TriggerEvent("showFactionBankMenu", client.GetUser().Faction.BankAccount.Balance.ToString());
|
||||
}
|
||||
@@ -125,19 +125,20 @@ namespace ReallifeGamemode.Server.Bank
|
||||
string nameOrId = (string)JsonConvert.DeserializeObject(jsonNameOrId);
|
||||
int amount = Int32.Parse(stringAmount);
|
||||
Player target = PlayerService.GetPlayerByNameOrId(nameOrId);
|
||||
|
||||
|
||||
using (var dbContext = new DatabaseContext())
|
||||
{
|
||||
if(player.GetUser(dbContext) == target.GetUser(dbContext))
|
||||
if (player.GetUser(dbContext) == target.GetUser(dbContext))
|
||||
{
|
||||
player.SendNotification($"~r~Du kannst dir selber kein Geld überweisen.");
|
||||
return;
|
||||
}else if(!target.IsLoggedIn())
|
||||
}
|
||||
else if (!target.IsLoggedIn())
|
||||
{
|
||||
player.SendNotification($"~r~Dieser Spieler ist nicht Online.");
|
||||
|
||||
}
|
||||
else if (amount <= 0 || (int)(amount*1.05) > player.GetUser(dbContext).BankAccount.Balance)
|
||||
else if (amount <= 0 || (int)(amount * 1.05) > player.GetUser(dbContext).BankAccount.Balance)
|
||||
{
|
||||
player.SendNotification($"~r~Dieser Betrag kann nicht überwiesen werden.");
|
||||
return;
|
||||
@@ -145,7 +146,7 @@ namespace ReallifeGamemode.Server.Bank
|
||||
else
|
||||
{
|
||||
player.SendNotification($"~w~Du hast {target.Name} $~g~{amount} ~w~Überwiesen.");
|
||||
player.GetUser(dbContext).BankAccount.Balance -= (int)(amount*1.05);
|
||||
player.GetUser(dbContext).BankAccount.Balance -= (int)(amount * 1.05);
|
||||
target.GetUser(dbContext).otheramount = amount;
|
||||
dbContext.SaveChanges();
|
||||
}
|
||||
@@ -204,5 +205,5 @@ namespace ReallifeGamemode.Server.Bank
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user