try fix friseur
This commit is contained in:
@@ -278,6 +278,7 @@ namespace ReallifeGamemode.Server.Events
|
||||
undershirt.Texture = data[5];
|
||||
}
|
||||
}
|
||||
|
||||
client.GetUser(dbContext).Handmoney -= data[6];
|
||||
dbContext.SaveChanges();
|
||||
//client.TriggerEvent("SERVER:SET_HANDMONEY", user.Handmoney);
|
||||
@@ -285,6 +286,43 @@ namespace ReallifeGamemode.Server.Events
|
||||
client.TriggerEvent("clothesMenu:updateLast", data[2], data[1], data[4], data[5], data[3]);
|
||||
}
|
||||
}
|
||||
[RemoteEvent("SERVER:BuyHair")]
|
||||
public void RmtEvent_BuyHair(Player client, string type, string jsonData, byte hair)
|
||||
{
|
||||
/*
|
||||
* [0] ComponentID
|
||||
* [1] TextureID
|
||||
* [2] ClotheID
|
||||
* [3] TorsoID
|
||||
* [4] UndershirtID
|
||||
* [5] UndershirtTextureID
|
||||
* [6] Price
|
||||
*/
|
||||
|
||||
int[] data = JsonConvert.DeserializeObject<int[]>(jsonData);
|
||||
User user = client.GetUser();
|
||||
if (user.Handmoney < data[6])
|
||||
{
|
||||
client.TriggerEvent("clothesMenu:Error");
|
||||
return;
|
||||
}
|
||||
|
||||
if (type == "clothe")
|
||||
{
|
||||
|
||||
client.SetClothes(data[0], data[2], data[1]);
|
||||
|
||||
using (var dbContext = new DatabaseContext())
|
||||
{
|
||||
User payer = client.GetUser(dbContext);
|
||||
|
||||
client.GetUser(dbContext).Handmoney -= data[6];
|
||||
payer.Character.Hair = hair;
|
||||
dbContext.SaveChanges();
|
||||
//client.TriggerEvent("SERVER:SET_HANDMONEY", user.Handmoney);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[RemoteEvent("SERVER:BuyHairColor")]
|
||||
public void BuyHairColor(Player client, byte HairColor)
|
||||
|
||||
Reference in New Issue
Block a user