add onlinewanteds in factionmenü
This commit is contained in:
@@ -40,6 +40,7 @@ export default function factionInteraction(globalData: IGlobalData) {
|
||||
//LSPD
|
||||
let ticketTaskMenuLSPD;
|
||||
let pointsTaskMenuLSPD;
|
||||
let wantedsMenuLSPD
|
||||
if (userFactionId == 1 || userFactionId == 3) {
|
||||
if (isDuty) {
|
||||
mp.gui.chat.activate(false);
|
||||
@@ -53,6 +54,9 @@ export default function factionInteraction(globalData: IGlobalData) {
|
||||
pointsTaskMenuLSPD = new UIMenuItem("Strafpunkte verteilen", "Einem Spieler Strafpunkte verteilen.");
|
||||
factionInteractionMenu.AddItem(pointsTaskMenuLSPD);
|
||||
|
||||
wantedsMenuLSPD = new UIMenuItem("Verbrecher Liste");
|
||||
factionInteractionMenu.AddItem(wantedsMenuLSPD);
|
||||
|
||||
/*TaskMenuLSPD = new UIMenuItem("");
|
||||
TaskMenuLSPD.SetRightLabel("");
|
||||
factionInteractionMenu.AddItem(TaskMenuLSPD);*/ //weiteres
|
||||
@@ -100,6 +104,12 @@ export default function factionInteraction(globalData: IGlobalData) {
|
||||
mp.events.call("CLIENT:InteractionMenu_LSPD_Points", name);
|
||||
globalData.InInput = false;
|
||||
});
|
||||
break
|
||||
case wantedsMenuLSPD:
|
||||
factionInteractionMenu.Visible = false;
|
||||
mp.gui.chat.activate(true);
|
||||
globalData.InMenu = false;
|
||||
mp.events.callRemote("CLIENT:wantedlist");
|
||||
break;
|
||||
}
|
||||
});
|
||||
@@ -159,11 +169,51 @@ export default function factionInteraction(globalData: IGlobalData) {
|
||||
});
|
||||
});
|
||||
|
||||
var wantedlistBrowser: BrowserMp = null;
|
||||
var wList;
|
||||
|
||||
mp.events.add("showWantedlist", (playersJson) => {
|
||||
|
||||
if (wantedlistBrowser !== null) {
|
||||
wantedlistBrowser.destroy();
|
||||
wantedlistBrowser = null;
|
||||
globalData.InInput = false;
|
||||
mp.gui.cursor.show(false, false);
|
||||
mp.gui.chat.activate(true);
|
||||
}
|
||||
else if (!globalData.InInput) {
|
||||
globalData.InInput = true;
|
||||
wantedlistBrowser = mp.browsers.new('package://assets/html/Wantedlist/wanteds.html');
|
||||
mp.gui.chat.activate(false);
|
||||
mp.gui.cursor.show(true, true);
|
||||
wList = JSON.parse(playersJson);
|
||||
wList.forEach((player) => {
|
||||
wantedlistBrowser.execute(`ad_row('${JSON.stringify(player.Id)}','${JSON.stringify(player.Name)}','${JSON.stringify(player.wanted)}');`);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
mp.events.add("removeWantedlist", () => {
|
||||
|
||||
if (wantedlistBrowser == null) {
|
||||
return;
|
||||
}
|
||||
else if (globalData.InInput) {
|
||||
wantedlistBrowser.destroy();
|
||||
wantedlistBrowser = null;
|
||||
globalData.InInput = false;
|
||||
mp.gui.cursor.show(false, false);
|
||||
mp.gui.chat.activate(true);
|
||||
}
|
||||
});
|
||||
|
||||
//Medic
|
||||
|
||||
mp.events.add("showFactionInteractionMedic", (userFactionId, isDuty, userFactionName, isFactionLeader, reviveTaskCountMedic, healTaskCountMedic, fireTaskCountMedic) => {
|
||||
mp.gui.chat.activate(false);
|
||||
globalData.InMenu = true;
|
||||
|
||||
//Medic
|
||||
|
||||
var rPM = ((reviveTaskCountMedic === "0") ? "~r~" : "~g~");
|
||||
var hPM = ((healTaskCountMedic === "0") ? "~r~" : "~g~");
|
||||
var fPM = ((fireTaskCountMedic === "0") ? "~r~" : "~g~");
|
||||
|
||||
Reference in New Issue
Block a user