Start Medic System / FactionInteraction
This commit is contained in:
@@ -26,6 +26,7 @@ mp.events.add("startDeathTimer", (isAdmin) => {
|
||||
else {
|
||||
mp.gui.chat.activate(false);
|
||||
}
|
||||
mp.game.audio.playSoundFrontend(-1, "Bed", "WastedSounds", true);
|
||||
deathDate = new Date();
|
||||
respawnTime = Math.floor(deathDate.getTime() / 1000 + 120);
|
||||
fade = 255 - 120;
|
||||
|
||||
62
Client/Interaction/factioninteraction.js
Normal file
62
Client/Interaction/factioninteraction.js
Normal file
@@ -0,0 +1,62 @@
|
||||
let screenRes = mp.game.graphics.getScreenResolution(0, 0);
|
||||
|
||||
const NativeUI = require("nativeui");
|
||||
const Menu = NativeUI.Menu;
|
||||
const UIMenuItem = NativeUI.UIMenuItem;
|
||||
const UIMenuListItem = NativeUI.UIMenuListItem;
|
||||
const UIMenuCheckboxItem = NativeUI.UIMenuCheckboxItem;
|
||||
const BadgeStyle = NativeUI.BadgeStyle;
|
||||
const Point = NativeUI.Point;
|
||||
const ItemsCollection = NativeUI.ItemsCollection;
|
||||
const Color = NativeUI.Color;
|
||||
|
||||
mp.events.add("showFactionInteraction", (userFactionId, userFactionName, isFactionLeader, reviveTaskCount, healTaskCount, fireTaskCount) => {
|
||||
|
||||
mp.gui.chat.activate(false);
|
||||
globalData.Interaction = true;
|
||||
|
||||
|
||||
let factionInteractionMenu = new Menu("Fraktionsinteraktion", userFactionName, new Point(0, screenRes.y / 2));
|
||||
|
||||
if (isFactionLeader) {
|
||||
let leaderMenu = new UIMenuItem("Leadermen\u00fc", "Verwaltung der Fraktion");
|
||||
leaderMenu.SetRightBadge(BadgeStyle.Star);
|
||||
factionInteractionMenu.AddItem(leaderMenu);
|
||||
}
|
||||
|
||||
switch (userFactionId) {
|
||||
case 2:
|
||||
let reviveTaskMenu = new UIMenuItem("Reviveauftr\u00e4ge");
|
||||
reviveTaskMenu.SetRightLabel(reviveTaskCount.toString())
|
||||
factionInteractionMenu.AddItem(reviveTaskMenu);
|
||||
|
||||
let healTaskMenu = new UIMenuItem("Healauftr\u00e4ge");
|
||||
reviveTaskMenu.SetRightLabel(healTaskCount.toString())
|
||||
factionInteractionMenu.AddItem(healTaskMenu);
|
||||
|
||||
let fireTaskMenu = new UIMenuItem("Reviveauftr\u00e4ge");
|
||||
reviveTaskMenu.SetRightLabel(fireTaskCount.toString())
|
||||
factionInteractionMenu.AddItem(fireTaskMenu);
|
||||
break;
|
||||
}
|
||||
|
||||
let cancelItem = new UIMenuItem("Schlie\u00dfen", "Schlie\u00dft die Spielerinteraktion");
|
||||
cancelItem.BackColor = new Color(213, 0, 0);
|
||||
cancelItem.HighlightedBackColor = new Color(229, 57, 53);
|
||||
factionInteractionMenu.AddItem(cancelItem);
|
||||
|
||||
factionInteractionMenu.Visible = true;
|
||||
|
||||
factionInteractionMenu.ItemSelect.on((item) => {
|
||||
if (item.Text === "Schlie\u00dfen") {
|
||||
factionInteractionMenu.Visible = false;
|
||||
mp.gui.chat.activate(true);
|
||||
globalData.Interaction = false;
|
||||
}
|
||||
});
|
||||
|
||||
factionInteractionMenu.MenuClose.on(() => {
|
||||
mp.gui.chat.activate(true);
|
||||
globalData.Interaction = false;
|
||||
});
|
||||
});
|
||||
@@ -42,7 +42,7 @@ const Color = NativeUI.Color;
|
||||
mp.events.add("showPlayerInteraction", (nearPlayerArr) => {
|
||||
mp.gui.chat.activate(false);
|
||||
nearbyPlayers = JSON.parse(nearPlayerArr);
|
||||
globalData.PlayerInteraction = true;
|
||||
globalData.Interaction = true;
|
||||
let playerInteractionMenu = new Menu("Spielerinteraktion", "", new Point(0, screenRes.y / 2));
|
||||
let playerSelect = new UIMenuListItem("Mit", "~y~W\u00e4hle den Spieler aus.", new ItemsCollection(nearbyPlayers));
|
||||
playerInteractionMenu.AddItem(playerSelect);
|
||||
@@ -60,17 +60,17 @@ mp.events.add("showPlayerInteraction", (nearPlayerArr) => {
|
||||
mp.events.callRemote("openTradeInventory", playerSelect.SelectedValue);
|
||||
playerInteractionMenu.Visible = false;
|
||||
mp.gui.chat.activate(true);
|
||||
globalData.PlayerInteraction = false;
|
||||
globalData.Interaction = false;
|
||||
} else if (item.Text === "Schlie\u00dfen") {
|
||||
playerInteractionMenu.Visible = false;
|
||||
mp.gui.chat.activate(true);
|
||||
globalData.PlayerInteraction = false;
|
||||
globalData.Interaction = false;
|
||||
}
|
||||
});
|
||||
|
||||
playerInteractionMenu.MenuClose.on(() => {
|
||||
mp.gui.chat.activate(true);
|
||||
globalData.PlayerInteraction = false;
|
||||
globalData.Interaction = false;
|
||||
});
|
||||
});
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
|
||||
//https://docs.microsoft.com/de-de/windows/desktop/inputdev/virtual-key-codes
|
||||
|
||||
var chat = false;
|
||||
var showInventory = false;
|
||||
var showGui = true;
|
||||
var showInv = false;
|
||||
@@ -22,12 +21,31 @@ mp.keys.bind(0x0D, false, function () {
|
||||
|
||||
//LEFT ARROW (Interaktion mit anderen Spielern)
|
||||
mp.keys.bind(0x25, false, function () {
|
||||
if (!globalData.InChat && !showInv && !globalData.PlayerInteraction) {
|
||||
mp.events.callRemote("keyPress:LEFT_ARROW");
|
||||
if (!globalData.InChat && !showInv && !globalData.Interaction) {
|
||||
mp.events.callRemote("keyPress:LEFT_ARROW");
|
||||
}
|
||||
});
|
||||
|
||||
//UP ARROW (Interaktion mit anderen Spielern)
|
||||
mp.keys.bind(0x26, false, function () {
|
||||
if (!globalData.InChat && !showInv && !globalData.Interaction) {
|
||||
mp.events.callRemote("keyPress:UP_ARROW");
|
||||
}
|
||||
});
|
||||
|
||||
//RIGHT ARROW (Interaktion mit anderen Spielern)
|
||||
mp.keys.bind(0x27, false, function () {
|
||||
if (!globalData.InChat && !showInv && !globalData.Interaction) {
|
||||
mp.events.callRemote("keyPress:RIGHT_ARROW");
|
||||
}
|
||||
});
|
||||
|
||||
//DOWN ARROW (Interaktion mit anderen Spielern)
|
||||
mp.keys.bind(0x28, false, function () {
|
||||
if (!globalData.InChat && !showInv && !globalData.Interaction) {
|
||||
mp.events.callRemote("keyPress:DOWN_ARROW");
|
||||
}
|
||||
});
|
||||
//F7 //Unshowalles
|
||||
mp.keys.bind(0x76, false, function () {
|
||||
if (showGui === true) {
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
* @overview Life of German Reallife - Login index.js
|
||||
* @author VegaZ, hydrant
|
||||
* @copyright (c) 2008 - 2018 Life of German
|
||||
*/
|
||||
**/
|
||||
|
||||
let globalData = {
|
||||
InTuning: false,
|
||||
HideGui: false,
|
||||
PlayerInteraction: false,
|
||||
Interaction: false,
|
||||
InChat: false
|
||||
};
|
||||
|
||||
@@ -19,6 +19,7 @@ require('./Business/main.js');
|
||||
require('./Business/cardealer.js');
|
||||
|
||||
require('./CharCreator/index.js');
|
||||
|
||||
require('./coloredhlights');
|
||||
|
||||
require('./DoorManager/doormanager.js');
|
||||
@@ -33,7 +34,8 @@ require('./Gui/Inventory/inventory.js');
|
||||
require('./Gui/vehiclemenu/main.js');
|
||||
require('./Gui/interiors.js');
|
||||
|
||||
require('./Interaction/interaction.js');
|
||||
require('./Interaction/factioninteraction.js');
|
||||
require('./Interaction/playerinteraction.js');
|
||||
|
||||
require('./Login/main.js');
|
||||
|
||||
@@ -43,6 +45,7 @@ require('./Player/quit.js');
|
||||
require('./Player/freecam.js');
|
||||
|
||||
require('./Save/main.js');
|
||||
|
||||
require('./Speedometer/index.js');
|
||||
|
||||
require('./Tuning/main.js');
|
||||
|
||||
Reference in New Issue
Block a user