diff --git a/ReallifeGamemode.Client/Player/dutycloth.ts b/ReallifeGamemode.Client/Player/dutycloth.ts index c1f65361..99a364c0 100644 --- a/ReallifeGamemode.Client/Player/dutycloth.ts +++ b/ReallifeGamemode.Client/Player/dutycloth.ts @@ -62,7 +62,7 @@ export default function dutyCloth(globalData: IGlobalData) { dutyMenu.ListChange.on((item, index) => { switch (item.Text) { - case "Hut": + case "Accessoire": if (item.SelectedItem.DisplayText === "Keinen") { hat = -1; } else { diff --git a/ReallifeGamemode.Server/Events/UpdateCharacterCloth.cs b/ReallifeGamemode.Server/Events/UpdateCharacterCloth.cs index 1f97487e..9e7172de 100644 --- a/ReallifeGamemode.Server/Events/UpdateCharacterCloth.cs +++ b/ReallifeGamemode.Server/Events/UpdateCharacterCloth.cs @@ -15,13 +15,13 @@ namespace ReallifeGamemode.Server.Events { if (componentId != -1) { - player.SetAccessories(componentId, componentVariation, 0); + NAPI.Player.SetPlayerAccessory(player, componentId, componentVariation, 0); } else { - player.ClearAccessory(0); - player.ClearAccessory(1); - player.ClearAccessory(2); + NAPI.Player.ClearPlayerAccessory(player, 0); + NAPI.Player.ClearPlayerAccessory(player, 1); + NAPI.Player.ClearPlayerAccessory(player, 2); } } @@ -59,12 +59,11 @@ namespace ReallifeGamemode.Server.Events int[] slotId = JsonConvert.DeserializeObject(JSlotId); int[] clothId = JsonConvert.DeserializeObject(JClothId); - User user = client.GetUser(); - user = context.Users.FirstOrDefault(u => u.Id == user.Id); + User user = client.GetUser(context); - var character = client.GetUser().GetCharacter(); + var character = user.GetCharacter(context); - var charClothes = context.CharacterClothes.FirstOrDefault(c => c.UserId == user.Id); + var charClothes = context.CharacterClothes.FirstOrDefault(c => c.UserId == user.Id && c.Duty); if (charClothes == null) { for (var x = 0; x < slotType.Length; x++) @@ -81,7 +80,7 @@ namespace ReallifeGamemode.Server.Events }; context.CharacterClothes.Add(newCloth); } - if (user.GetCharacter().Gender == false) + if (character.Gender == false) { CharacterCloth newTorso = new CharacterCloth { @@ -144,21 +143,21 @@ namespace ReallifeGamemode.Server.Events using (var context = new DatabaseContext()) { List charClothes = context.CharacterClothes.ToList().FindAll(c => c.UserId == user.Id && c.Duty == false); - player.ClearAccessory(0); - player.ClearAccessory(1); - player.ClearAccessory(2); - player.ClearAccessory(6); - player.ClearAccessory(7); + NAPI.Player.ClearPlayerAccessory(player, 0); + NAPI.Player.ClearPlayerAccessory(player, 1); + NAPI.Player.ClearPlayerAccessory(player, 2); + NAPI.Player.ClearPlayerAccessory(player, 6); + NAPI.Player.ClearPlayerAccessory(player, 7); foreach (var cloth in charClothes) { if (cloth.SlotType == 1) { - player.SetAccessories(cloth.SlotId, cloth.ClothId, 0); + NAPI.Player.SetPlayerClothes(player, cloth.SlotId, cloth.ClothId, 0); } else { - player.SetClothes(cloth.SlotId, cloth.ClothId, cloth.Texture); + NAPI.Player.SetPlayerClothes(player, cloth.SlotId, cloth.ClothId, cloth.Texture); } } } @@ -189,9 +188,9 @@ namespace ReallifeGamemode.Server.Events { if (data[0] == 11)//for tops { - client.SetClothes(11, data[2], data[1]); //set Top - client.SetClothes(8, data[4], data[5]); //set undershirt - client.SetClothes(3, data[3], 0); //set Torso + NAPI.Player.SetPlayerClothes(client, 11, data[2], data[1]); //set Top + NAPI.Player.SetPlayerClothes(client, 8, data[4], data[5]); //set undershirt + NAPI.Player.SetPlayerClothes(client, 3, data[3], 0); //set Torso } else {