Changed whole project structure (split client and server into separat projects)
This commit is contained in:
1026
ReallifeGamemode.Client/Gui/Inventory/inventory.js
Normal file
1026
ReallifeGamemode.Client/Gui/Inventory/inventory.js
Normal file
File diff suppressed because it is too large
Load Diff
102
ReallifeGamemode.Client/Gui/deathscreen.js
Normal file
102
ReallifeGamemode.Client/Gui/deathscreen.js
Normal file
@@ -0,0 +1,102 @@
|
||||
/**
|
||||
* @overview Life of German Reallife - Gui Infobox infobox.js
|
||||
* @author VegaZ
|
||||
* @copyright (c) 2008 - 2018 Life of German
|
||||
*/
|
||||
|
||||
var playerName;
|
||||
var playerId;
|
||||
var playerMoney;
|
||||
var dutyMedics = 0;
|
||||
|
||||
var isDeath = false;
|
||||
var deathTime;
|
||||
var respawnTime;
|
||||
var deathSeconds;
|
||||
var fade;
|
||||
|
||||
mp.game.gameplay.setFadeOutAfterDeath(false);
|
||||
|
||||
mp.events.add("startDeathTimer", (isAdmin) => {
|
||||
if (isDeath === false) {
|
||||
isDeath = true;
|
||||
if (isAdmin) {
|
||||
mp.gui.chat.activate(true);
|
||||
}
|
||||
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;
|
||||
mp.game.graphics.requestStreamedTextureDict("Mptattoos", true);
|
||||
}
|
||||
});
|
||||
|
||||
mp.events.add("onPlayerRevived", () => {
|
||||
isDeath = false;
|
||||
mp.gui.chat.activate(true);
|
||||
mp.game.gameplay.setFadeOutAfterDeath(false);
|
||||
mp.game.graphics.setStreamedTextureDictAsNoLongerNeeded("Mptattoos");
|
||||
});
|
||||
|
||||
mp.events.add("respawnDeathPlayer", () => {
|
||||
isDeath = false;
|
||||
mp.gui.chat.activate(true);
|
||||
mp.game.gameplay.setFadeOutAfterDeath(false);
|
||||
mp.events.callRemote('RespawnPlayerAtHospital');
|
||||
mp.game.graphics.setStreamedTextureDictAsNoLongerNeeded("Mptattoos");
|
||||
});
|
||||
|
||||
mp.events.add("updateDutyMedics", (count) => {
|
||||
dutyMedics = count;
|
||||
});
|
||||
|
||||
|
||||
|
||||
mp.events.add("render", () => {
|
||||
currentDate = new Date();
|
||||
|
||||
if (isDeath === true) {
|
||||
|
||||
var medicString;
|
||||
if (dutyMedics > 0) {
|
||||
medicString = "Derzeit ";
|
||||
if (dutyMedics === 1) {
|
||||
medicString += "ist ~g~" + dutyMedics + " Medic";
|
||||
} else {
|
||||
medicString = "sind ~g~" + dutyMedics + " Medics";
|
||||
}
|
||||
medicString += " ~s~im Dienst ~c~und versuchen dich wiederzubeleben...";
|
||||
} else {
|
||||
medicString = "Derzeit sind ~r~keine Medics ~s~im Dienst.";
|
||||
}
|
||||
|
||||
deathSeconds = respawnTime - Math.floor(currentDate.getTime() / 1000);
|
||||
var alpha = fade + Math.floor(currentDate.getTime() / 1000 - deathDate.getTime() / 1000);
|
||||
if (deathSeconds >= 0) {
|
||||
mp.game.graphics.set2dLayer(2);
|
||||
mp.game.graphics.drawSprite("Mptattoos", "clearout", 0.625, 0.52, 0.1, 0.1, 0, 255, 255, 255, 236);
|
||||
mp.game.graphics.drawText("Respawn in: ~y~" + deathSeconds, [0.5, 0.5],
|
||||
{
|
||||
font: 7,
|
||||
color: [255, 255, 255, 255],
|
||||
scale: [0.8, 0.8],
|
||||
outline: true
|
||||
});
|
||||
mp.game.graphics.drawText(medicString, [0.5, 0.975],
|
||||
{
|
||||
font: 4,
|
||||
color: [255, 255, 255, 255],
|
||||
scale: [0.4, 0.4],
|
||||
outline: true
|
||||
});
|
||||
mp.game.graphics.set2dLayer(1);
|
||||
mp.game.graphics.drawRect(0.5, 0.5, 1, 1, 0, 0, 0, alpha);
|
||||
|
||||
} else {
|
||||
mp.events.call("respawnDeathPlayer");
|
||||
}
|
||||
}
|
||||
});
|
||||
208
ReallifeGamemode.Client/Gui/infobox.js
Normal file
208
ReallifeGamemode.Client/Gui/infobox.js
Normal file
@@ -0,0 +1,208 @@
|
||||
/**
|
||||
* @overview Life of German Reallife - Gui Infobox infobox.js
|
||||
* @author VegaZ
|
||||
* @copyright (c) 2008 - 2018 Life of German
|
||||
*/
|
||||
|
||||
var currentdate;
|
||||
var dateString;
|
||||
var timeString;
|
||||
|
||||
var draw = false;
|
||||
var editMode = false;
|
||||
|
||||
let posX = 0.92;
|
||||
let posY = 0.45;
|
||||
let width = 0.1;
|
||||
let height = 0.2;
|
||||
let colorR = 0;
|
||||
let colorG = 0;
|
||||
let colorB = 0;
|
||||
let colorA = 72;
|
||||
|
||||
var day;
|
||||
var month;
|
||||
var year;
|
||||
var hour;
|
||||
var minute;
|
||||
var second;
|
||||
|
||||
var nDay;
|
||||
var nMonth;
|
||||
var nHour;
|
||||
var nMinute;
|
||||
var nSecond;
|
||||
|
||||
var playerName;
|
||||
var playerId;
|
||||
var playerMoney;
|
||||
|
||||
mp.events.add("draw", (pName, pId) => {
|
||||
playerName = pName;
|
||||
playerId = pId;
|
||||
draw = true;
|
||||
|
||||
});
|
||||
|
||||
mp.events.add("toggleEditMode", (toggle) => {
|
||||
editMode = toggle;
|
||||
});
|
||||
|
||||
mp.events.add("toggleUi", (show) => {
|
||||
if (show === false) {
|
||||
draw = false;
|
||||
mp.game.ui.displayRadar(false);
|
||||
mp.game.ui.displayHud(false);
|
||||
mp.gui.chat.show(false);
|
||||
globalData.HideGui = true;
|
||||
} else {
|
||||
draw = true;
|
||||
mp.game.ui.displayRadar(true);
|
||||
mp.game.ui.displayHud(true);
|
||||
mp.gui.chat.show(true);
|
||||
globalData.HideGui = false;
|
||||
}
|
||||
});
|
||||
|
||||
//function currencyFormatDE(num) {
|
||||
// return ('$' + num.toFixed(2).replace('.', ',').replace(/(\d)(?=(\d{3})+(?!\d))/g, '$1.'));
|
||||
//}
|
||||
|
||||
const moneyFormat = require("moneyformat");
|
||||
|
||||
mp.events.add("updateMoney", (money) => {
|
||||
playerMoney = moneyFormat(money);
|
||||
});
|
||||
|
||||
mp.events.add("render", () => {
|
||||
|
||||
if (draw === true) {
|
||||
currentdate = new Date();
|
||||
|
||||
day = currentdate.getDate();
|
||||
month = currentdate.getMonth();
|
||||
year = currentdate.getFullYear();
|
||||
|
||||
hour = currentdate.getHours();
|
||||
minute = currentdate.getMinutes();
|
||||
second = currentdate.getSeconds();
|
||||
|
||||
if (day < 10) {
|
||||
nDay = "0" + day;
|
||||
} else nDay = day;
|
||||
|
||||
if (hour < 10) {
|
||||
nHour = "0" + hour;
|
||||
} else nHour = hour;
|
||||
|
||||
if (minute < 10) {
|
||||
nMinute = "0" + minute;
|
||||
} else nMinute = minute;
|
||||
|
||||
if (second < 10) {
|
||||
nSecond = "0" + second;
|
||||
} else nSecond = second;
|
||||
|
||||
switch (month) {
|
||||
case 0:
|
||||
nMonth = "Jan.";
|
||||
break;
|
||||
case 1:
|
||||
nMonth = "Feb.";
|
||||
break;
|
||||
case 2:
|
||||
nMonth = "Mär.";
|
||||
break;
|
||||
case 3:
|
||||
nMonth = "Apr.";
|
||||
break;
|
||||
case 4:
|
||||
nMonth = "Mai";
|
||||
break;
|
||||
case 5:
|
||||
nMonth = "Jun.";
|
||||
break;
|
||||
case 6:
|
||||
nMonth = "Jul.";
|
||||
break;
|
||||
case 7:
|
||||
nMonth = "Aug.";
|
||||
break;
|
||||
case 8:
|
||||
nMonth = "Sep.";
|
||||
break;
|
||||
case 9:
|
||||
nMonth = "Okt.";
|
||||
break;
|
||||
case 10:
|
||||
nMonth = "Nov.";
|
||||
break;
|
||||
case 11:
|
||||
nMonth = "Dez.";
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
|
||||
dateString = nDay + ". " + nMonth + " " + year;
|
||||
timeString = nHour + ":" + nMinute + ":" + nSecond + " Uhr";
|
||||
|
||||
mp.game.graphics.requestStreamedTextureDict("digitaloverlay", true);
|
||||
//static
|
||||
mp.game.graphics.drawSprite("digitaloverlay", "static1", posX, posY, width, height, 0, 0, 255, 0, 88);
|
||||
//mp.game.graphics.drawRect(posX, posY, width, height, colorR, colorG, colorB, colorA);
|
||||
mp.game.graphics.drawText(playerName + " (" + playerId + ")", [0.92, 0.351],
|
||||
{
|
||||
font: 4,
|
||||
color: [255, 255, 255, 255],
|
||||
scale: [0.5, 0.5],
|
||||
outline: true
|
||||
})
|
||||
|
||||
mp.game.graphics.drawText(dateString + "\n" + timeString, [0.938, 0.381],
|
||||
{
|
||||
font: 4,
|
||||
color: [255, 255, 255, 255],
|
||||
scale: [0.5, 0.5],
|
||||
outline: true
|
||||
})
|
||||
|
||||
mp.game.graphics.drawText("~g~$~s~" + playerMoney, [0.938, 0.441],
|
||||
{
|
||||
font: 4,
|
||||
color: [255, 255, 255, 255],
|
||||
scale: [0.5, 0.5],
|
||||
outline: true
|
||||
})
|
||||
mp.game.graphics.drawText("~r~Datum: ", [0.89, 0.381],
|
||||
{
|
||||
font: 4,
|
||||
color: [255, 255, 255, 255],
|
||||
scale: [0.5, 0.5],
|
||||
outline: true
|
||||
})
|
||||
mp.game.graphics.drawText("~r~Uhrzeit: ", [0.891, 0.411],
|
||||
{
|
||||
font: 4,
|
||||
color: [255, 255, 255, 255],
|
||||
scale: [0.5, 0.5],
|
||||
outline: true
|
||||
})
|
||||
mp.game.graphics.drawText("~y~Bank: ", [0.887, 0.441],
|
||||
{
|
||||
font: 4,
|
||||
color: [255, 255, 255, 255],
|
||||
scale: [0.5, 0.5],
|
||||
outline: true
|
||||
})
|
||||
}
|
||||
if (editMode === true) {
|
||||
mp.game.graphics.drawText("~r~EDIT-MODE AKTIV", [0.5, 0],
|
||||
{
|
||||
font: 4,
|
||||
color: [255, 255, 255, 255],
|
||||
scale: [0.7, 0.7],
|
||||
outline: true
|
||||
})
|
||||
}
|
||||
});
|
||||
31
ReallifeGamemode.Client/Gui/interiors.js
Normal file
31
ReallifeGamemode.Client/Gui/interiors.js
Normal file
@@ -0,0 +1,31 @@
|
||||
var keyBound = false;
|
||||
var interiorId = -1;
|
||||
var enterExit = undefined;
|
||||
|
||||
mp.events.add('InteriorManager_ClearHelpText', () => {
|
||||
mp.game.ui.clearHelp(true);
|
||||
|
||||
enterExit = undefined;
|
||||
|
||||
if (keyBound) {
|
||||
mp.keys.unbind(0x45, false, keyPressHandler);
|
||||
keyBound = false;
|
||||
}
|
||||
});
|
||||
|
||||
mp.events.add('InteriorManager_ShowHelpText', (interior, intId, entEx) => {
|
||||
mp.game.ui.setTextComponentFormat('STRING');
|
||||
mp.game.ui.addTextComponentSubstringPlayerName('Drücke ~INPUT_CONTEXT~, um ~b~' + interior + ' ~s~zu ' + (entEx === 0 ? 'betreten' : 'verlassen'));
|
||||
mp.game.ui.displayHelpTextFromStringLabel(0, true, true, -1);
|
||||
|
||||
interiorId = intId;
|
||||
enterExit = entEx;
|
||||
|
||||
mp.keys.bind(0x45, false, keyPressHandler);
|
||||
keyBound = true;
|
||||
});
|
||||
|
||||
function keyPressHandler() {
|
||||
if (globalData.InChat) return;
|
||||
mp.events.callRemote('InteriorManager_UseTeleport', interiorId, enterExit);
|
||||
}
|
||||
57
ReallifeGamemode.Client/Gui/nametags.js
Normal file
57
ReallifeGamemode.Client/Gui/nametags.js
Normal file
@@ -0,0 +1,57 @@
|
||||
const maxDistance = 25 * 25;
|
||||
const width = 0.03;
|
||||
const height = 0.0065;
|
||||
const border = 0.001;
|
||||
const color = [255, 255, 255, 255];
|
||||
|
||||
mp.nametags.enabled = false;
|
||||
|
||||
mp.events.add('render', (nametags) => {
|
||||
const graphics = mp.game.graphics;
|
||||
const screenRes = graphics.getScreenResolution(0, 0);
|
||||
|
||||
nametags.forEach(nametag => {
|
||||
let [player, x, y, distance] = nametag;
|
||||
|
||||
if (distance <= maxDistance) {
|
||||
let scale = distance / maxDistance;
|
||||
if (scale < 0.6) scale = 0.6;
|
||||
|
||||
var health = player.getHealth();
|
||||
health = health < 100 ? 0 : (health - 100) / 100;
|
||||
|
||||
var armour = player.getArmour() / 100;
|
||||
|
||||
y -= scale * (0.005 * (screenRes.y / 1080));
|
||||
|
||||
mp.game.graphics.drawText(player.name + " (" + player.remoteId + ")", [x, y],
|
||||
{
|
||||
font: 4,
|
||||
color: [255, 255, 255, 255],
|
||||
scale: [0.4, 0.4],
|
||||
outline: true
|
||||
});
|
||||
|
||||
if (mp.game.player.isFreeAimingAtEntity(player.handle)) {
|
||||
let y2 = y + 0.042;
|
||||
|
||||
if (armour > 0) {
|
||||
graphics.drawRect(x, y2, width + border * 2, 0.0085, 0, 0, 0, 200);
|
||||
graphics.drawRect(x, y2, width, height, 150, 150, 150, 255);
|
||||
graphics.drawRect(x - width / 2 * (1 - health), y2, width * health, height, 255, 255, 255, 200);
|
||||
|
||||
x2 = x + width / 2 + border / 2;
|
||||
|
||||
graphics.drawRect(x, y2 + height, width + border * 2, height + border * 2, 0, 0, 0, 200);
|
||||
graphics.drawRect(x, y2 + height, width, height, 41, 66, 78, 255);
|
||||
graphics.drawRect(x - width / 2 * (1 - armour), y2 + height, width * armour, height, 48, 108, 135, 200);
|
||||
}
|
||||
else {
|
||||
graphics.drawRect(x, y2, width + border * 2, height + border * 2, 0, 0, 0, 200);
|
||||
graphics.drawRect(x, y2, width, height, 150, 150, 150, 255);
|
||||
graphics.drawRect(x - width / 2 * (1 - health), y2, width * health, height, 255, 255, 255, 200);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
40
ReallifeGamemode.Client/Gui/playerlist.html
Normal file
40
ReallifeGamemode.Client/Gui/playerlist.html
Normal file
@@ -0,0 +1,40 @@
|
||||
<!--
|
||||
* @overview Life of German Reallife - Client Gui playerlist.html
|
||||
* @author VegaZ
|
||||
* @copyright (c) 2008 - 2018 Life of German
|
||||
*-->
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<link rel="stylesheet" href="style.css" />
|
||||
<script src="playerlist.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="playerlist">
|
||||
<div id="testDiv"></div>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th><center>ID</center></th>
|
||||
<th>Name</th>
|
||||
<th><center>Ping</center></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="playerData"></tbody>
|
||||
</table>
|
||||
</div>
|
||||
<script src="jquery-3.3.1.min.js"></script>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
//var table;
|
||||
for (var player in pList) {
|
||||
$("#playerData").append("<tr><td>" + player.Id + "</td><td>" + player.Name + "</td><td>" + player.Ping + "</td></tr>");
|
||||
//table =+ tableRow;
|
||||
}
|
||||
//document.getElementById("testDiv").innerHTML = table;
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
35
ReallifeGamemode.Client/Gui/playerlist.js
Normal file
35
ReallifeGamemode.Client/Gui/playerlist.js
Normal file
@@ -0,0 +1,35 @@
|
||||
/**
|
||||
* @overview Life of German Reallife - Gui Playerlist playerlist.js
|
||||
* @author VegaZ
|
||||
* @copyright (c) 2008 - 2018 Life of German
|
||||
*/
|
||||
|
||||
var playerlistBrowser
|
||||
var pList;
|
||||
|
||||
mp.events.add("showPlayerlist", () => {
|
||||
if (!playerlistBrowser) {
|
||||
playerlistBrowser = mp.browsers.new('package://Gui/playerlist.html');
|
||||
mp.gui.chat.activate(false);
|
||||
mp.gui.cursor.show(true, true);
|
||||
}
|
||||
});
|
||||
|
||||
mp.events.add("fetchPlayerList", (playersJson) => {
|
||||
|
||||
pList = JSON.parse(playersJson);
|
||||
|
||||
pList.forEach((player) => {
|
||||
mp.gui.chat.push(player.Id + ", " + player.Name + ", " + player.Ping);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
//function getTable() {
|
||||
// var table = "";
|
||||
// pList.forEach((player) => {
|
||||
// var tableRow = "<tr><td>" + player.Id + "</td><td>" + player.Name + "</td><td>" + player.Ping + "</td>";
|
||||
// table = table + tableRow;
|
||||
// })
|
||||
// return document.write(table);
|
||||
//}
|
||||
8
ReallifeGamemode.Client/Gui/script.js
Normal file
8
ReallifeGamemode.Client/Gui/script.js
Normal file
@@ -0,0 +1,8 @@
|
||||
$(document).ready(function () {
|
||||
|
||||
mp.trig
|
||||
|
||||
for (var player in pList) {
|
||||
$("#playerData").append("<tr><td>" + player.Id + "</td><td>" + player.Name + "</td><td>" + player.Ping + "</td></tr>");
|
||||
}
|
||||
});
|
||||
38
ReallifeGamemode.Client/Gui/style.css
Normal file
38
ReallifeGamemode.Client/Gui/style.css
Normal file
@@ -0,0 +1,38 @@
|
||||
/**
|
||||
* @overview Life of German Reallife - Save CSS style.css
|
||||
* @author Orangebox, hydrant, VegaZ
|
||||
* @copyright (c) 2008 - 2018 Life of German
|
||||
*/
|
||||
|
||||
.playerlist {
|
||||
background-color: rgba(61, 68, 87, 0.50);
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
margin-right: -50%;
|
||||
transform: translate(-50%, -50%);
|
||||
min-width: 60%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: "Roboto", sans-serif;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
overflow: hidden;
|
||||
}
|
||||
td {
|
||||
align-content: stretch;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.2), 0 0 0 0 rgba(0, 0, 0, 0.24);
|
||||
border-top: 2px double gray;
|
||||
border-bottom: 2px double gray;
|
||||
border-width: 0.5px;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
table {
|
||||
margin: auto;
|
||||
align-self:center;
|
||||
width: 100%;
|
||||
}
|
||||
103
ReallifeGamemode.Client/Gui/vehiclemenu/main.js
Normal file
103
ReallifeGamemode.Client/Gui/vehiclemenu/main.js
Normal file
@@ -0,0 +1,103 @@
|
||||
let menuBrowser = null;
|
||||
|
||||
const NativeUI = require('nativeui');
|
||||
const Menu = NativeUI.Menu;
|
||||
const UIMenuItem = NativeUI.UIMenuItem;
|
||||
const UIMenuListItem = NativeUI.UIMenuListItem;
|
||||
const UIMenuCheckboxItem = NativeUI.UIMenuCheckboxItem;
|
||||
const UIMenuSliderItem = NativeUI.UIMenuSliderItem;
|
||||
const BadgeStyle = NativeUI.BadgeStyle;
|
||||
const Point = NativeUI.Point;
|
||||
const ItemsCollection = NativeUI.ItemsCollection;
|
||||
const Color = NativeUI.Color;
|
||||
const ListItem = NativeUI.ListItem;
|
||||
|
||||
mp.events.add('ToggleVehicleMenu', () => {
|
||||
if (menuBrowser !== null) {
|
||||
menuBrowser.destroy();
|
||||
menuBrowser = null;
|
||||
mp.gui.chat.show(true);
|
||||
mp.gui.cursor.show(false, false);
|
||||
mp.game.graphics.stopScreenEffect("FocusIn");
|
||||
mp.game.graphics.startScreenEffect("FocusOut", 0, false);
|
||||
return;
|
||||
}
|
||||
|
||||
mp.game.graphics.stopScreenEffect("FocusOut");
|
||||
mp.game.graphics.startScreenEffect("FocusIn", 0, false);
|
||||
menuBrowser = mp.browsers.new("package://assets/html/vehiclemenu/index.html");
|
||||
mp.gui.chat.show(false);
|
||||
mp.gui.cursor.show(true, true);
|
||||
});
|
||||
|
||||
mp.events.add('doAction', (action) => {
|
||||
mp.events.call('ToggleVehicleMenu');
|
||||
switch (action) {
|
||||
case 8: // Motor
|
||||
mp.events.callRemote("VehicleMenu_ToggleEngine");
|
||||
break;
|
||||
case 5: // Auf -/ Abschließen
|
||||
mp.events.callRemote("VehicleMenu_LockCar");
|
||||
break;
|
||||
case 3: // Türen
|
||||
showDoorsMenu();
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
function showDoorsMenu() {
|
||||
mp.gui.chat.show(false);
|
||||
|
||||
var doorMenu = new Menu("Türen", "Türen verwalten", new Point(50, 50));
|
||||
|
||||
doorMenu.AddItem(new UIMenuListItem("Tür", "Welche Tür darf's sein?", new ItemsCollection([
|
||||
" Fahrertür",
|
||||
" Beifahrertür",
|
||||
"Hinten links",
|
||||
"Hinten rechts",
|
||||
"Motorhaube",
|
||||
"Kofferraum"
|
||||
])));
|
||||
|
||||
doorMenu.AddItem(new UIMenuItem("Alle öffnen", "Öffnet alle Türen"));
|
||||
doorMenu.AddItem(new UIMenuItem("Alle schließen", "Schließt alle Türen"));
|
||||
|
||||
doorMenu.ItemSelect.on((item, index) => {
|
||||
if (index === 0) {
|
||||
var doorId = -1;
|
||||
switch (item.SelectedItem.DisplayText) {
|
||||
case " Fahrertür":
|
||||
doorId = 0;
|
||||
break;
|
||||
case " Beifahrertür":
|
||||
doorId = 1;
|
||||
break;
|
||||
case "Hinten links":
|
||||
doorId = 2;
|
||||
break;
|
||||
case "Hinten rechts":
|
||||
doorId = 3;
|
||||
break;
|
||||
case "Motorhaube":
|
||||
doorId = 4;
|
||||
break;
|
||||
case "Kofferraum":
|
||||
doorId = 5;
|
||||
break;
|
||||
}
|
||||
if (doorId !== -1) {
|
||||
mp.events.callRemote("VehicleMenu_ToggleSingleDoor", doorId);
|
||||
}
|
||||
} else if (index === 1) {
|
||||
mp.events.callRemote("VehicleMenu_OpenAllDoors");
|
||||
} else if (index === 2) {
|
||||
mp.events.callRemote("VehicleMenu_CloseAllDoors");
|
||||
}
|
||||
});
|
||||
|
||||
doorMenu.MenuClose.on(() => {
|
||||
mp.gui.chat.show(true);
|
||||
});
|
||||
|
||||
doorMenu.Open();
|
||||
}
|
||||
Reference in New Issue
Block a user