From d9569972d34b41808b587ead6ae9b02bad8af2f8 Mon Sep 17 00:00:00 2001 From: VegaZ Date: Mon, 29 Mar 2021 23:06:39 +0200 Subject: [PATCH] Gangwar Fix #7 --- ReallifeGamemode.Client/util/Gangwar.ts | 12 ++++++++++++ ReallifeGamemode.Server/Gangwar/Turf.cs | 3 +++ 2 files changed, 15 insertions(+) diff --git a/ReallifeGamemode.Client/util/Gangwar.ts b/ReallifeGamemode.Client/util/Gangwar.ts index c5d518ec..c1d57dc2 100644 --- a/ReallifeGamemode.Client/util/Gangwar.ts +++ b/ReallifeGamemode.Client/util/Gangwar.ts @@ -557,6 +557,18 @@ }); }); + mp.events.add('CLIENT:Turf_Conquered', (jsonId, jsonStatus, jsonOwner) => { + var id = JSON.parse(jsonId); + var status = JSON.parse(jsonStatus); + var owner = JSON.parse(jsonOwner); + + gangturfs.forEach(function (turf) { + if (turf.id == id) { + turf.updateArea(status, owner); + } + }); + }); + mp.events.add('CLIENT:setAttackBlip', (bool, id) => { gangturfs.forEach(function (turf) { if (turf.id == id) { diff --git a/ReallifeGamemode.Server/Gangwar/Turf.cs b/ReallifeGamemode.Server/Gangwar/Turf.cs index 07bba0eb..5886022e 100644 --- a/ReallifeGamemode.Server/Gangwar/Turf.cs +++ b/ReallifeGamemode.Server/Gangwar/Turf.cs @@ -283,6 +283,9 @@ namespace ReallifeGamemode.Server.Gangwar c.ResetData("GotInsideOfTurf"); } this.playerInGangwar = null; + this.status = "conquered"; + + NAPI.ClientEvent.TriggerClientEventForAll("CLIENT:Turf_Conquered", JsonConvert.SerializeObject(this.TurfID), JsonConvert.SerializeObject(this.status), JsonConvert.SerializeObject(this.Owner)); Gangwar.loadTurfs(); Gangwar.loadTurfs_ToAllPlayers(); }