/car kaufpreis bei faction und usercar
This commit is contained in:
@@ -19,7 +19,8 @@ namespace ReallifeGamemode.Server.Commands
|
|||||||
internal class UserCommands : Script
|
internal class UserCommands : Script
|
||||||
{
|
{
|
||||||
[Command("rent", "~m~rent stop")]
|
[Command("rent", "~m~rent stop")]
|
||||||
public void CmdUserStopRent(Player player, String option = "") {
|
public void CmdUserStopRent(Player player, String option = "")
|
||||||
|
{
|
||||||
if (!player.IsLoggedIn()) return;
|
if (!player.IsLoggedIn()) return;
|
||||||
|
|
||||||
if (option != "stop")
|
if (option != "stop")
|
||||||
@@ -112,7 +113,8 @@ namespace ReallifeGamemode.Server.Commands
|
|||||||
using (var dbContext = new DatabaseContext())
|
using (var dbContext = new DatabaseContext())
|
||||||
{
|
{
|
||||||
User user = player.GetUser(dbContext);
|
User user = player.GetUser(dbContext);
|
||||||
if (user.BankAccount.Balance < 5) {
|
if (user.BankAccount.Balance < 5)
|
||||||
|
{
|
||||||
ChatService.ErrorMessage(player, "Dafür hast du nicht genug Geld auf deinem Bankkonto");
|
ChatService.ErrorMessage(player, "Dafür hast du nicht genug Geld auf deinem Bankkonto");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -220,8 +222,25 @@ namespace ReallifeGamemode.Server.Commands
|
|||||||
|
|
||||||
if (pVeh.GetServerVehicle(dbContext) is ServerVehicle veh)
|
if (pVeh.GetServerVehicle(dbContext) is ServerVehicle veh)
|
||||||
{
|
{
|
||||||
string dbIdStr = player.GetUser(dbContext).IsAdmin(AdminLevel.ADMIN) ? $" | DB-ID: {veh.Id}" : "";
|
User user = player.GetUser(dbContext);
|
||||||
ChatService.SendMessage(player, "~m~" + ((VehicleHash)pVeh.Model) + " | " + veh.ToString() + " | Farbe 1: " + pVeh.PrimaryColor + " | Farbe 2: " + pVeh.SecondaryColor + " | ID: " + pVeh.Handle.Value + dbIdStr);
|
string addInfoStr = "";
|
||||||
|
if (user.IsAdmin(AdminLevel.ADMIN))
|
||||||
|
{
|
||||||
|
addInfoStr += $" | DB-ID: {veh.Id}";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (user.IsAdmin(AdminLevel.HEADADMIN))
|
||||||
|
{
|
||||||
|
if (veh is FactionVehicle factionVehicle)
|
||||||
|
{
|
||||||
|
addInfoStr += " | Kaufpreis: " + factionVehicle.BuyPrice.ToMoneyString();
|
||||||
|
}
|
||||||
|
else if (veh is UserVehicle userVehicle)
|
||||||
|
{
|
||||||
|
addInfoStr += " | Kaufpreis: " + userVehicle.Price.ToMoneyString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ChatService.SendMessage(player, "~m~" + ((VehicleHash)pVeh.Model) + " | " + veh.ToString() + " | Farbe 1: " + pVeh.PrimaryColor + " | Farbe 2: " + pVeh.SecondaryColor + " | ID: " + pVeh.Handle.Value + addInfoStr);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user