kleiderschrank fix (?)
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user