diff --git a/ReallifeGamemode.Client/drugs/hanf.ts b/ReallifeGamemode.Client/drugs/hanf.ts index 4c5339c1..ac37a8d3 100644 --- a/ReallifeGamemode.Client/drugs/hanf.ts +++ b/ReallifeGamemode.Client/drugs/hanf.ts @@ -333,9 +333,13 @@ export default function hanfSystem(globalData: IGlobalData) { let hanfDataIdToObjectMap: Map = new Map(); let hanfDataIdToTextLabelMap: Map = new Map(); - mp.events.add("SERVER:Hanf_UpdateHanfData", dataJson => { - mp.console.logInfo(dataJson); + mp.events.addDataHandler("hanfData", (entity: EntityMp, value) => { + if (entity == mp.players.local) { + } + }); + + mp.events.add("SERVER:Hanf_UpdateHanfData", dataJson => { var data: Array = >JSON.parse(dataJson) var newPlants = data.filter(d => currentHanfData.filter(x => x.Id === d.Id).length == 0); diff --git a/ReallifeGamemode.Server/Managers/HanfManager.cs b/ReallifeGamemode.Server/Managers/HanfManager.cs index 2ea69f0e..d70c9adf 100644 --- a/ReallifeGamemode.Server/Managers/HanfManager.cs +++ b/ReallifeGamemode.Server/Managers/HanfManager.cs @@ -289,7 +289,8 @@ namespace ReallifeGamemode.Server.Managers { cannabisData ??= _currentCannabisData; await NAPI.Task.WaitForMainThread(); - player.TriggerEvent("SERVER:Hanf_UpdateHanfData", JsonConvert.SerializeObject(cannabisData)); + //player.SetSharedData("hanfData", JsonConvert.SerializeObject(cannabisData)); + player.TriggerEvent("SERVER:Hanf_UpdateHanfData"); } [RemoteEvent("CLIENT:Hanf_BuySeeds")]