From e2428a34c89ed5b6afe8fae736c8904b5640af86 Mon Sep 17 00:00:00 2001 From: hydrant Date: Sun, 10 May 2020 13:53:03 +0200 Subject: [PATCH] fix /clothes --- .../Commands/AdminCommands.cs | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/ReallifeGamemode.Server/Commands/AdminCommands.cs b/ReallifeGamemode.Server/Commands/AdminCommands.cs index b0dc52e9..3bf7332d 100644 --- a/ReallifeGamemode.Server/Commands/AdminCommands.cs +++ b/ReallifeGamemode.Server/Commands/AdminCommands.cs @@ -1189,7 +1189,7 @@ namespace ReallifeGamemode.Server.Commands } [Command("clothes", "~m~Benutzung: ~s~/clothes [Spieler] [Component ID] [Drawable] (Textur)")] - public void CmdAdminClothes(Player player, string name, int? component = null, int? drawable = null, int texture = 0) + public void CmdAdminClothes(Player player, string name, int component, int drawable, int texture = 0) { if (!player.GetUser()?.IsAdmin(AdminLevel.ADMIN2) ?? true) { @@ -1197,12 +1197,6 @@ namespace ReallifeGamemode.Server.Commands return; } - if (name == null || component == null || drawable == null) - { - player.SendChatMessage("~m~Benutzung: ~s~/clothes [Spieler] [Component ID] [Drawable] (Textur)"); - return; - } - Player target = PlayerService.GetPlayerByNameOrId(name); if (target == null || !target.IsLoggedIn()) { @@ -1220,8 +1214,8 @@ namespace ReallifeGamemode.Server.Commands cloth = new CharacterCloth() { Duty = duty, - ClothId = drawable.Value, - SlotId = component.Value, + ClothId = drawable, + SlotId = component, SlotType = 0, Texture = texture, UserId = user.Id, @@ -1230,11 +1224,11 @@ namespace ReallifeGamemode.Server.Commands } else { - cloth.ClothId = drawable.Value; + cloth.ClothId = drawable; cloth.Texture = texture; } dbContext.SaveChanges(); - target.SetClothes(component.Value, drawable.Value, texture); + NAPI.Player.SetPlayerClothes(player, component, drawable, texture); } }