[HOTFIX] v0.0.3-h1
fix bug at LSED checkpoint fix Message for Cops
This commit is contained in:
@@ -35,9 +35,7 @@ export default function factionInteraction(globalData: IGlobalData) {
|
|||||||
var reviveTaskMenuMedic;
|
var reviveTaskMenuMedic;
|
||||||
var insDate;
|
var insDate;
|
||||||
/*mp.events.add("updateFactionBlips", (type, taskList) => {
|
/*mp.events.add("updateFactionBlips", (type, taskList) => {
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
});*/
|
});*/
|
||||||
mp.events.add("showFactionInteractionLSPD", (userFactionId, isDuty, userFactionName, isFactionLeader) => {
|
mp.events.add("showFactionInteractionLSPD", (userFactionId, isDuty, userFactionName, isFactionLeader) => {
|
||||||
//LSPD
|
//LSPD
|
||||||
@@ -64,8 +62,6 @@ export default function factionInteraction(globalData: IGlobalData) {
|
|||||||
TaskMenuLSPD.SetRightLabel("");
|
TaskMenuLSPD.SetRightLabel("");
|
||||||
factionInteractionMenu.AddItem(TaskMenuLSPD);*/ //weiteres
|
factionInteractionMenu.AddItem(TaskMenuLSPD);*/ //weiteres
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
let cancelItem = new UIMenuItem("Schlie\u00dfen", "Schlie\u00dft die Fraktionsinteraktion.");
|
let cancelItem = new UIMenuItem("Schlie\u00dfen", "Schlie\u00dft die Fraktionsinteraktion.");
|
||||||
cancelItem.BackColor = new Color(213, 0, 0);
|
cancelItem.BackColor = new Color(213, 0, 0);
|
||||||
cancelItem.HighlightedBackColor = new Color(229, 57, 53);
|
cancelItem.HighlightedBackColor = new Color(229, 57, 53);
|
||||||
@@ -108,7 +104,7 @@ export default function factionInteraction(globalData: IGlobalData) {
|
|||||||
factionInteractionMenu.Visible = false;
|
factionInteractionMenu.Visible = false;
|
||||||
mp.gui.chat.activate(true);
|
mp.gui.chat.activate(true);
|
||||||
globalData.InMenu = false;
|
globalData.InMenu = false;
|
||||||
mp.events.callRemote("CLIENT:wantedlist");
|
mp.events.callRemote("CLIENT:wantedlist");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -172,7 +168,6 @@ export default function factionInteraction(globalData: IGlobalData) {
|
|||||||
var wList;
|
var wList;
|
||||||
|
|
||||||
mp.events.add("showWantedlist", (playersJson) => {
|
mp.events.add("showWantedlist", (playersJson) => {
|
||||||
|
|
||||||
if (wantedlistBrowser !== null) {
|
if (wantedlistBrowser !== null) {
|
||||||
wantedlistBrowser.destroy();
|
wantedlistBrowser.destroy();
|
||||||
wantedlistBrowser = null;
|
wantedlistBrowser = null;
|
||||||
@@ -193,7 +188,6 @@ export default function factionInteraction(globalData: IGlobalData) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
mp.events.add("removeWantedlist", () => {
|
mp.events.add("removeWantedlist", () => {
|
||||||
|
|
||||||
if (wantedlistBrowser == null) {
|
if (wantedlistBrowser == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -212,7 +206,6 @@ export default function factionInteraction(globalData: IGlobalData) {
|
|||||||
mp.gui.chat.activate(false);
|
mp.gui.chat.activate(false);
|
||||||
globalData.InMenu = true;
|
globalData.InMenu = true;
|
||||||
|
|
||||||
|
|
||||||
var rPM = ((reviveTaskCountMedic === "0") ? "~r~" : "~g~");
|
var rPM = ((reviveTaskCountMedic === "0") ? "~r~" : "~g~");
|
||||||
var hPM = ((healTaskCountMedic === "0") ? "~r~" : "~g~");
|
var hPM = ((healTaskCountMedic === "0") ? "~r~" : "~g~");
|
||||||
var fPM = ((fireTaskCountMedic === "0") ? "~r~" : "~g~");
|
var fPM = ((fireTaskCountMedic === "0") ? "~r~" : "~g~");
|
||||||
@@ -236,9 +229,8 @@ export default function factionInteraction(globalData: IGlobalData) {
|
|||||||
|
|
||||||
/*fireTaskMenuMedic = new UIMenuItem("Feuerauftr\u00e4ge"); //wenn die funktion dafür vorhanden ist wird das wieder eingebunden
|
/*fireTaskMenuMedic = new UIMenuItem("Feuerauftr\u00e4ge"); //wenn die funktion dafür vorhanden ist wird das wieder eingebunden
|
||||||
fireTaskMenuMedic.SetRightLabel(fPM + fireTaskCountMedic);
|
fireTaskMenuMedic.SetRightLabel(fPM + fireTaskCountMedic);
|
||||||
factionInteractionMenu.AddItem(fireTaskMenuMedic);
|
factionInteractionMenu.AddItem(fireTaskMenuMedic);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -277,9 +269,7 @@ export default function factionInteraction(globalData: IGlobalData) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
mp.events.add("showMedicTasks", (type, taskList) => {
|
mp.events.add("showMedicTasks", (type, taskList) => {
|
||||||
|
|
||||||
tasks = JSON.parse(taskList);
|
tasks = JSON.parse(taskList);
|
||||||
|
|
||||||
//mp.events.call("sortFactionTasks", false);
|
//mp.events.call("sortFactionTasks", false);
|
||||||
@@ -316,12 +306,12 @@ export default function factionInteraction(globalData: IGlobalData) {
|
|||||||
mp.events.callRemote("updateMedicTask", 0, tasks[index].Victim);
|
mp.events.callRemote("updateMedicTask", 0, tasks[index].Victim);
|
||||||
mp.game.ui.setNewWaypoint(tasks[index].Position.x, tasks[index].Position.y);
|
mp.game.ui.setNewWaypoint(tasks[index].Position.x, tasks[index].Position.y);
|
||||||
activeCheckpoint = mp.checkpoints.new(1, new mp.Vector3(tasks[index].Position.x, tasks[index].Position.y, tasks[index].Position.z - 2), 3.0,
|
activeCheckpoint = mp.checkpoints.new(1, new mp.Vector3(tasks[index].Position.x, tasks[index].Position.y, tasks[index].Position.z - 2), 3.0,
|
||||||
{
|
{
|
||||||
direction: new mp.Vector3(tasks[index].Position.x, tasks[index].Position.y, tasks[index].Position.z - 5),
|
direction: new mp.Vector3(tasks[index].Position.x, tasks[index].Position.y, tasks[index].Position.z - 5),
|
||||||
color: [255, 0, 0, 150],
|
color: [255, 0, 0, 150],
|
||||||
visible: true,
|
visible: true,
|
||||||
dimension: 0
|
dimension: 0
|
||||||
});
|
});
|
||||||
reviveTaskMenuMedic.Close();
|
reviveTaskMenuMedic.Close();
|
||||||
mp.gui.chat.activate(true);
|
mp.gui.chat.activate(true);
|
||||||
globalData.InMenu = false;
|
globalData.InMenu = false;
|
||||||
@@ -370,12 +360,12 @@ export default function factionInteraction(globalData: IGlobalData) {
|
|||||||
mp.events.callRemote("updateMedicTask", 1, tasks[index].Victim);
|
mp.events.callRemote("updateMedicTask", 1, tasks[index].Victim);
|
||||||
mp.game.ui.setNewWaypoint(tasks[index].Position.x, tasks[index].Position.y);
|
mp.game.ui.setNewWaypoint(tasks[index].Position.x, tasks[index].Position.y);
|
||||||
activeCheckpoint = mp.checkpoints.new(1, new mp.Vector3(tasks[index].Position.x, tasks[index].Position.y, tasks[index].Position.z - 2), 3.0,
|
activeCheckpoint = mp.checkpoints.new(1, new mp.Vector3(tasks[index].Position.x, tasks[index].Position.y, tasks[index].Position.z - 2), 3.0,
|
||||||
{
|
{
|
||||||
direction: new mp.Vector3(tasks[index].Position.x, tasks[index].Position.y, tasks[index].Position.z - 5),
|
direction: new mp.Vector3(tasks[index].Position.x, tasks[index].Position.y, tasks[index].Position.z - 5),
|
||||||
color: [255, 0, 0, 150],
|
color: [255, 0, 0, 150],
|
||||||
visible: true,
|
visible: true,
|
||||||
dimension: 0
|
dimension: 0
|
||||||
});
|
});
|
||||||
healTaskMenuMedic.Close();
|
healTaskMenuMedic.Close();
|
||||||
mp.gui.chat.activate(true);
|
mp.gui.chat.activate(true);
|
||||||
globalData.InMenu = false;
|
globalData.InMenu = false;
|
||||||
@@ -423,7 +413,7 @@ export default function factionInteraction(globalData: IGlobalData) {
|
|||||||
mp.events.call("showMedicTasks", 0, JSON.stringify(initTasks));
|
mp.events.call("showMedicTasks", 0, JSON.stringify(initTasks));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 1: //Sortierung nach Metern (aufsteigend)
|
case 1: //Sortierung nach Metern (aufsteigend)
|
||||||
for (var d = 0; d < tasks.length; d++) {
|
for (var d = 0; d < tasks.length; d++) {
|
||||||
for (var e = 0; e < tasks.length - 1; e++) {
|
for (var e = 0; e < tasks.length - 1; e++) {
|
||||||
if (getDistance1(e) > getDistance2(e + 1)) {
|
if (getDistance1(e) > getDistance2(e + 1)) {
|
||||||
@@ -440,7 +430,7 @@ export default function factionInteraction(globalData: IGlobalData) {
|
|||||||
mp.events.call("showMedicTasks", 0, JSON.stringify(tasks));
|
mp.events.call("showMedicTasks", 0, JSON.stringify(tasks));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
//case 2: //Sortierung nach Metern (absteigend)
|
//case 2: //Sortierung nach Metern (absteigend)
|
||||||
// mp.gui.chat.push("Sorting 2");
|
// mp.gui.chat.push("Sorting 2");
|
||||||
// sortText = "Entfernung absteigend";
|
// sortText = "Entfernung absteigend";
|
||||||
// break;
|
// break;
|
||||||
@@ -468,13 +458,13 @@ export default function factionInteraction(globalData: IGlobalData) {
|
|||||||
deadRespawned = true;
|
deadRespawned = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
mp.events.add("destroyMedicTaskCheckpoint", () => {
|
mp.events.add("destroyMedicTaskCheckpoint", () => {
|
||||||
if (activeCheckpoint) {
|
if (activeCheckpoint && mp.checkpoints.exists(activeCheckpoint)) {
|
||||||
activeCheckpoint.destroy();
|
activeCheckpoint.destroy();
|
||||||
activeCheckpoint = null;
|
activeCheckpoint = null;
|
||||||
activeTask = null;
|
activeTask = null;
|
||||||
timeLeft = null;
|
timeLeft = null;
|
||||||
mp.events.callRemote("MedicTaskTimeout");
|
mp.events.callRemote("MedicTaskTimeout");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -486,7 +476,7 @@ export default function factionInteraction(globalData: IGlobalData) {
|
|||||||
activeTask = null;
|
activeTask = null;
|
||||||
deadRespawned = false;
|
deadRespawned = false;
|
||||||
timeLeft = null;
|
timeLeft = null;
|
||||||
} else if (activeTask.Type == 1){
|
} else if (activeTask.Type == 1) {
|
||||||
activeCheckpoint.destroy();
|
activeCheckpoint.destroy();
|
||||||
activeCheckpoint = null;
|
activeCheckpoint = null;
|
||||||
mp.events.callRemote("delHealTaskAsMedic", activeTask.Victim);
|
mp.events.callRemote("delHealTaskAsMedic", activeTask.Victim);
|
||||||
@@ -502,7 +492,6 @@ export default function factionInteraction(globalData: IGlobalData) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
mp.events.add('render', () => {
|
mp.events.add('render', () => {
|
||||||
|
|
||||||
if (activeTask) {
|
if (activeTask) {
|
||||||
rangeLeft = mp.game.gameplay.getDistanceBetweenCoords(player.position.x, player.position.y, player.position.z, taskFinish.x, taskFinish.y, taskFinish.z, true).toFixed(2);
|
rangeLeft = mp.game.gameplay.getDistanceBetweenCoords(player.position.x, player.position.y, player.position.z, taskFinish.x, taskFinish.y, taskFinish.z, true).toFixed(2);
|
||||||
if (rangeLeft > 1.9) {
|
if (rangeLeft > 1.9) {
|
||||||
|
|||||||
@@ -76,15 +76,18 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
|
|
||||||
bool copNearby = NAPI.Pools.GetAllPlayers().Any(u => u.IsDuty() && u.IsAlive() && u.Position.DistanceToSquared(player.Position) <= 200 * 200);
|
bool copNearby = NAPI.Pools.GetAllPlayers().Any(u => u.IsDuty() && u.IsAlive() && u.Position.DistanceToSquared(player.Position) <= 200 * 200);
|
||||||
|
|
||||||
if (copNearby)
|
if (user.Wanteds > 0)
|
||||||
{
|
{
|
||||||
user.SetJailTime(true);
|
if (copNearby)
|
||||||
Jail.Check_PutBehindBars(user);
|
{
|
||||||
ChatService.HQMessage(user.Name + " wurde ins Gefängnis eingeliefert.");
|
user.SetJailTime(true);
|
||||||
}
|
Jail.Check_PutBehindBars(user);
|
||||||
else
|
ChatService.HQMessage(user.Name + " wurde ins Gefängnis eingeliefert.");
|
||||||
{
|
}
|
||||||
ChatService.HQMessage(user.Name + " wurde soeben ins Krankenhaus eingeliefert.");
|
else
|
||||||
|
{
|
||||||
|
ChatService.HQMessage(user.Name + " wurde soeben ins Krankenhaus eingeliefert.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (user.JailTime <= 0)
|
if (user.JailTime <= 0)
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ namespace ReallifeGamemode.Server.Gangwar
|
|||||||
{
|
{
|
||||||
Gangwar.loadTurfs();
|
Gangwar.loadTurfs();
|
||||||
Gangwar.loadTurfs_ToAllPlayers();
|
Gangwar.loadTurfs_ToAllPlayers();
|
||||||
}, delayTime: 2000);
|
}, delayTime: 2000);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Tick(object sender, System.Timers.ElapsedEventArgs e)
|
private void Tick(object sender, System.Timers.ElapsedEventArgs e)
|
||||||
@@ -272,18 +272,20 @@ namespace ReallifeGamemode.Server.Gangwar
|
|||||||
Player[] attackers = NAPI.Pools.GetAllPlayers().Where(c => c.IsLoggedIn() && c.GetUser().Faction.Name == this.Attacker).ToArray();
|
Player[] attackers = NAPI.Pools.GetAllPlayers().Where(c => c.IsLoggedIn() && c.GetUser().Faction.Name == this.Attacker).ToArray();
|
||||||
foreach (var o in owners)
|
foreach (var o in owners)
|
||||||
{
|
{
|
||||||
o.TriggerEvent("CLIENT:loose");
|
if (o != null)
|
||||||
|
o.TriggerEvent("CLIENT:loose");
|
||||||
}
|
}
|
||||||
foreach (var a in attackers)
|
foreach (var a in attackers)
|
||||||
{
|
{
|
||||||
a.TriggerEvent("CLIENT:win");
|
if (a != null)
|
||||||
|
a.TriggerEvent("CLIENT:win");
|
||||||
}
|
}
|
||||||
this.Owner = FactionName;
|
this.Owner = FactionName;
|
||||||
ChatService.BroadcastFaction("~y~[GANGWAR] ~w~Deine Fraktion konnte erfolgreich das Gebiet ~g~" + getName() + "~w~ erobern.", dbContext.Factions.Where(f => f.Name == getOwner()).FirstOrDefault());
|
ChatService.BroadcastFaction("~y~[GANGWAR] ~w~Deine Fraktion konnte erfolgreich das Gebiet ~g~" + getName() + "~w~ erobern.", dbContext.Factions.Where(f => f.Name == getOwner()).FirstOrDefault());
|
||||||
dbContext.Factions.Include(f => f.BankAccount).Where(f => f.Name == getOwner()).First().BankAccount.Balance += 10000;
|
dbContext.Factions.Include(f => f.BankAccount).Where(f => f.Name == getOwner()).First().BankAccount.Balance += 10000;
|
||||||
Turfs turf = dbContext.Turfs.Where(t => t.Id == getId()).FirstOrDefault();
|
Turfs turf = dbContext.Turfs.Where(t => t.Id == getId()).FirstOrDefault();
|
||||||
turf.Owner = this.Owner;
|
turf.Owner = this.Owner;
|
||||||
turf.FactionId = dbContext.Factions.Where(f => f.Name == this.Owner).FirstOrDefault().Id;
|
turf.FactionId = dbContext.Factions.Where(f => f.Name == this.Owner).FirstOrDefault().Id;
|
||||||
}
|
}
|
||||||
dbContext.SaveChanges();
|
dbContext.SaveChanges();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user