try fix friseur
This commit is contained in:
@@ -279,7 +279,7 @@ export default function friseurShopList(globalData: IGlobalData) {
|
|||||||
if (lastClothing.drawable == currentItem.ClotheId && lastClothing.texture == currentTexture) {
|
if (lastClothing.drawable == currentItem.ClotheId && lastClothing.texture == currentTexture) {
|
||||||
mp.game.audio.playSoundFrontend(1, "Hack_Failed", "DLC_HEIST_BIOLAB_PREP_HACKING_SOUNDS", true);
|
mp.game.audio.playSoundFrontend(1, "Hack_Failed", "DLC_HEIST_BIOLAB_PREP_HACKING_SOUNDS", true);
|
||||||
} else {
|
} else {
|
||||||
mp.events.callRemote("SERVER:BuyCharacterClothes", "clothe", JSON.stringify(serverData), currentItem.CloteID);
|
mp.events.callRemote("SERVER:BuyHair", "clothe", JSON.stringify(serverData), currentItem.CloteID);
|
||||||
mp.events.call("friseurMenu:close");
|
mp.events.call("friseurMenu:close");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -278,6 +278,7 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
undershirt.Texture = data[5];
|
undershirt.Texture = data[5];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
client.GetUser(dbContext).Handmoney -= data[6];
|
client.GetUser(dbContext).Handmoney -= data[6];
|
||||||
dbContext.SaveChanges();
|
dbContext.SaveChanges();
|
||||||
//client.TriggerEvent("SERVER:SET_HANDMONEY", user.Handmoney);
|
//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]);
|
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")]
|
[RemoteEvent("SERVER:BuyHairColor")]
|
||||||
public void BuyHairColor(Player client, byte HairColor)
|
public void BuyHairColor(Player client, byte HairColor)
|
||||||
|
|||||||
Reference in New Issue
Block a user