rvtl fix hanf

This commit is contained in:
hydrant
2021-05-27 23:41:30 +02:00
parent 3c18654414
commit 50fb50f9f0
2 changed files with 8 additions and 3 deletions

View File

@@ -333,9 +333,13 @@ export default function hanfSystem(globalData: IGlobalData) {
let hanfDataIdToObjectMap: Map<number, ObjectMp> = new Map<number, ObjectMp>();
let hanfDataIdToTextLabelMap: Map<number, TextLabelMp> = new Map<number, TextLabelMp>();
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<CannabisData> = <Array<CannabisData>>JSON.parse(dataJson)
var newPlants = data.filter(d => currentHanfData.filter(x => x.Id === d.Id).length == 0);