Add playtime and warns in M menu

This commit is contained in:
CroniX
2021-04-04 14:58:33 +02:00
parent 64343fc640
commit 14fdc1e1a4
3 changed files with 13 additions and 1 deletions

View File

@@ -226,6 +226,14 @@ export default function (globalData: IGlobalData) {
menuItem.SetRightLabel(data.regDate); menuItem.SetRightLabel(data.regDate);
accountMenu.AddItem(menuItem); accountMenu.AddItem(menuItem);
menuItem = new UIMenuItem("Spielzeit");
menuItem.SetRightLabel(data.playTime + "h");
accountMenu.AddItem(menuItem);
menuItem = new UIMenuItem("Verwarnungen");
menuItem.SetRightLabel("~r~" + data.userWarn);
accountMenu.AddItem(menuItem);
menuItem = new UIMenuItem("Adminrang"); menuItem = new UIMenuItem("Adminrang");
menuItem.SetRightLabel(data.adminLevel); menuItem.SetRightLabel(data.adminLevel);
accountMenu.AddItem(menuItem); accountMenu.AddItem(menuItem);

View File

@@ -21,6 +21,8 @@ declare type AccountData = {
factionVehicles: VehicleData[]; factionVehicles: VehicleData[];
nextPayday: number; nextPayday: number;
stateFaction: boolean; stateFaction: boolean;
playTime: number;
userWarn: number;
} }
declare type VehicleData = { declare type VehicleData = {

View File

@@ -151,7 +151,9 @@ namespace ReallifeGamemode.Server.Events
licenses, licenses,
vehicles, vehicles,
factionVehicles, factionVehicles,
nextPayday = u.PaydayTimer nextPayday = u.PaydayTimer,
playTime = u.PlayedMinutes / 60,
userWarn = u.warn,
}; };
string faction = u.Faction?.Name ?? "Zivilist"; string faction = u.Faction?.Name ?? "Zivilist";