auto verkaufen

This commit is contained in:
hydrant
2020-04-02 22:29:27 +02:00
parent 85cd638a4c
commit a8994d9e4a
4 changed files with 92 additions and 10 deletions

View File

@@ -16,6 +16,7 @@ using ReallifeGamemode.Server.Util;
using ReallifeGamemode.Server.Inventory.Interfaces;
using ReallifeGamemode.Server.DrivingSchool;
using ReallifeGamemode.Server.Types;
using Microsoft.EntityFrameworkCore;
/**
* @overview Life of German Reallife - Event Key (Key.cs)
* @author VegaZ
@@ -107,9 +108,16 @@ namespace ReallifeGamemode.Server.Events
[RemoteEvent("keyPress:DOWN_ARROW")]
public void KeyPressDownArrow(Player player)
{
User u = player.GetUser();
using var dbContext = new DatabaseContext();
User u = player.GetUser(dbContext);
if (u == null) return;
var vehicles = dbContext.UserVehicles.Where(veh => veh.UserId == u.Id).OrderBy(veh => veh.Id).Select(v => new
{
v.Id,
v.Model
});
Paycheck paycheck = null;
if (Economy.Paychecks.ContainsKey(u.Id)) paycheck = Economy.Paychecks[u.Id];
@@ -125,7 +133,8 @@ namespace ReallifeGamemode.Server.Events
groupRank = u.GroupRank.GetName(),
job = JobManager.GetJob(u.JobId ?? 0)?.Name ?? "Keiner",
paycheck,
licenses
licenses,
vehicles
};
string faction = u.FactionLeader ? u.Faction.Name : null;