kleiderschrank fix (?)

This commit is contained in:
hydrant
2020-05-10 18:14:13 +02:00
parent 6340d8c270
commit 07f9a3ec8a
2 changed files with 19 additions and 20 deletions

View File

@@ -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 {

View File

@@ -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<int[]>(JSlotId);
int[] clothId = JsonConvert.DeserializeObject<int[]>(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<CharacterCloth> 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
{