fix /clothes

This commit is contained in:
hydrant
2020-05-10 13:53:03 +02:00
parent 53d133ef89
commit e2428a34c8

View File

@@ -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);
}
}