Merge branch 'develop' of ssh://development.life-of-german.org:451/log-gtav/reallife-gamemode into develop

This commit is contained in:
michael.reiswich
2021-03-30 22:43:03 +02:00
2 changed files with 39 additions and 10 deletions

View File

@@ -30,7 +30,8 @@
DOES_BLIP_EXIST: "0xA6DB27D19ECBB7DA",
SET_BLIP_COORDS: "0xAE2AF67E9D9AF65D",
SET_BLIP_FLASH_INTERVAL: "0xAA51DB313C010A7E",
REMOVE_BLIP: "0x86A652570E5F25DD"
REMOVE_BLIP: "0x86A652570E5F25DD",
SET_THIS_SCRIPT_CAN_REMOVE_BLIPS_CREATED_BY_ANY_SCRIPT: "0xB98236CAAECEF897"
};
var Gangturf = class {
@@ -130,7 +131,7 @@
mp.game.invoke(Natives.SET_BLIP_SPRITE, self.blip, 5);
mp.game.invoke(Natives.SET_BLIP_ALPHA, self.blip, 70);
mp.game.invoke(Natives.SET_BLIP_COLOUR, self.blip, self.color);
self._colshape = mp.colshapes.newCircle(self.x, self.y, self.range * 1.5);
}
render() {
@@ -244,6 +245,7 @@
self._status = "attack";
self.attacker = args[1];
//self.blip.setFlashes(true);
//self.blip.setFlashInterval(1000);
mp.game.invoke(Natives.SET_BLIP_FLASHES, self.blip, true);
mp.game.invoke(Natives.SET_BLIP_FLASH_INTERVAL, self.blip, 1000)
return;
@@ -452,15 +454,27 @@
});
function clearBlips() {
mp.game.invoke(Natives.SET_THIS_SCRIPT_CAN_REMOVE_BLIPS_CREATED_BY_ANY_SCRIPT, 1);
mp.game.gameplay.setThisScriptCanRemoveBlipsCreatedByAnyScript(true);
var x = 0;
var y = 0;
var z = 0;
var n = 0;
let last_blip = mp.game.invoke(Natives.GET_FIRST_BLIP_INFO_ID, 5);
gangturfs.forEach(function (turf) {
mp.game.invoke(Natives.REMOVE_BLIP, turf.blip);
mp.game.ui.removeBlip(turf.blip);
n++;
});
while (mp.game.invoke(Natives.DOES_BLIP_EXIST, last_blip)) {
mp.game.invoke(Natives.SET_BLIP_SPRITE, last_blip, -1);
mp.game.ui.removeBlip(last_blip);
mp.game.invoke(Natives.REMOVE_BLIP, last_blip, -1);
mp.game.invoke(Natives.SET_BLIP_ALPHA, last_blip, 0);
mp.game.ui.removeBlip(last_blip);
mp.game.invoke(Natives.REMOVE_BLIP, last_blip);
last_blip = mp.game.invoke(Natives.GET_NEXT_BLIP_INFO_ID, 5);
x++;
}
@@ -485,7 +499,7 @@
z++
}
mp.gui.chat.push("DEBUG: Turf blips not removed: " + x);
mp.gui.chat.push("DEBUG: Turf blips not removed: " + x + " / " + n);
mp.gui.chat.push("DEBUG: Attack blips not removed: " + y);
mp.gui.chat.push("DEBUG: LeaderBlips blips not removed: " + z);
}
@@ -496,7 +510,7 @@
gangturfs[gangturfs.length - 1].edit = false;
gangturfs.forEach(function (turf) {
turf._status = "disabled";
turf.id = -420; //Due to garbage collecting this value needs to be negative, so that the Server doesn't find multiple Turfs in the Database with same ID's.
turf.id = null; //Due to garbage collecting this value needs to be negative, so that the Server doesn't find multiple Turfs in the Database with same ID's.
if (turf.leaderColShape != null) {
turf.leaderColShape.destroy();
turf.leaderColShape = null;
@@ -511,7 +525,6 @@
if (turf.attackBlip != null) {
mp.game.ui.removeBlip(turf.attackBlip);
}
Natives
});
}
clearBlips();