From 914c9087d3161a8e3b5dc672832c7ac98d9a530a Mon Sep 17 00:00:00 2001 From: Luke Date: Fri, 7 May 2021 01:10:49 +0200 Subject: [PATCH] /checkstats kann jetzt auch stunden anzeigen --- ReallifeGamemode.Server/Commands/AdminCommands.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ReallifeGamemode.Server/Commands/AdminCommands.cs b/ReallifeGamemode.Server/Commands/AdminCommands.cs index 01f7d261..0a8848a3 100644 --- a/ReallifeGamemode.Server/Commands/AdminCommands.cs +++ b/ReallifeGamemode.Server/Commands/AdminCommands.cs @@ -3766,13 +3766,14 @@ namespace ReallifeGamemode.Server.Commands player.SendChatMessage("~m~Benutzung:~s~ /business [price] [Option]"); } - [Command("checkstats", "~m~Benutzung:~s~ /checkstats [Name / ID]")] + [Command("checkstats", "~m~Benutzung:~s~ /checkstats [Spieler]")] public void CmdAdminCheckStats(Player player, string nameOrId) { User user = player.GetUser(); if (!user.IsAdmin(AdminLevel.SUPPORTER)) { ChatService.NotAuthorized(player); + return; } Player target = PlayerService.GetPlayerByNameOrId(nameOrId); @@ -3789,7 +3790,14 @@ namespace ReallifeGamemode.Server.Commands bool bikeLicense = targetUser.DriverLicenseBike; bool flyingLicense = targetUser.FlyingLicensePlane; bool weaponLicense = targetUser.WeaponLicense; - ChatService.SendMessage(player, $"Stats von {target.Name} - HandMoney: {handmoney.ToMoneyString()}, BankMoney: {bankmoney.ToMoneyString()}, DriverLicense: {driverLicense.ToString()}, BikeLicense: {bikeLicense.ToString()}, FlyingLicense: {flyingLicense.ToString()}, WeaponLicense: {weaponLicense.ToString()}"); + int playedHours = targetUser.PlayedMinutes / 60; + int jailTime = targetUser.JailTime; + + if(user.IsAdmin(AdminLevel.HEADADMIN)) { + ChatService.SendMessage(player, $"Stats von {target.Name} - HandMoney: {handmoney.ToMoneyString()}, BankMoney: {bankmoney.ToMoneyString()}, DriverLicense: {driverLicense.ToString()}, BikeLicense: {bikeLicense.ToString()}, FlyingLicense: {flyingLicense.ToString()}, WeaponLicense: {weaponLicense.ToString()}, playedHours: {playedHours.ToString()}, JailTime: {jailTime.ToString()}"); + } else { + ChatService.SendMessage(player, $"Stats von {target.Name} - HandMoney: {handmoney.ToMoneyString()}, BankMoney: {bankmoney.ToMoneyString()}, DriverLicense: {driverLicense.ToString()}, BikeLicense: {bikeLicense.ToString()}, FlyingLicense: {flyingLicense.ToString()}, WeaponLicense: {weaponLicense.ToString()}, JailTime: {jailTime.ToString()}"); + } } #endregion ALevel1337