@@ -6,11 +6,15 @@ using ReallifeGamemode.Database.Entities;
|
||||
using ReallifeGamemode.Database.Models;
|
||||
using ReallifeGamemode.Server.Extensions;
|
||||
using System;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using ReallifeGamemode.Server.Log;
|
||||
|
||||
namespace ReallifeGamemode.Server.Events
|
||||
{
|
||||
public class UpdateCharacterCloth : Script
|
||||
{
|
||||
private static readonly ILogger logger = LogManager.GetLogger<UpdateCharacterCloth>();
|
||||
|
||||
[RemoteEvent("updateDutyProp")]
|
||||
public void UpdateDutyProp(Player player, int componentId, int componentVariation)
|
||||
{
|
||||
@@ -280,7 +284,8 @@ namespace ReallifeGamemode.Server.Events
|
||||
}
|
||||
}
|
||||
|
||||
if(data[0] == 2){
|
||||
if (data[0] == 2)
|
||||
{
|
||||
User payer = client.GetUser(dbContext);
|
||||
payer.GetCharacter(dbContext);
|
||||
payer.Character.Hair = Convert.ToByte(data[2]);
|
||||
@@ -288,13 +293,14 @@ namespace ReallifeGamemode.Server.Events
|
||||
}
|
||||
|
||||
client.GetUser(dbContext).Handmoney -= data[6];
|
||||
logger.LogInformation("Player {0} bought clothing for {1} dollars: slot = {2}, cloth = {3}, texture = {4}", client.Name, data[6], data[0], data[2], data[1]);
|
||||
dbContext.SaveChanges();
|
||||
//client.TriggerEvent("SERVER:SET_HANDMONEY", user.Handmoney);
|
||||
}
|
||||
client.TriggerEvent("clothesMenu:updateLast", data[2], data[1], data[4], data[5], data[3]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
[RemoteEvent("SERVER:BuyHairColor")]
|
||||
public void BuyHairColor(Player client, byte HairColor)
|
||||
@@ -332,7 +338,7 @@ namespace ReallifeGamemode.Server.Events
|
||||
User payer = client.GetUser(dbContext);
|
||||
payer.GetCharacter(dbContext);
|
||||
payer.Handmoney -= 50;
|
||||
payer.Character.HairHighlightColor = HairlightColor;
|
||||
payer.Character.HairHighlightColor = HairlightColor;
|
||||
// client.TriggerEvent("SERVER:SET_HANDMONEY", payer.Handmoney);
|
||||
dbContext.SaveChanges();
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ namespace ReallifeGamemode.Server.Events
|
||||
player.SendNotification("Du hast nicht genügend Geld bei dir");
|
||||
return;
|
||||
}
|
||||
logger.LogInformation("Player {0} bought a {1} in ammunation", user.Name, weaponmodel);
|
||||
logger.LogInformation("Player {0} bought a weapon {1} in ammunation for {2} dollars", user.Name, weaponmodel, price);
|
||||
user.Handmoney -= price;
|
||||
dbContext.SaveChanges();
|
||||
player.GiveWeapon(NAPI.Util.WeaponNameToModel(weaponmodel), ammo);
|
||||
|
||||
Reference in New Issue
Block a user