Finalize Surgery
This commit is contained in:
@@ -0,0 +1,7 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
@@ -560,7 +560,7 @@ export default function charCreator(globalData: IGlobalData) {
|
|||||||
|
|
||||||
// EVENTS
|
// EVENTS
|
||||||
mp.events.add("toggleCreator", (charExists) => {
|
mp.events.add("toggleCreator", (charExists) => {
|
||||||
if (creatorCamera === undefined) {
|
if (!mp.cameras.exists(creatorCamera)) {
|
||||||
if (charExists) {
|
if (charExists) {
|
||||||
creatorCamera = mp.cameras.new("creatorCamera", surgeryCoords.camera, new mp.Vector3(0, 0, 0), 45);
|
creatorCamera = mp.cameras.new("creatorCamera", surgeryCoords.camera, new mp.Vector3(0, 0, 0), 45);
|
||||||
creatorCamera.pointAtCoord(surgeryCoords.cameraLookAt.x, surgeryCoords.cameraLookAt.y, surgeryCoords.cameraLookAt.z);
|
creatorCamera.pointAtCoord(surgeryCoords.cameraLookAt.x, surgeryCoords.cameraLookAt.y, surgeryCoords.cameraLookAt.z);
|
||||||
@@ -572,6 +572,11 @@ export default function charCreator(globalData: IGlobalData) {
|
|||||||
creatorCamera.setActive(true);
|
creatorCamera.setActive(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resetAppearanceMenu();
|
||||||
|
resetFeaturesMenu();
|
||||||
|
resetHairAndColorsMenu();
|
||||||
|
resetParentsMenu();
|
||||||
|
|
||||||
globalData.InMenu = true;
|
globalData.InMenu = true;
|
||||||
globalData.InMenu = true;
|
globalData.InMenu = true;
|
||||||
|
|
||||||
@@ -582,6 +587,7 @@ export default function charCreator(globalData: IGlobalData) {
|
|||||||
localPlayer.clearTasksImmediately();
|
localPlayer.clearTasksImmediately();
|
||||||
localPlayer.freezePosition(true);
|
localPlayer.freezePosition(true);
|
||||||
mp.game.cam.renderScriptCams(true, false, 0, true, false);
|
mp.game.cam.renderScriptCams(true, false, 0, true, false);
|
||||||
|
applyCreatorOutfit();
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -601,7 +607,7 @@ export default function charCreator(globalData: IGlobalData) {
|
|||||||
mp.game.ui.displayHud(true);
|
mp.game.ui.displayHud(true);
|
||||||
localPlayer.freezePosition(false);
|
localPlayer.freezePosition(false);
|
||||||
mp.game.cam.renderScriptCams(false, false, 0, true, false);
|
mp.game.cam.renderScriptCams(false, false, 0, true, false);
|
||||||
creatorCamera.destroy(true);
|
creatorCamera.destroy();
|
||||||
globalData.InMenu = false;
|
globalData.InMenu = false;
|
||||||
globalData.InMenu = false;
|
globalData.InMenu = false;
|
||||||
if (isSurgery) isSurgery = false;
|
if (isSurgery) isSurgery = false;
|
||||||
|
|||||||
55
ReallifeGamemode.Client/Gui/bigmap.ts
Normal file
55
ReallifeGamemode.Client/Gui/bigmap.ts
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
import { GlobalData } from "..";
|
||||||
|
|
||||||
|
export default function bigmap() {
|
||||||
|
var bigmap = { status: 0, timer: null };
|
||||||
|
|
||||||
|
bigmap.status = 0;
|
||||||
|
bigmap.timer = null;
|
||||||
|
|
||||||
|
mp.game.ui.setRadarZoom(1.0);
|
||||||
|
mp.game.ui.setRadarBigmapEnabled(false, false);
|
||||||
|
|
||||||
|
mp.events.add("render", () => {
|
||||||
|
mp.game.controls.disableControlAction(0, 48, true);
|
||||||
|
if (mp.game.controls.isDisabledControlJustPressed(0, 48) && !GlobalData.InChat) {
|
||||||
|
if (bigmap.status === 0) {
|
||||||
|
mp.game.ui.setRadarZoom(0.0);
|
||||||
|
bigmap.status = 1;
|
||||||
|
|
||||||
|
bigmap.timer = setTimeout(() => {
|
||||||
|
mp.game.ui.setRadarBigmapEnabled(false, true);
|
||||||
|
mp.game.ui.setRadarZoom(1.0);
|
||||||
|
|
||||||
|
bigmap.status = 0;
|
||||||
|
bigmap.timer = null;
|
||||||
|
}, 10000);
|
||||||
|
} else if (bigmap.status === 1) {
|
||||||
|
if (bigmap.timer != null) {
|
||||||
|
clearTimeout(bigmap.timer);
|
||||||
|
bigmap.timer = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
mp.game.ui.setRadarBigmapEnabled(true, false);
|
||||||
|
mp.game.ui.setRadarZoom(0.0);
|
||||||
|
bigmap.status = 2;
|
||||||
|
|
||||||
|
bigmap.timer = setTimeout(() => {
|
||||||
|
mp.game.ui.setRadarBigmapEnabled(false, true);
|
||||||
|
mp.game.ui.setRadarZoom(1.0);
|
||||||
|
|
||||||
|
bigmap.status = 0;
|
||||||
|
bigmap.timer = null;
|
||||||
|
}, 10000);
|
||||||
|
} else {
|
||||||
|
if (bigmap.timer != null) {
|
||||||
|
clearTimeout(bigmap.timer);
|
||||||
|
bigmap.timer = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
mp.game.ui.setRadarBigmapEnabled(false, false);
|
||||||
|
mp.game.ui.setRadarZoom(1.0);
|
||||||
|
bigmap.status = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -1,6 +1,13 @@
|
|||||||
export default function playerBlips() {
|
import { afkStatus } from '../Player/antiafk';
|
||||||
|
import { getWantedCount } from './wanteds';
|
||||||
|
|
||||||
|
export default function playerBlips() {
|
||||||
var playerBlipMap: Map<PlayerMp, BlipMp>;
|
var playerBlipMap: Map<PlayerMp, BlipMp>;
|
||||||
var ready = false;
|
var ready = false;
|
||||||
|
var escapeTimer = null;
|
||||||
|
|
||||||
|
const PD_BLIP = 38;
|
||||||
|
const FIB_BLIP = 63;
|
||||||
|
|
||||||
setInterval(() => {
|
setInterval(() => {
|
||||||
if (!ready) return;
|
if (!ready) return;
|
||||||
@@ -43,9 +50,30 @@
|
|||||||
|
|
||||||
pBlip.setColour(isNaN(color) ? 0 : color);
|
pBlip.setColour(isNaN(color) ? 0 : color);
|
||||||
pBlip.setPosition(player.position.x, player.position.y, player.position.z);
|
pBlip.setPosition(player.position.x, player.position.y, player.position.z);
|
||||||
|
|
||||||
|
if ((color == PD_BLIP || color == FIB_BLIP || afkStatus)) {
|
||||||
|
if (escapeTimer) {
|
||||||
|
mp.events.call("SERVER:SetWantedFlash", false);
|
||||||
|
clearInterval(escapeTimer);
|
||||||
|
escapeTimer = null;
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!escapeTimer && !afkStatus && getWantedCount() > 0) {
|
||||||
|
mp.events.call("SERVER:SetWantedFlash", true);
|
||||||
|
escapeTimer = setInterval(() => {
|
||||||
|
if (getWantedCount() == 0) {
|
||||||
|
clearInterval(escapeTimer);
|
||||||
|
escapeTimer = null;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
mp.events.callRemote("CLIENT:EscapeWanted");
|
||||||
|
}, 300000); //120000 -> 2 min , 300000 -> 5min
|
||||||
|
}
|
||||||
}, 50);
|
}, 50);
|
||||||
|
|
||||||
mp.events.add("playerReady", () => {
|
mp.events.add("playerReady", () => {
|
||||||
|
|||||||
@@ -308,8 +308,8 @@ export default function (globalData: IGlobalData): void {
|
|||||||
})
|
})
|
||||||
mp.game.graphics.drawRect(0.0, 0.555, 0.3, 0.11, 0, 0, 0, 70)
|
mp.game.graphics.drawRect(0.0, 0.555, 0.3, 0.11, 0, 0, 0, 70)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (editMode === true) {
|
if (editMode === true) {
|
||||||
mp.game.graphics.drawText("~r~EDIT-MODE AKTIV", [0.5, 0],
|
mp.game.graphics.drawText("~r~EDIT-MODE AKTIV", [0.5, 0],
|
||||||
{
|
{
|
||||||
|
|||||||
32
ReallifeGamemode.Client/Gui/notification.ts
Normal file
32
ReallifeGamemode.Client/Gui/notification.ts
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
export default function notification() {
|
||||||
|
const _SET_NOTIFICATION_COLOR_NEXT = "0x39BBF623FC803EAC";
|
||||||
|
const _SET_NOTIFICATION_BACKGROUND_COLOR = "0x92F0DA1E27DB96DC";
|
||||||
|
|
||||||
|
mp.events.add("BN_Show", (message, flashing = false, textColor = -1, bgColor = -1, flashColor = [77, 77, 77, 200]) => {
|
||||||
|
if (textColor > -1) mp.game.invoke(_SET_NOTIFICATION_COLOR_NEXT, textColor);
|
||||||
|
if (bgColor > -1) mp.game.invoke(_SET_NOTIFICATION_BACKGROUND_COLOR, bgColor);
|
||||||
|
if (flashing) mp.game.ui.setNotificationFlashColor(flashColor[0], flashColor[1], flashColor[2], flashColor[3]);
|
||||||
|
|
||||||
|
mp.game.gxt.set("BNOTIF_LONG_TEXT_ENTRY", `~a~${message}`);
|
||||||
|
mp.game.ui.setNotificationTextEntry("BNOTIF_LONG_TEXT_ENTRY");
|
||||||
|
mp.game.ui.addTextComponentSubstringPlayerName(""); // needed for text color to work
|
||||||
|
mp.game.ui.drawNotification(flashing, true);
|
||||||
|
});
|
||||||
|
|
||||||
|
mp.events.add("BN_ShowWithPicture", (title, sender, message, notifPic, icon = 0, flashing = false, textColor = -1, bgColor = -1, flashColor = [77, 77, 77, 200]) => {
|
||||||
|
if (textColor > -1) mp.game.invoke(_SET_NOTIFICATION_COLOR_NEXT, textColor);
|
||||||
|
if (bgColor > -1) mp.game.invoke(_SET_NOTIFICATION_BACKGROUND_COLOR, bgColor);
|
||||||
|
if (flashing) mp.game.ui.setNotificationFlashColor(flashColor[0], flashColor[1], flashColor[2], flashColor[3]);
|
||||||
|
mp.game.graphics.requestStreamedTextureDict(notifPic, true);
|
||||||
|
|
||||||
|
mp.game.gxt.set("BNOTIF_LONG_TEXT_ENTRY_IMG", `~a~${message}`);
|
||||||
|
mp.game.ui.setNotificationTextEntry("BNOTIF_LONG_TEXT_ENTRY_IMG");
|
||||||
|
mp.game.ui.addTextComponentSubstringPlayerName(""); // needed for text color to work
|
||||||
|
mp.game.ui.setNotificationMessage(notifPic, notifPic, flashing, icon, title, sender);
|
||||||
|
});
|
||||||
|
|
||||||
|
const notifications = {
|
||||||
|
show: (message, flashing = false, textColor = -1, bgColor = -1, flashColor = [77, 77, 77, 200]) => mp.events.call("BN_Show", message, flashing, textColor, bgColor, flashColor),
|
||||||
|
showWithPicture: (title, sender, message, notifPic, icon = 0, flashing = false, textColor = -1, bgColor = -1, flashColor = [77, 77, 77, 200]) => mp.events.call("BN_ShowWithPicture", title, sender, message, notifPic, icon, flashing, textColor, bgColor, flashColor)
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -5,30 +5,39 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
export default function playerList(globalData: IGlobalData): void {
|
export default function playerList(globalData: IGlobalData): void {
|
||||||
|
|
||||||
var playerlistBrowser: BrowserMp = null;
|
var playerlistBrowser: BrowserMp = null;
|
||||||
var pList;
|
var pList = [];
|
||||||
|
var loaded = false;
|
||||||
var factionPlayersMap: Map<number, number> = new Map<number, number>();
|
var factionPlayersMap: Map<number, number> = new Map<number, number>();
|
||||||
const factionIds = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
|
const factionIds = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
|
||||||
|
|
||||||
mp.events.add("showPlayerlist", (playersJson) => {
|
mp.events.add("loadPlayerListCEF", () => {
|
||||||
if (playerlistBrowser !== null) {
|
if (playerlistBrowser !== null) {
|
||||||
playerlistBrowser.destroy();
|
playerlistBrowser.destroy();
|
||||||
playerlistBrowser = null;
|
|
||||||
globalData.InMenu = false;
|
|
||||||
mp.gui.cursor.show(false, false);
|
|
||||||
mp.gui.chat.activate(true);
|
|
||||||
}
|
}
|
||||||
else if (!globalData.InMenu) {
|
|
||||||
globalData.InMenu = true;
|
|
||||||
playerlistBrowser = mp.browsers.new('package://assets/html/onlinelist/index.html');
|
playerlistBrowser = mp.browsers.new('package://assets/html/onlinelist/index.html');
|
||||||
|
});
|
||||||
|
|
||||||
|
mp.events.add("showPlayerlist", (playersJson) => {
|
||||||
|
if (!globalData.InMenu && !loaded) {
|
||||||
|
globalData.InMenu = true;
|
||||||
|
loaded = true;
|
||||||
mp.gui.chat.activate(false);
|
mp.gui.chat.activate(false);
|
||||||
mp.gui.cursor.show(true, true);
|
mp.gui.cursor.show(true, true);
|
||||||
pList = JSON.parse(playersJson);
|
pList = JSON.parse(playersJson);
|
||||||
|
playerlistBrowser.execute(`showPlayerList()`);
|
||||||
|
} else if (loaded) {
|
||||||
|
globalData.InMenu = false;
|
||||||
|
loaded = false;
|
||||||
|
mp.gui.cursor.show(false, false);
|
||||||
|
mp.gui.chat.activate(true);
|
||||||
|
playerlistBrowser.execute(`closePlayerList()`);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
mp.events.add("CEF:PlayerList_Loaded", () => {
|
mp.events.add("CEF:PlayerList_Loaded", () => {
|
||||||
|
playerlistBrowser.execute(`clear_row()`);
|
||||||
|
|
||||||
factionIds.forEach(f => {
|
factionIds.forEach(f => {
|
||||||
factionPlayersMap.set(f, 0);
|
factionPlayersMap.set(f, 0);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ export default function vehicleMenu(globalData: IGlobalData) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
mp.events.add('ToggleVehicleMenu', () => {
|
mp.events.add('ToggleVehicleMenu', () => {
|
||||||
if (menuBrowser !== null) {
|
if (globalData.InMenu && menuBrowser !== null) {
|
||||||
menuBrowser.destroy();
|
menuBrowser.destroy();
|
||||||
menuBrowser = null;
|
menuBrowser = null;
|
||||||
globalData.InMenu = false;
|
globalData.InMenu = false;
|
||||||
@@ -59,14 +59,14 @@ export default function vehicleMenu(globalData: IGlobalData) {
|
|||||||
mp.game.graphics.stopScreenEffect("FocusIn");
|
mp.game.graphics.stopScreenEffect("FocusIn");
|
||||||
mp.game.graphics.startScreenEffect("FocusOut", 0, false);
|
mp.game.graphics.startScreenEffect("FocusOut", 0, false);
|
||||||
return;
|
return;
|
||||||
}
|
} else {
|
||||||
|
|
||||||
mp.game.graphics.stopScreenEffect("FocusOut");
|
mp.game.graphics.stopScreenEffect("FocusOut");
|
||||||
mp.game.graphics.startScreenEffect("FocusIn", 0, false);
|
mp.game.graphics.startScreenEffect("FocusIn", 0, false);
|
||||||
menuBrowser = mp.browsers.new("package://assets/html/vehiclemenu/index.html");
|
menuBrowser = mp.browsers.new("package://assets/html/vehiclemenu/index.html");
|
||||||
mp.gui.chat.show(false);
|
mp.gui.chat.show(false);
|
||||||
globalData.InMenu = true;
|
globalData.InMenu = true;
|
||||||
mp.gui.cursor.show(true, true);
|
mp.gui.cursor.show(true, true);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
mp.events.add('doAction', (action) => {
|
mp.events.add('doAction', (action) => {
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
export default function antiAfk(globalData: IGlobalData) {
|
export let afkStatus: boolean = false;
|
||||||
|
|
||||||
|
export default function antiAfk(globalData: IGlobalData) {
|
||||||
let lastPosition: Vector3Mp = mp.players.local.position;
|
let lastPosition: Vector3Mp = mp.players.local.position;
|
||||||
let afkCounter: number = 0;
|
let afkCounter: number = 0;
|
||||||
|
|
||||||
let afkStatus: boolean = false;
|
|
||||||
|
|
||||||
setInterval(checkAfkPosition, 1000 * 10);
|
setInterval(checkAfkPosition, 1000 * 10);
|
||||||
|
|
||||||
function checkAfkPosition() {
|
function checkAfkPosition() {
|
||||||
|
|
||||||
if (!globalData.LoggedIn) {
|
if (!globalData.LoggedIn) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -122,10 +122,10 @@ export default function keys(globalData: IGlobalData) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
//X // Fahrzeug Verwaltung - Menü
|
//Z // Fahrzeug Verwaltung - Menü
|
||||||
mp.keys.bind(0x58, false, function () {
|
KeyBinder.bind("z", () => {
|
||||||
if (!globalData.InChat && !globalData.InMenu && !globalData.InTuning) {
|
if (!globalData.InChat && !globalData.InTuning) {
|
||||||
mp.events.callRemote("keyPress:X");
|
mp.events.callRemote("keyPress:Z");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,31 @@
|
|||||||
import polygons from "../polygons";
|
import polygons from "../polygons";
|
||||||
|
|
||||||
|
//Start: Eingang direkt rechts, rechts entlang
|
||||||
|
const prisonVector1 = new mp.Vector3(1809.99365234375, 2612.373291015625, 40.50623321533203);
|
||||||
|
const prisonVector2 = new mp.Vector3(1810.377197265625, 2620.338623046875, 40.51300048828125);
|
||||||
|
const prisonVector3 = new mp.Vector3(1835.8336181640625, 2688.819091796875, 40.4307975769043);
|
||||||
|
const prisonVector4 = new mp.Vector3(1830.5731201171875, 2703.89990234375, 40.42714309692383);
|
||||||
|
const prisonVector5 = new mp.Vector3(1776.7342529296875, 2747.79052734375, 40.42777633666992);
|
||||||
|
const prisonVector6 = new mp.Vector3(1762.360107421875, 2752.788818359375, 40.42710494995117);
|
||||||
|
const prisonVector7 = new mp.Vector3(1662.0726318359375, 2749.177001953125, 40.444488525390625);
|
||||||
|
const prisonVector8 = new mp.Vector3(1648.1600341796875, 2742.01611328125, 40.441619873046875);
|
||||||
|
const prisonVector9 = new mp.Vector3(1584.302978515625, 2679.99072265625, 40.47876739501953);
|
||||||
|
const prisonVector10 = new mp.Vector3(1575.2301025390625, 2667.2109375, 40.48185729980469);
|
||||||
|
const prisonVector11 = new mp.Vector3(1547.1693115234375, 2591.489990234375, 40.388912200927734);
|
||||||
|
const prisonVector12 = new mp.Vector3(1546.39892578125, 2576.266845703125, 40.38877868652344);
|
||||||
|
const prisonVector13 = new mp.Vector3(1550.493896484375, 2482.98388671875, 40.38750076293945);
|
||||||
|
const prisonVector14 = new mp.Vector3(1557.9322509765625, 2468.98681640625, 40.387237548828125);
|
||||||
|
const prisonVector15 = new mp.Vector3(1652.527099609375, 2409.1259765625, 40.40341567993164);
|
||||||
|
const prisonVector16 = new mp.Vector3(1667.7176513671875, 2407.0595703125, 40.401432037353516);
|
||||||
|
const prisonVector17 = new mp.Vector3(1749.3123779296875, 2419.23779296875, 40.42228698730469);
|
||||||
|
const prisonVector18 = new mp.Vector3(1762.95849609375, 2426.209228515625, 40.42059326171875);
|
||||||
|
const prisonVector19 = new mp.Vector3(1809.08837890625, 2473.969970703125, 40.445960998535156);
|
||||||
|
const prisonVector20 = new mp.Vector3(1814.2039794921875, 2489.00830078125, 40.44499588012695);
|
||||||
|
const prisonVector21 = new mp.Vector3(1807.0340576171875, 2535.93212890625, 38.4123420715332);
|
||||||
|
const prisonVector22 = new mp.Vector3(1809.77587890625, 2590.69775390625, 38.41337966918945);
|
||||||
|
const prisonVector23 = new mp.Vector3(1819.170654296875, 2597.941650390625, 40.525978088378906);
|
||||||
|
const prisonVector24 = new mp.Vector3(1819.3084716796875, 2612.3154296875, 40.52067947387695);
|
||||||
|
|
||||||
const busbaseVector1 = new mp.Vector3(-522.4485, -2138.7021, 7.7564063);
|
const busbaseVector1 = new mp.Vector3(-522.4485, -2138.7021, 7.7564063);
|
||||||
const busbaseVector2 = new mp.Vector3(-584.9822, -2072.467, 5.9921026);
|
const busbaseVector2 = new mp.Vector3(-584.9822, -2072.467, 5.9921026);
|
||||||
const busbaseVector3 = new mp.Vector3(-669.1689, -2172.7917, 6.009973);
|
const busbaseVector3 = new mp.Vector3(-669.1689, -2172.7917, 6.009973);
|
||||||
@@ -37,10 +63,14 @@ const polygon_pilotAnfaenger = polygons.add([pilotAnfaengerVector1, pilotAnfaeng
|
|||||||
const polygon_pilotProfi = polygons.add([pilotProfiVector1, pilotProfiVector2, pilotProfiVector3, pilotProfiVector4], 15, false, [255, 155, 0, 255], 0);
|
const polygon_pilotProfi = polygons.add([pilotProfiVector1, pilotProfiVector2, pilotProfiVector3, pilotProfiVector4], 15, false, [255, 155, 0, 255], 0);
|
||||||
const polygon_muellbase = polygons.add([muellbaseVector1, muellbaseVector2, muellbaseVector3], 15, false, [255, 155, 0, 255], 0);
|
const polygon_muellbase = polygons.add([muellbaseVector1, muellbaseVector2, muellbaseVector3], 15, false, [255, 155, 0, 255], 0);
|
||||||
|
|
||||||
|
const polygon_prison = polygons.add([prisonVector1, prisonVector2, prisonVector3, prisonVector4, prisonVector5, prisonVector6, prisonVector7, prisonVector8,
|
||||||
|
prisonVector9, prisonVector10, prisonVector11, prisonVector12, prisonVector13, prisonVector14, prisonVector15, prisonVector16,
|
||||||
|
prisonVector17, prisonVector18, prisonVector19, prisonVector20, prisonVector21, prisonVector22, prisonVector23, prisonVector24], 40, false, [255, 155, 0, 255], 0);
|
||||||
|
|
||||||
export let listNoDMZones = [polygon_busbase, polygon_stadthalle, polygon_fahrschule, polygon_pilotAnfaenger, polygon_pilotProfi, polygon_muellbase];
|
export let listNoDMZones = [polygon_busbase, polygon_stadthalle, polygon_fahrschule, polygon_pilotAnfaenger, polygon_pilotProfi, polygon_muellbase];
|
||||||
export let isInAnyNoDMPolygon;
|
export let isInAnyNoDMPolygon;
|
||||||
|
|
||||||
export default function nodmHandler() {
|
export default function polygonHandler() {
|
||||||
|
|
||||||
mp.events.add('playerEnterPolygon', (polygon) => {
|
mp.events.add('playerEnterPolygon', (polygon) => {
|
||||||
|
|
||||||
@@ -56,5 +86,9 @@ export default function nodmHandler() {
|
|||||||
mp.events.call('toggleNoDmZone', false);
|
mp.events.call('toggleNoDmZone', false);
|
||||||
isInAnyNoDMPolygon = false;
|
isInAnyNoDMPolygon = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (polygon == polygon_prison) {
|
||||||
|
mp.events.callRemote("SERVER:BreakOutIfInPrison");
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
import * as NativeUI from '../libs/NativeUI';
|
import * as NativeUI from '../libs/NativeUI';
|
||||||
import jailList from './criminalrelease';
|
|
||||||
import InputHelper from '../inputhelper';
|
import InputHelper from '../inputhelper';
|
||||||
|
|
||||||
const Menu = NativeUI.Menu;
|
const Menu = NativeUI.Menu;
|
||||||
@@ -30,16 +29,11 @@ cancelItem.HighlightedBackColor = new Color(229, 57, 53);
|
|||||||
export default function reportList(globalData: IGlobalData) {
|
export default function reportList(globalData: IGlobalData) {
|
||||||
|
|
||||||
var reportMenu: NativeUI.Menu;
|
var reportMenu: NativeUI.Menu;
|
||||||
|
|
||||||
var users;
|
var users;
|
||||||
var reportTexts;
|
var reportTexts;
|
||||||
|
|
||||||
var user = "";
|
var user = "";
|
||||||
var reportText = "";
|
var reportText = "";
|
||||||
|
|
||||||
|
|
||||||
//Weapon Menu
|
|
||||||
|
|
||||||
mp.events.add('showReportMenu', (userTickets, TicketsArr) => {
|
mp.events.add('showReportMenu', (userTickets, TicketsArr) => {
|
||||||
if (!globalData.InMenu) {
|
if (!globalData.InMenu) {
|
||||||
|
|
||||||
@@ -95,9 +89,9 @@ export default function reportList(globalData: IGlobalData) {
|
|||||||
|
|
||||||
globalData.InMenu = true;
|
globalData.InMenu = true;
|
||||||
|
|
||||||
var types = ["Quick Report", "Ticket Report"];
|
var types = ["Ticket", "Quick-Report"];
|
||||||
|
|
||||||
reportMenu = new Menu("QuickReport/Ticket", "", new Point(0, screenRes.y / 3), null, null);
|
reportMenu = new Menu("Report", "", new Point(0, screenRes.y / 3), null, null);
|
||||||
var typesItem = new UIMenuListItem("Typ", "", new ItemsCollection(types));
|
var typesItem = new UIMenuListItem("Typ", "", new ItemsCollection(types));
|
||||||
reportMenu.AddItem(typesItem);
|
reportMenu.AddItem(typesItem);
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ export default function spawnschutz() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
mp.events.add("triggerSpawnschutzTimer", () => {
|
mp.events.add("triggerSpawnschutzTimer", () => {
|
||||||
|
clearInterval(spawnschutzTimer);
|
||||||
spawnschutzTimer = setTimeout(() => {
|
spawnschutzTimer = setTimeout(() => {
|
||||||
mp.events.call("toggleSpawnschutz", false);
|
mp.events.call("toggleSpawnschutz", false);
|
||||||
spawnschutzEnabled = false;
|
spawnschutzEnabled = false;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import * as NativeUI from '../libs/NativeUI';
|
import * as NativeUI from '../libs/NativeUI';
|
||||||
|
|
||||||
const Menu = NativeUI.Menu;
|
const Menu = NativeUI.Menu;
|
||||||
const UIMenuItem = NativeUI.UIMenuItem;
|
const UIMenuItem = NativeUI.UIMenuItem;
|
||||||
@@ -10,7 +10,7 @@ const ItemsCollection = NativeUI.ItemsCollection;
|
|||||||
const Color = NativeUI.Color;
|
const Color = NativeUI.Color;
|
||||||
|
|
||||||
let screenRes = mp.game.graphics.getScreenResolution(0, 0);
|
let screenRes = mp.game.graphics.getScreenResolution(0, 0);
|
||||||
let saveItem = new UIMenuItem("Waffen Nehmen", "");
|
let saveItem = new UIMenuItem("Waffen nehmen", "");
|
||||||
saveItem.BackColor = new Color(13, 71, 161);
|
saveItem.BackColor = new Color(13, 71, 161);
|
||||||
saveItem.HighlightedBackColor = new Color(25, 118, 210);
|
saveItem.HighlightedBackColor = new Color(25, 118, 210);
|
||||||
|
|
||||||
@@ -131,7 +131,7 @@ export default function weaponList(globalData: IGlobalData) {
|
|||||||
|
|
||||||
|
|
||||||
weaponMenu.ItemSelect.on((item) => {
|
weaponMenu.ItemSelect.on((item) => {
|
||||||
if (item.Text === "Waffen Nehmen") {
|
if (item.Text === "Waffen nehmen") {
|
||||||
mp.events.callRemote("saveWeaponSelection", primary, secondary, melee, specialWep, armor);
|
mp.events.callRemote("saveWeaponSelection", primary, secondary, melee, specialWep, armor);
|
||||||
weaponMenu.Close();
|
weaponMenu.Close();
|
||||||
globalData.InMenu = false;
|
globalData.InMenu = false;
|
||||||
|
|||||||
@@ -36,12 +36,12 @@ export default function tuning(globalData: IGlobalData) {
|
|||||||
{ Slot: 8, Name: "Extra 1", Price: 2000 },
|
{ Slot: 8, Name: "Extra 1", Price: 2000 },
|
||||||
{ Slot: 9, Name: "Extra 2", Price: 2000 },
|
{ Slot: 9, Name: "Extra 2", Price: 2000 },
|
||||||
{ Slot: 10, Name: "Dach", Price: 1500 },
|
{ Slot: 10, Name: "Dach", Price: 1500 },
|
||||||
{ Slot: 11, Name: "Motor", Price: 50000 },
|
{ Slot: 11, Name: "Motor", BasePercentage: 20, PriceIncreasePerLevel: 7.5 },
|
||||||
{ Slot: 12, Name: "Bremsen", Price: 30000 },
|
{ Slot: 12, Name: "Bremsen", BasePercentage: 5, PriceIncreasePerLevel: 2.5 },
|
||||||
{ Slot: 13, Name: "Getriebe", Price: 15000 },
|
{ Slot: 13, Name: "Getriebe", BasePercentage: 10, PriceIncreasePerLevel: 2.5 },
|
||||||
{ Slot: 14, Name: "Hupe", Price: 500 },
|
{ Slot: 14, Name: "Hupe", Price: 500 },
|
||||||
{ Slot: 15, Name: "Federung", Price: 2000 },
|
{ Slot: 15, Name: "Federung", Price: 2000 },
|
||||||
{ Slot: 18, Name: "Turbo", Price: 40000 },
|
{ Slot: 18, Name: "Turbo", BasePercentage: 45, PriceIncreasePerLevel: 0 },
|
||||||
{ Slot: 22, Name: "Licht", Price: 500 },
|
{ Slot: 22, Name: "Licht", Price: 500 },
|
||||||
{ Slot: 23, Name: "Reifen", Price: 1000 },
|
{ Slot: 23, Name: "Reifen", Price: 1000 },
|
||||||
{ Slot: -1, Name: "Lackierung", Price: 1000 },
|
{ Slot: -1, Name: "Lackierung", Price: 1000 },
|
||||||
@@ -165,7 +165,7 @@ export default function tuning(globalData: IGlobalData) {
|
|||||||
var currentActiveModItem = new Array<NativeUI.UIMenuItem>();
|
var currentActiveModItem = new Array<NativeUI.UIMenuItem>();
|
||||||
var currentSelectedItem: VehicleModMenuItem = null;
|
var currentSelectedItem: VehicleModMenuItem = null;
|
||||||
|
|
||||||
mp.events.add("showTuningMenu", (noMoney) => {
|
mp.events.add("showTuningMenu", (noMoney, basePrice) => {
|
||||||
mp.events.call("hideTuningInfo", false);
|
mp.events.call("hideTuningInfo", false);
|
||||||
mp.gui.chat.show(false);
|
mp.gui.chat.show(false);
|
||||||
|
|
||||||
@@ -226,9 +226,6 @@ export default function tuning(globalData: IGlobalData) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var price = noMoney? 0 : getModSlotPrice(modType);
|
|
||||||
|
|
||||||
|
|
||||||
if (mod === null) {
|
if (mod === null) {
|
||||||
mod = localVehicle.getMod(modType);
|
mod = localVehicle.getMod(modType);
|
||||||
}
|
}
|
||||||
@@ -248,6 +245,7 @@ export default function tuning(globalData: IGlobalData) {
|
|||||||
currentMod[modType] = mod;
|
currentMod[modType] = mod;
|
||||||
|
|
||||||
for (var x = -1; x < modNum; x++) {
|
for (var x = -1; x < modNum; x++) {
|
||||||
|
var price = noMoney ? 0 : getModSlotPrice(modType, basePrice, x);
|
||||||
var modText = "";
|
var modText = "";
|
||||||
if (x === -1) {
|
if (x === -1) {
|
||||||
modText = "Serie";
|
modText = "Serie";
|
||||||
@@ -315,7 +313,9 @@ export default function tuning(globalData: IGlobalData) {
|
|||||||
mainMenu.Visible = true;
|
mainMenu.Visible = true;
|
||||||
|
|
||||||
mainMenu.MenuClose.on(() => {
|
mainMenu.MenuClose.on(() => {
|
||||||
|
if (localVehicle && mp.vehicles.exists(localVehicle)) {
|
||||||
localVehicle.setLights(0);
|
localVehicle.setLights(0);
|
||||||
|
}
|
||||||
globalData.InTuning = false;
|
globalData.InTuning = false;
|
||||||
globalData.InMenu = false;
|
globalData.InMenu = false;
|
||||||
mp.events.call("hideTuningInfo", false);
|
mp.events.call("hideTuningInfo", false);
|
||||||
@@ -456,8 +456,21 @@ export default function tuning(globalData: IGlobalData) {
|
|||||||
return realModName;
|
return realModName;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getModSlotPrice(modType: number): number {
|
function getModSlotPrice(modType: number, basePrice: number, modIndex?: number): number {
|
||||||
return carModSlotName.filter(x => x.Slot == modType)[0].Price;
|
if (modIndex === -1) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
let price = 0;
|
||||||
|
let priceInfo = carModSlotName.filter(x => x.Slot == modType)[0];
|
||||||
|
|
||||||
|
if (priceInfo.BasePercentage) {
|
||||||
|
price = ((priceInfo.BasePercentage + priceInfo.PriceIncreasePerLevel * modIndex) / 100) * basePrice;
|
||||||
|
} else {
|
||||||
|
price = priceInfo.Price;
|
||||||
|
}
|
||||||
|
|
||||||
|
return price;
|
||||||
}
|
}
|
||||||
|
|
||||||
function setHeadlightsColor(vehicle, index) {
|
function setHeadlightsColor(vehicle, index) {
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ html {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#chat, a, body, html {
|
#chat, a, body, html {
|
||||||
color: #fff;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
body, html {
|
body, html {
|
||||||
@@ -59,12 +59,12 @@ a {
|
|||||||
#chat ul#chat_messages {
|
#chat ul#chat_messages {
|
||||||
height: 16.45em;
|
height: 16.45em;
|
||||||
min-width: 50ch;
|
min-width: 50ch;
|
||||||
max-width: calc(60vw + 10px);
|
max-width: calc(45vw + 10px);
|
||||||
-webkit-transform: rotate(0deg);
|
-webkit-transform: rotate(0deg);
|
||||||
transform: rotate(0deg);
|
transform: rotate(0deg);
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
word-break: break-all;
|
word-break: break-word;
|
||||||
list-style-type: none;
|
list-style-type: none;
|
||||||
margin-bottom: .25em;
|
margin-bottom: .25em;
|
||||||
}
|
}
|
||||||
@@ -80,16 +80,17 @@ a {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#chat input#chat_msg {
|
#chat input#chat_msg {
|
||||||
width: 60vw;
|
width: 45vw;
|
||||||
outline: 0;
|
outline: 0;
|
||||||
border: none;
|
border: none;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
|
font-family: inherit;
|
||||||
font-size: inherit;
|
font-size: inherit;
|
||||||
font-weight: inherit;
|
font-weight: inherit;
|
||||||
line-height: inherit;
|
line-height: 1;
|
||||||
color: white;
|
color: white;
|
||||||
background: rgba(0, 0, 0, 0.5);
|
background: rgba(0, 0, 0, 0.5);
|
||||||
padding: .5em;
|
padding: .5em .75em .75em;
|
||||||
}
|
}
|
||||||
|
|
||||||
::-webkit-scrollbar {
|
::-webkit-scrollbar {
|
||||||
@@ -104,4 +105,9 @@ a {
|
|||||||
::-webkit-scrollbar-thumb:hover {
|
::-webkit-scrollbar-thumb:hover {
|
||||||
background: rgba(255, 17, 0, 0);
|
background: rgba(255, 17, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.timestamp {
|
||||||
|
display: inline-block;
|
||||||
|
width: 5.25em;
|
||||||
|
}
|
||||||
/*# sourceMappingURL=main.css.map */
|
/*# sourceMappingURL=main.css.map */
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"version": 3,
|
"version": 3,
|
||||||
"mappings": "AAAA,AAAA,IAAI,CAAC;EAAE,UAAU,EAAE,UAAU;CAAI;;AACjC,AAAA,CAAC,EAAE,CAAC,AAAA,OAAO,EAAE,CAAC,AAAA,MAAM,CAAC;EAAE,UAAU,EAAE,OAAO;CAAI;;AAG9C,AAAA,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC;EACZ,OAAO,EAAE,CAAC;EACV,MAAM,EAAE,CACV;CAAC;;AAED,AAAA,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC;EACnB,KAAK,EAAE,IACT;CAAC;;AAED,AAAA,IAAI,EAAE,IAAI,CAAC;EACT,sBAAsB,EAAE,WAAW;EACnC,QAAQ,EAAE,MAAM;EAChB,SAAS,EAAE,IAAI;EACf,WAAW,EAAE,IAAI;CAClB;;AAED,AAAA,IAAI,CAAC;EACH,WAAW,EAAE,oIAAoI;EACjJ,SAAS,EAAE,kBAAkB;EAC7B,WAAW,EAAE,GAAG;EAChB,SAAS,EAAE,GAAG;CACf;;AAED,AAAA,CAAC,CAAC;EAAE,eAAe,EAAE,IAAI;CAAI;;AAE7B,AAAA,WAAW,CAAC;EACV,OAAO,EAAE,IAAI;EACb,QAAQ,EAAE,QAAQ;EAClB,KAAK,EAAE,KAAK;EACZ,MAAM,EAAE,KAAK;EACb,OAAO,EAAE,CACX;CAAC;;AAED,AAAA,KAAK,CAAC;EACJ,OAAO,EAAE,KAAK;EACd,OAAO,EAAE,CAAC;EAEV,WAAW,EAAE,IAAI;EACjB,WAAW,EAAE,8EAA8E;EAC3F,cAAc,EAAE,IAAI;EAEpB,UAAU,EAAE,GAAG;EACf,WAAW,EAAE,GAAG;CAsCjB;;AA/CD,AAWE,KAXG,CAWH,EAAE,AAAA,cAAc,CAAC;EACf,MAAM,EAAE,OAAO;EACf,SAAS,EAAE,IAAI;EACf,SAAS,EAAE,iBAAiB;EAC5B,SAAS,EAAE,YAAY;EAEvB,UAAU,EAAE,IAAI;EAChB,UAAU,EAAE,MAAM;EAClB,UAAU,EAAE,SAAS;EAErB,eAAe,EAAE,IAAI;EACrB,aAAa,EAAE,KAAK;CAQrB;;AA9BH,AAwBI,KAxBC,CAWH,EAAE,AAAA,cAAc,GAaX,EAAE,CAAC;EACJ,SAAS,EAAE,YAAY;EACvB,aAAa,EAAE,MAAM;CAGtB;;AA7BL,AA4BM,KA5BD,CAWH,EAAE,AAAA,cAAc,GAaX,EAAE,AAIF,WAAW,CAAC;EAAE,aAAa,EAAE,KAAK;CAAI;;AA5B7C,AAgCE,KAhCG,CAgCH,KAAK,AAAA,SAAS,CAAC;EACb,KAAK,EAAE,IAAI;EACX,OAAO,EAAE,CAAC;EACV,MAAM,EAAE,IAAI;EACZ,aAAa,EAAE,GAAG;EAElB,SAAS,EAAE,OAAO;EAClB,WAAW,EAAE,OAAO;EACpB,WAAW,EAAE,OAAO;EAEpB,KAAK,EAAE,KAAK;EACZ,UAAU,EAAE,kBAAiB;EAE7B,OAAO,EAAE,IAAI;CACd;;AAGH,AAAA,mBAAmB,CAAC;EAClB,KAAK,EAAE,IAAI;CAQZ;;AATD,AAGE,mBAHiB,AAGhB,MAAM,CAAC;EACN,UAAU,EAAE,mBAAmB;EAC/B,aAAa,EAAE,GAAG;CAGnB;;AARH,AAOI,mBAPe,AAGhB,MAAM,AAIJ,MAAM,CAAC;EAAE,UAAU,EAAE,mBAAmB;CAAI",
|
"mappings": "AAAA,AAAA,IAAI,CAAC;EAAE,UAAU,EAAE,UAAU;CAAI;;AACjC,AAAA,CAAC,EAAE,CAAC,AAAA,OAAO,EAAE,CAAC,AAAA,MAAM,CAAC;EAAE,UAAU,EAAE,OAAO;CAAI;;AAG9C,AAAA,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC;EACZ,OAAO,EAAE,CAAC;EACV,MAAM,EAAE,CACV;CAAC;;AAED,AAAA,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC;EAAE,KAAK,EAAE,KAAK;CAAI;;AAEvC,AAAA,IAAI,EAAE,IAAI,CAAC;EACT,sBAAsB,EAAE,WAAW;EACnC,QAAQ,EAAE,MAAM;EAChB,SAAS,EAAE,IAAI;EACf,WAAW,EAAE,IAAI;CAClB;;AAED,AAAA,IAAI,CAAC;EACH,WAAW,EAAE,oIAAoI;EACjJ,SAAS,EAAE,kBAAkB;EAC7B,WAAW,EAAE,GAAG;EAChB,SAAS,EAAE,GAAG;CACf;;AAED,AAAA,CAAC,CAAC;EAAE,eAAe,EAAE,IAAI;CAAI;;AAE7B,AAAA,WAAW,CAAC;EACV,OAAO,EAAE,IAAI;EACb,QAAQ,EAAE,QAAQ;EAClB,KAAK,EAAE,KAAK;EACZ,MAAM,EAAE,KAAK;EACb,OAAO,EAAE,CACX;CAAC;;AAED,AAAA,KAAK,CAAC;EACJ,OAAO,EAAE,KAAK;EACd,OAAO,EAAE,CAAC;EAEV,WAAW,EAAE,IAAI;EACjB,WAAW,EAAE,8EAA8E;EAC3F,cAAc,EAAE,IAAI;EAEpB,UAAU,EAAE,GAAG;EACf,WAAW,EAAE,GAAG;CAuCjB;;AAhDD,AAWE,KAXG,CAWH,EAAE,AAAA,cAAc,CAAC;EACf,MAAM,EAAE,OAAO;EACf,SAAS,EAAE,IAAI;EACf,SAAS,EAAE,iBAAiB;EAC5B,SAAS,EAAE,YAAY;EAEvB,UAAU,EAAE,IAAI;EAChB,UAAU,EAAE,MAAM;EAClB,UAAU,EAAE,UAAU;EAEtB,eAAe,EAAE,IAAI;EACrB,aAAa,EAAE,KAAK;CAQrB;;AA9BH,AAwBI,KAxBC,CAWH,EAAE,AAAA,cAAc,GAaX,EAAE,CAAC;EACJ,SAAS,EAAE,YAAY;EACvB,aAAa,EAAE,MAAM;CAGtB;;AA7BL,AA4BM,KA5BD,CAWH,EAAE,AAAA,cAAc,GAaX,EAAE,AAIF,WAAW,CAAC;EAAE,aAAa,EAAE,KAAK;CAAI;;AA5B7C,AAgCE,KAhCG,CAgCH,KAAK,AAAA,SAAS,CAAC;EACb,KAAK,EAAE,IAAI;EACX,OAAO,EAAE,CAAC;EACV,MAAM,EAAE,IAAI;EACZ,aAAa,EAAE,GAAG;EAElB,WAAW,EAAE,OAAO;EACpB,SAAS,EAAE,OAAO;EAClB,WAAW,EAAE,OAAO;EACpB,WAAW,EAAE,CAAC;EAEd,KAAK,EAAE,KAAK;EACZ,UAAU,EAAE,kBAAiB;EAE7B,OAAO,EAAE,gBAAgB;CAC1B;;AAGH,AAAA,mBAAmB,CAAC;EAClB,KAAK,EAAE,IAAI;CAQZ;;AATD,AAGE,mBAHiB,AAGhB,MAAM,CAAC;EACN,UAAU,EAAE,mBAAmB;EAC/B,aAAa,EAAE,GAAG;CAGnB;;AARH,AAOI,mBAPe,AAGhB,MAAM,AAIJ,MAAM,CAAC;EAAE,UAAU,EAAE,mBAAmB;CAAI;;AAIjD,AAAA,UAAU,CAAC;EACT,OAAO,EAAE,YAAY;EACrB,KAAK,EAAE,MAAM;CACd",
|
||||||
"sources": [
|
"sources": [
|
||||||
"main.scss"
|
"main.scss"
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -7,9 +7,7 @@ html { box-sizing: border-box; }
|
|||||||
margin: 0
|
margin: 0
|
||||||
}
|
}
|
||||||
|
|
||||||
#chat, a, body, html {
|
#chat, a, body, html { color: white; }
|
||||||
color: #fff
|
|
||||||
}
|
|
||||||
|
|
||||||
body, html {
|
body, html {
|
||||||
-webkit-font-smoothing: antialiased;
|
-webkit-font-smoothing: antialiased;
|
||||||
@@ -49,12 +47,12 @@ a { text-decoration: none; }
|
|||||||
ul#chat_messages {
|
ul#chat_messages {
|
||||||
height: 16.45em;
|
height: 16.45em;
|
||||||
min-width: 50ch;
|
min-width: 50ch;
|
||||||
max-width: calc(60vw + 10px);
|
max-width: calc(45vw + 10px);
|
||||||
transform: rotate(0deg);
|
transform: rotate(0deg);
|
||||||
|
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
word-break: break-all;
|
word-break: break-word;
|
||||||
|
|
||||||
list-style-type: none;
|
list-style-type: none;
|
||||||
margin-bottom: .25em;
|
margin-bottom: .25em;
|
||||||
@@ -68,19 +66,20 @@ a { text-decoration: none; }
|
|||||||
}
|
}
|
||||||
|
|
||||||
input#chat_msg {
|
input#chat_msg {
|
||||||
width: 60vw;
|
width: 45vw;
|
||||||
outline: 0;
|
outline: 0;
|
||||||
border: none;
|
border: none;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
|
|
||||||
|
font-family: inherit;
|
||||||
font-size: inherit;
|
font-size: inherit;
|
||||||
font-weight: inherit;
|
font-weight: inherit;
|
||||||
line-height: inherit;
|
line-height: 1;
|
||||||
|
|
||||||
color: white;
|
color: white;
|
||||||
background: rgba(0, 0, 0, .5);
|
background: rgba(0, 0, 0, .5);
|
||||||
|
|
||||||
padding: .5em;
|
padding: .5em .75em .75em;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -94,3 +93,8 @@ a { text-decoration: none; }
|
|||||||
&:hover { background: rgba(255, 17, 0, 0); }
|
&:hover { background: rgba(255, 17, 0, 0); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.timestamp {
|
||||||
|
display: inline-block;
|
||||||
|
width: 5.25em;
|
||||||
|
}
|
||||||
|
|||||||
@@ -8,7 +8,13 @@ html {
|
|||||||
-ms-user-select: none;
|
-ms-user-select: none;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
}
|
}
|
||||||
|
.show {
|
||||||
|
display: show !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hidden {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
html, body {
|
html, body {
|
||||||
margin: unset;
|
margin: unset;
|
||||||
}
|
}
|
||||||
@@ -59,7 +65,7 @@ h2 {
|
|||||||
top: 0;
|
top: 0;
|
||||||
z-index: 3;
|
z-index: 3;
|
||||||
font-size: .9em;
|
font-size: .9em;
|
||||||
background-color: black;
|
background-color: #0C0C0C;
|
||||||
padding: 1em 0;
|
padding: 1em 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -87,15 +93,8 @@ table th {
|
|||||||
top: 3em;
|
top: 3em;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
background-color: black;
|
background-color: #0C0C0C;
|
||||||
}
|
border-top: 1px solid #0f0f0f;
|
||||||
|
|
||||||
table th:first-child {
|
|
||||||
border-top-left-radius: .25em;
|
|
||||||
}
|
|
||||||
|
|
||||||
table th:last-child {
|
|
||||||
border-top-right-radius: .25em;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
table th, table td {
|
table th, table td {
|
||||||
@@ -216,4 +215,6 @@ ol.inline.stats {
|
|||||||
ol.inline.stats abbr {
|
ol.inline.stats abbr {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*# sourceMappingURL=style.css.map */
|
/*# sourceMappingURL=style.css.map */
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"version": 3,
|
"version": 3,
|
||||||
"mappings": "AAAA,AAAA,IAAI,CAAC;EACH,UAAU,EAAE,UAAU;EACtB,MAAM,EAAE,KAAK;EACb,UAAU,EAAE,WAAW;EACvB,WAAW,EAAE,IAAI;CAClB;;AAED,AAAA,IAAI,EAAE,IAAI,CAAC;EAAE,MAAM,EAAE,KAAK;CAAI;;AAC9B,AAAA,CAAC,EAAE,CAAC,AAAA,OAAO,EAAE,CAAC,AAAA,MAAM,CAAC;EAAE,UAAU,EAAE,OAAO;CAAI;;AAE9C,AAAA,IAAI,CAAC;EACH,MAAM,EAAE,WAAW;EAEnB,KAAK,EAAE,IAAI;EACX,KAAK,EAAE,KAAK;EAEZ,WAAW,EAAE,oIAAoI;EACjJ,SAAS,EAAE,GAAG;CACf;;AAED,AAAA,EAAE,EAAE,EAAE,CAAC;EACL,MAAM,EAAE,KAAK;EACb,WAAW,EAAE,CAAC;CACf;;AAED,AAAA,EAAE,CAAC;EAAE,SAAS,EAAE,MAAM;CAAI;;AAC1B,AAAA,EAAE,CAAC;EAAE,SAAS,EAAE,OAAO;CAAI;;AAE3B,AAAA,QAAQ,CAAC;EACP,OAAO,EAAE,IAAI;EACb,eAAe,EAAE,aAAa;EAC9B,WAAW,EAAE,UAAU;EACvB,aAAa,EAAE,GAAG;EAClB,OAAO,EAAE,SAAS;CACnB;;AAED,AAAA,SAAS,CAAC;EACR,QAAQ,EAAE,MAAM;EAChB,GAAG,EAAE,CAAC;EACN,OAAO,EAAE,CAAC;EAEV,SAAS,EAAE,IAAI;EACf,gBAAgB,EAAE,KAAK;EAEvB,OAAO,EAAE,KAAK;CACf;;AAED,AAAA,QAAQ,CAAC;EACP,UAAU,EAAE,IAAI;EAChB,UAAU,EAAE,IAAI;EAChB,UAAU,EAAE,MAAM;EAElB,aAAa,EAAE,KAAK;EACpB,gBAAgB,EAAO,mBAAK;CAG7B;;AATD,AAQE,QARM,AAQL,mBAAmB,CAAC;EAAE,OAAO,EAAE,IAAI;CAAI;;AAG1C,AAAA,KAAK,CAAC;EACJ,eAAe,EAAE,QAAQ;EACzB,KAAK,EAAE,IAAI;EACX,aAAa,EAAE,OAAO;CAwCvB;;AA3CD,AAKE,KALG,CAKH,EAAE,CAAC;EACD,QAAQ,EAAE,MAAM;EAChB,GAAG,EAAE,GAAG;EACR,UAAU,EAAE,IAAI;EAChB,OAAO,EAAE,CAAC;EAEV,gBAAgB,EAAE,KAAK;CAIxB;;AAfH,AAaI,KAbC,CAKH,EAAE,AAQC,YAAY,CAAC;EAAE,sBAAsB,EAAE,KAAK;CAAI;;AAbrD,AAcI,KAdC,CAKH,EAAE,AASC,WAAW,CAAC;EAAE,uBAAuB,EAAE,KAAK;CAAI;;AAdrD,AAiBE,KAjBG,CAiBH,EAAE,EAjBJ,KAAK,CAiBC,EAAE,CAAC;EACL,OAAO,EAAE,SAAS;CAInB;;AAtBH,AAoBI,KApBC,CAiBH,EAAE,AAGC,YAAY,EApBjB,KAAK,CAiBC,EAAE,AAGH,YAAY,CAAC;EAAE,YAAY,EAAE,GAAG;CAAI;;AApBzC,AAqBI,KArBC,CAiBH,EAAE,AAIC,WAAW,EArBhB,KAAK,CAiBC,EAAE,AAIH,WAAW,CAAC;EAAE,aAAa,EAAE,GAAG;CAAI;;AArBzC,AAyBI,KAzBC,CAwBH,EAAE,CACA,EAAE,CAAC;EACD,QAAQ,EAAE,MAAM;CAajB;;AAvCL,AA4BM,KA5BD,CAwBH,EAAE,CACA,EAAE,AAGC,UAAW,CAAA,CAAC,EAAE;EAAE,KAAK,EAAE,cAAc;CAAI;;AA5BhD,AA6BM,KA7BD,CAwBH,EAAE,CACA,EAAE,AAIC,UAAW,CAAA,CAAC,EAAE;EACb,SAAS,EAAE,IAAI;EACf,WAAW,EAAE,IAAI;EACjB,UAAU,EAAE,IAAI;EAChB,WAAW,EAAE,MAAM;CAGpB;;AApCP,AAmCQ,KAnCH,CAwBH,EAAE,CACA,EAAE,AAIC,UAAW,CAAA,CAAC,CAMV,mBAAmB,CAAC;EAAE,OAAO,EAAE,IAAI;CAAI;;AAnChD,AAqCM,KArCD,CAwBH,EAAE,CACA,EAAE,AAYC,UAAW,CAAA,CAAC,EAAE;EAAE,KAAK,EAAE,eAAe;CAAI;;AArCjD,AAsCM,KAtCD,CAwBH,EAAE,CACA,EAAE,AAaC,UAAW,CAAA,CAAC,EAAE;EAAE,KAAK,EAAE,eAAe;CAAI;;AAtCjD,AAyCI,KAzCC,CAwBH,EAAE,AAiBC,UAAW,CAAA,IAAI,EAAE;EAAE,gBAAgB,EAAE,mBAAkB;CAAI;;AAIhE,AACE,MADI,AACH,QAAQ,CAAC;EACR,OAAO,EAAE,EAAE;EACX,MAAM,EAAE,KAAK;EACb,KAAK,EAAE,KAAK;EACZ,aAAa,EAAE,GAAG;EAClB,OAAO,EAAE,YAAY;EACrB,KAAK,EAAE,OAAO;EACd,MAAM,EAAE,GAAG,CAAC,KAAK,CAAC,0BAA0B;EAE5C,YAAY,EAAE,IAAI;EAClB,aAAa,EAAE,GAAG;CACnB;;AAEA,AAAD,SAAI,AAAA,QAAQ,CAAC;EAAE,gBAAgB,EAAE,KAAkB;CAAI;;AACtD,AAAD,SAAI,AAAA,QAAQ,CAAC;EAAE,gBAAgB,EAAE,OAAe;CAAI;;AACnD,AAAD,SAAI,AAAA,QAAQ,CAAC;EAAE,gBAAgB,EAAE,OAAc;CAAI;;AAClD,AAAD,SAAI,AAAA,QAAQ,CAAC;EAAE,gBAAgB,EAAE,OAAc;CAAI;;AAClD,AAAD,SAAI,AAAA,QAAQ,CAAC;EAAE,gBAAgB,EAAE,OAAgB;CAAI;;AACpD,AAAD,SAAI,AAAA,QAAQ,CAAC;EAAE,gBAAgB,EAAE,OAAgB;CAAI;;AACpD,AAAD,SAAI,AAAA,QAAQ,CAAC;EAAE,gBAAgB,EAAE,KAAkB;CAAI;;AACtD,AAAD,SAAI,AAAA,QAAQ,CAAC;EAAE,gBAAgB,EAAE,OAAa;CAAI;;AACjD,AAAD,SAAI,AAAA,QAAQ,CAAC;EAAE,gBAAgB,EAAE,OAAgB;CAAI;;AACpD,AAAD,SAAI,AAAA,QAAQ,CAAC;EAAE,gBAAgB,EAAE,OAAgB;CAAI;;AAGvD,AAAA,EAAE,AAAA,OAAO,CAAC;EACR,OAAO,EAAE,IAAI;EAEb,UAAU,EAAE,KAAK;EACjB,eAAe,EAAE,IAAI;EACrB,MAAM,EAAE,CAAC;EACT,OAAO,EAAE,KAAK;CAGf;;AATD,AAQE,EARA,AAAA,OAAO,CAQP,EAAE,AAAA,IAAK,CAAA,WAAW,EAAE;EAAE,YAAY,EAAE,GAAG;CAAI;;AAG7C,AAAA,EAAE,AAAA,OAAO,AAAA,MAAM,CAAC;EACd,eAAe,EAAE,MAAM;CAGxB;;AAJD,AAGE,EAHA,AAAA,OAAO,AAAA,MAAM,CAGb,IAAI,CAAC;EAAE,eAAe,EAAE,IAAI;CAAI",
|
"mappings": "AAAA,AAAA,IAAI,CAAC;EACH,UAAU,EAAE,UAAU;EACtB,MAAM,EAAE,KAAK;EACb,UAAU,EAAE,WAAW;EACvB,WAAW,EAAE,IAAI;CAClB;;AAED,AAAA,IAAI,EAAE,IAAI,CAAC;EAAE,MAAM,EAAE,KAAK;CAAI;;AAC9B,AAAA,CAAC,EAAE,CAAC,AAAA,OAAO,EAAE,CAAC,AAAA,MAAM,CAAC;EAAE,UAAU,EAAE,OAAO;CAAI;;AAE9C,AAAA,IAAI,CAAC;EACH,MAAM,EAAE,WAAW;EAEnB,KAAK,EAAE,IAAI;EACX,KAAK,EAAE,KAAK;EAEZ,WAAW,EAAE,oIAAoI;EACjJ,SAAS,EAAE,GAAG;CACf;;AAED,AAAA,EAAE,EAAE,EAAE,CAAC;EACL,MAAM,EAAE,KAAK;EACb,WAAW,EAAE,CAAC;CACf;;AAED,AAAA,EAAE,CAAC;EAAE,SAAS,EAAE,MAAM;CAAI;;AAC1B,AAAA,EAAE,CAAC;EAAE,SAAS,EAAE,OAAO;CAAI;;AAE3B,AAAA,QAAQ,CAAC;EACP,OAAO,EAAE,IAAI;EACb,eAAe,EAAE,aAAa;EAC9B,WAAW,EAAE,UAAU;EACvB,aAAa,EAAE,GAAG;EAClB,OAAO,EAAE,SAAS;CACnB;;AAED,AAAA,SAAS,CAAC;EACR,QAAQ,EAAE,MAAM;EAChB,GAAG,EAAE,CAAC;EACN,OAAO,EAAE,CAAC;EAEV,SAAS,EAAE,IAAI;EACf,gBAAgB,EAAE,OAAO;EAEzB,OAAO,EAAE,KAAK;CACf;;AAED,AAAA,QAAQ,CAAC;EACP,UAAU,EAAE,IAAI;EAChB,UAAU,EAAE,IAAI;EAChB,UAAU,EAAE,MAAM;EAElB,aAAa,EAAE,KAAK;EACpB,gBAAgB,EAAO,mBAAK;CAG7B;;AATD,AAQE,QARM,AAQL,mBAAmB,CAAC;EAAE,OAAO,EAAE,IAAI;CAAI;;AAG1C,AAAA,KAAK,CAAC;EACJ,eAAe,EAAE,QAAQ;EACzB,KAAK,EAAE,IAAI;EACX,aAAa,EAAE,OAAO;CAsCvB;;AAzCD,AAKE,KALG,CAKH,EAAE,CAAC;EACD,QAAQ,EAAE,MAAM;EAChB,GAAG,EAAE,GAAG;EACR,UAAU,EAAE,IAAI;EAChB,OAAO,EAAE,CAAC;EAEV,gBAAgB,EAAE,OAAO;EACzB,UAAU,EAAE,iBAAiB;CAC9B;;AAbH,AAeE,KAfG,CAeH,EAAE,EAfJ,KAAK,CAeC,EAAE,CAAC;EACL,OAAO,EAAE,SAAS;CAInB;;AApBH,AAkBI,KAlBC,CAeH,EAAE,AAGC,YAAY,EAlBjB,KAAK,CAeC,EAAE,AAGH,YAAY,CAAC;EAAE,YAAY,EAAE,GAAG;CAAI;;AAlBzC,AAmBI,KAnBC,CAeH,EAAE,AAIC,WAAW,EAnBhB,KAAK,CAeC,EAAE,AAIH,WAAW,CAAC;EAAE,aAAa,EAAE,GAAG;CAAI;;AAnBzC,AAuBI,KAvBC,CAsBH,EAAE,CACA,EAAE,CAAC;EACD,QAAQ,EAAE,MAAM;CAajB;;AArCL,AA0BM,KA1BD,CAsBH,EAAE,CACA,EAAE,AAGC,UAAW,CAAA,CAAC,EAAE;EAAE,KAAK,EAAE,cAAc;CAAI;;AA1BhD,AA2BM,KA3BD,CAsBH,EAAE,CACA,EAAE,AAIC,UAAW,CAAA,CAAC,EAAE;EACb,SAAS,EAAE,IAAI;EACf,WAAW,EAAE,IAAI;EACjB,UAAU,EAAE,IAAI;EAChB,WAAW,EAAE,MAAM;CAGpB;;AAlCP,AAiCQ,KAjCH,CAsBH,EAAE,CACA,EAAE,AAIC,UAAW,CAAA,CAAC,CAMV,mBAAmB,CAAC;EAAE,OAAO,EAAE,IAAI;CAAI;;AAjChD,AAmCM,KAnCD,CAsBH,EAAE,CACA,EAAE,AAYC,UAAW,CAAA,CAAC,EAAE;EAAE,KAAK,EAAE,eAAe;CAAI;;AAnCjD,AAoCM,KApCD,CAsBH,EAAE,CACA,EAAE,AAaC,UAAW,CAAA,CAAC,EAAE;EAAE,KAAK,EAAE,eAAe;CAAI;;AApCjD,AAuCI,KAvCC,CAsBH,EAAE,AAiBC,UAAW,CAAA,IAAI,EAAE;EAAE,gBAAgB,EAAE,mBAAkB;CAAI;;AAIhE,AACE,MADI,AACH,QAAQ,CAAC;EACR,OAAO,EAAE,EAAE;EACX,MAAM,EAAE,KAAK;EACb,KAAK,EAAE,KAAK;EACZ,aAAa,EAAE,GAAG;EAClB,OAAO,EAAE,YAAY;EACrB,KAAK,EAAE,OAAO;EACd,MAAM,EAAE,GAAG,CAAC,KAAK,CAAC,0BAA0B;EAE5C,YAAY,EAAE,IAAI;EAClB,aAAa,EAAE,GAAG;CACnB;;AAEA,AAAD,SAAI,AAAA,QAAQ,CAAC;EAAE,gBAAgB,EAAE,KAAkB;CAAI;;AACtD,AAAD,SAAI,AAAA,QAAQ,CAAC;EAAE,gBAAgB,EAAE,OAAe;CAAI;;AACnD,AAAD,SAAI,AAAA,QAAQ,CAAC;EAAE,gBAAgB,EAAE,OAAc;CAAI;;AAClD,AAAD,SAAI,AAAA,QAAQ,CAAC;EAAE,gBAAgB,EAAE,OAAc;CAAI;;AAClD,AAAD,SAAI,AAAA,QAAQ,CAAC;EAAE,gBAAgB,EAAE,OAAgB;CAAI;;AACpD,AAAD,SAAI,AAAA,QAAQ,CAAC;EAAE,gBAAgB,EAAE,OAAgB;CAAI;;AACpD,AAAD,SAAI,AAAA,QAAQ,CAAC;EAAE,gBAAgB,EAAE,KAAkB;CAAI;;AACtD,AAAD,SAAI,AAAA,QAAQ,CAAC;EAAE,gBAAgB,EAAE,OAAa;CAAI;;AACjD,AAAD,SAAI,AAAA,QAAQ,CAAC;EAAE,gBAAgB,EAAE,OAAgB;CAAI;;AACpD,AAAD,SAAI,AAAA,QAAQ,CAAC;EAAE,gBAAgB,EAAE,OAAgB;CAAI;;AAGvD,AAAA,EAAE,AAAA,OAAO,CAAC;EACR,OAAO,EAAE,IAAI;EAEb,UAAU,EAAE,KAAK;EACjB,eAAe,EAAE,IAAI;EACrB,MAAM,EAAE,CAAC;EACT,OAAO,EAAE,KAAK;CAGf;;AATD,AAQE,EARA,AAAA,OAAO,CAQP,EAAE,AAAA,IAAK,CAAA,WAAW,EAAE;EAAE,YAAY,EAAE,GAAG;CAAI;;AAG7C,AAAA,EAAE,AAAA,OAAO,AAAA,MAAM,CAAC;EACd,eAAe,EAAE,MAAM;CAGxB;;AAJD,AAGE,EAHA,AAAA,OAAO,AAAA,MAAM,CAGb,IAAI,CAAC;EAAE,eAAe,EAAE,IAAI;CAAI",
|
||||||
"sources": [
|
"sources": [
|
||||||
"style.scss"
|
"style.scss"
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ h2 { font-size: 1.125em; }
|
|||||||
z-index: 3;
|
z-index: 3;
|
||||||
|
|
||||||
font-size: .9em;
|
font-size: .9em;
|
||||||
background-color: black;
|
background-color: #0C0C0C;
|
||||||
|
|
||||||
padding: 1em 0;
|
padding: 1em 0;
|
||||||
}
|
}
|
||||||
@@ -67,10 +67,8 @@ table {
|
|||||||
text-align: left;
|
text-align: left;
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
|
|
||||||
background-color: black;
|
background-color: #0C0C0C;
|
||||||
|
border-top: 1px solid #0f0f0f;
|
||||||
&:first-child { border-top-left-radius: .25em; }
|
|
||||||
&:last-child { border-top-right-radius: .25em; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
th, td {
|
th, td {
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
<input type="text" name="input" id="input-value" autofocus>
|
<input type="text" name="input" id="input-value" autofocus>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<a target="_blank" id="close"></a>
|
<!--<a target="_blank" id="close"></a>-->
|
||||||
</main>
|
</main>
|
||||||
<script type="text/javascript" src="package://assets/js/jquery-3.3.1.min.js"></script>
|
<script type="text/javascript" src="package://assets/js/jquery-3.3.1.min.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|||||||
@@ -10,6 +10,8 @@
|
|||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
|
<div name="inventory" class="inventory hidden">
|
||||||
|
|
||||||
<div class="alerts" id='alertbox'>
|
<div class="alerts" id='alertbox'>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -108,6 +110,7 @@
|
|||||||
</div> -->
|
</div> -->
|
||||||
|
|
||||||
<div id="invisible" style="display: none"></div>
|
<div id="invisible" style="display: none"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<script src="../../js/jquery-3.3.1.min.js"></script>
|
<script src="../../js/jquery-3.3.1.min.js"></script>
|
||||||
<script>
|
<script>
|
||||||
@@ -176,6 +179,20 @@
|
|||||||
|
|
||||||
var vehInvItem = [];
|
var vehInvItem = [];
|
||||||
|
|
||||||
|
function showInventory() {
|
||||||
|
lastClass = "backpackClass";
|
||||||
|
|
||||||
|
document.getElementsByName("backpackClass")[0].classList.remove("hidden");
|
||||||
|
document.getElementsByName("vehClass")[0].classList.remove("hidden");
|
||||||
|
document.getElementsByName("vehClass")[0].classList.toggle("hidden");
|
||||||
|
//document.getElementsByName("handelClass")[0].style.visibility = "hidden";
|
||||||
|
document.getElementsByName("inventory")[0].classList.remove("hidden");
|
||||||
|
}
|
||||||
|
|
||||||
|
function closeInventory() {
|
||||||
|
document.getElementsByName("inventory")[0].classList.toggle("hidden");
|
||||||
|
}
|
||||||
|
|
||||||
function setBackpackItems(jsonItemArr) {
|
function setBackpackItems(jsonItemArr) {
|
||||||
console.log(jsonItemArr);
|
console.log(jsonItemArr);
|
||||||
var parsedItemArr = JSON.parse(jsonItemArr)
|
var parsedItemArr = JSON.parse(jsonItemArr)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="de">
|
<html lang="de">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
@@ -8,6 +8,7 @@
|
|||||||
<link rel="stylesheet" href="../../css/onlinelist/style.css">
|
<link rel="stylesheet" href="../../css/onlinelist/style.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
<div name="OnlineList" class="onlineList hidden">
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
<div class="heading">
|
<div class="heading">
|
||||||
<h1>Spielerliste</h1>
|
<h1>Spielerliste</h1>
|
||||||
@@ -32,10 +33,10 @@
|
|||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>ID</th>
|
<th data-sort="int">ID</th>
|
||||||
<th>Name</th>
|
<th data-sort="string">Name</th>
|
||||||
<th>Fraktion</th>
|
<th data-sort="string">Fraktion</th>
|
||||||
<th>Ping (ms)</th>
|
<th data-sort="int">Ping (ms)</th>
|
||||||
<tr>
|
<tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
||||||
@@ -44,6 +45,10 @@
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script src="../../js/jquery-3.3.1.min.js"></script>
|
||||||
|
<script src="../../js/onlinelist/stupidtable.min.js"></script>
|
||||||
<script src="../../js/onlinelist/script.js"></script>
|
<script src="../../js/onlinelist/script.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 7.8 KiB After Width: | Height: | Size: 2.1 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 7.4 KiB After Width: | Height: | Size: 2.2 KiB |
@@ -1,7 +1,7 @@
|
|||||||
let chat =
|
let chat =
|
||||||
{
|
{
|
||||||
size: 0,
|
size: 0,
|
||||||
history_limit: 50,
|
history_limit: 150,
|
||||||
container: null,
|
container: null,
|
||||||
input: null,
|
input: null,
|
||||||
enabled: false,
|
enabled: false,
|
||||||
@@ -21,10 +21,9 @@ function enableChatInput(enable) {
|
|||||||
mp.invoke("focus", enable);
|
mp.invoke("focus", enable);
|
||||||
|
|
||||||
if (enable) {
|
if (enable) {
|
||||||
chat.input = $("#chat").append('<div><input id="chat_msg" type="text" /></div>').children(":last");
|
chat.input = $("#chat").append('<div><input id="chat_msg" type="text" maxlength="375" /></div>').children(":last");
|
||||||
chat.input.children("input").focus();
|
chat.input.children("input").focus();
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
chat.input.fadeOut('fast', function () {
|
chat.input.fadeOut('fast', function () {
|
||||||
chat.input.remove();
|
chat.input.remove();
|
||||||
chat.input = null;
|
chat.input = null;
|
||||||
@@ -66,10 +65,10 @@ var chatAPI =
|
|||||||
|
|
||||||
if (chatElement === "<li></li>") {
|
if (chatElement === "<li></li>") {
|
||||||
if (chat.input == null || elmnt.scrollTop == elmnt.scrollHeight - elmnt.clientHeight) {
|
if (chat.input == null || elmnt.scrollTop == elmnt.scrollHeight - elmnt.clientHeight) {
|
||||||
chat.container.append("<li>" + "[" + today.toLocaleTimeString('de-DE') + "] " + text + "</li>");
|
chat.container.append("<li>" + "<span class='timestamp'>[" + today.toLocaleTimeString('de-DE') + "]</span> " + text + "</li>");
|
||||||
elmnt.scrollTop = elmnt.scrollHeight - elmnt.clientHeight;
|
elmnt.scrollTop = elmnt.scrollHeight - elmnt.clientHeight;
|
||||||
} else {
|
} else {
|
||||||
chat.container.append("<li>" + "[" + today.toLocaleTimeString('de-DE') + "] " + text + "</li>");
|
chat.container.append("<li>" + "<span class='timestamp'>[" + today.toLocaleTimeString('de-DE') + "]</span> " + text + "</li>");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
chat.container.append(chatElement);
|
chat.container.append(chatElement);
|
||||||
|
|||||||
@@ -3,12 +3,26 @@ window.onbeforeunload = () => { window.scrollTo(0, 0); }
|
|||||||
setPlayerCount = (factionId, value) => {
|
setPlayerCount = (factionId, value) => {
|
||||||
if (factionId == -1) {
|
if (factionId == -1) {
|
||||||
document.getElementById('player-count').innerHTML = value;
|
document.getElementById('player-count').innerHTML = value;
|
||||||
addTableSorting();
|
|
||||||
} else if (factionId >= 0 && factionId <= 9) {
|
} else if (factionId >= 0 && factionId <= 9) {
|
||||||
document.getElementById(factionId).innerHTML = value;
|
document.getElementById(factionId).innerHTML = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function showPlayerList() {
|
||||||
|
document.getElementsByName("OnlineList")[0].classList.remove("hidden");
|
||||||
|
mp.events.call("CEF:PlayerList_Loaded");
|
||||||
|
window.scrollTo(0, 0);
|
||||||
|
}
|
||||||
|
function closePlayerList() {
|
||||||
|
document.getElementsByName("OnlineList")[0].classList.toggle("hidden");
|
||||||
|
}
|
||||||
|
|
||||||
|
function clear_row() {
|
||||||
|
document.getElementById('players').innerHTML = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function getFactionNameByFactionId(factionId) {
|
function getFactionNameByFactionId(factionId) {
|
||||||
switch (parseInt(factionId)) {
|
switch (parseInt(factionId)) {
|
||||||
case 1: return "LSPD";
|
case 1: return "LSPD";
|
||||||
@@ -28,33 +42,4 @@ function addPlayerEntry(userId, userName, factionId, userPing) {
|
|||||||
document.getElementById('players').innerHTML += `<tr><td>${userId}</td> <td>${userName}</td> <td class="group group--${factionId}">${factionName}</td> <td>${userPing}</td></tr>`;
|
document.getElementById('players').innerHTML += `<tr><td>${userId}</td> <td>${userName}</td> <td class="group group--${factionId}">${factionName}</td> <td>${userPing}</td></tr>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://www.jstips.co/en/javascript/detect-document-ready-in-pure-js/
|
$("table").stupidtable();
|
||||||
document.onreadystatechange = () => {
|
|
||||||
if (document.readyState === 'complete') { mp.trigger('CEF:PlayerList_Loaded'); }
|
|
||||||
};
|
|
||||||
|
|
||||||
// Sortierung von https://codepen.io/selbekk/pen/LNOZKL
|
|
||||||
function addTableSorting() {
|
|
||||||
const headers = Array.from(document.querySelectorAll('th'));
|
|
||||||
const rows = Array.from(document.querySelectorAll('tbody tr'));
|
|
||||||
|
|
||||||
function sort(e) {
|
|
||||||
const index = headers.indexOf(e.target);
|
|
||||||
const sortVal = e.target.classList.contains('is-asc') ? 1 : -1;
|
|
||||||
rows.sort((a, b) => {
|
|
||||||
const aValue = a.children[index].innerHTML;
|
|
||||||
const bValue = b.children[index].innerHTML;
|
|
||||||
if(aValue > bValue) { return sortVal; }
|
|
||||||
if(aValue < bValue) { return -sortVal; }
|
|
||||||
return 0;
|
|
||||||
})
|
|
||||||
|
|
||||||
e.target.classList.add('is-sorted');
|
|
||||||
e.target.classList.toggle('is-asc');
|
|
||||||
const body = document.querySelector('tbody');
|
|
||||||
body.innerHTML = '';
|
|
||||||
rows.forEach(row => body.appendChild(row));
|
|
||||||
}
|
|
||||||
|
|
||||||
headers.forEach(header => header.addEventListener('click', sort));
|
|
||||||
}
|
|
||||||
|
|||||||
1
ReallifeGamemode.Client/assets/js/onlinelist/stupidtable.min.js
vendored
Normal file
1
ReallifeGamemode.Client/assets/js/onlinelist/stupidtable.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
!function(i){i.fn.stupidtable=function(n){return this.each(function(){var t=i(this);n=n||{},n=i.extend({},i.fn.stupidtable.default_sort_fns,n),t.data("sortFns",n),t.stupidtable_build(),t.on("click.stupidtable","thead th",function(){i(this).stupidsort()}),t.find("th[data-sort-onload=yes]").eq(0).stupidsort()})},i.fn.stupidtable.default_settings={should_redraw:function(t){return!0},will_manually_build_table:!1},i.fn.stupidtable.dir={ASC:"asc",DESC:"desc"},i.fn.stupidtable.default_sort_fns={int:function(t,n){return parseInt(t,10)-parseInt(n,10)},float:function(t,n){return parseFloat(t)-parseFloat(n)},string:function(t,n){return t.toString().localeCompare(n.toString())},"string-ins":function(t,n){return t=t.toString().toLocaleLowerCase(),n=n.toString().toLocaleLowerCase(),t.localeCompare(n)}},i.fn.stupidtable_settings=function(a){return this.each(function(){var t=i(this),n=i.extend({},i.fn.stupidtable.default_settings,a);t.stupidtable.settings=n})},i.fn.stupidsort=function(t){var a=i(this),n=a.data("sort")||null;if(null!==n){var r=a.closest("table"),e={$th:a,$table:r,datatype:n};return r.stupidtable.settings||(r.stupidtable.settings=i.extend({},i.fn.stupidtable.default_settings)),e.compare_fn=r.data("sortFns")[n],e.th_index=l(e),e.sort_dir=u(t,e),a.data("sort-dir",e.sort_dir),r.trigger("beforetablesort",{column:e.th_index,direction:e.sort_dir,$th:a}),r.css("display"),setTimeout(function(){r.stupidtable.settings.will_manually_build_table||r.stupidtable_build();var t=s(e),n=d(t,e);r.stupidtable.settings.should_redraw(e)&&(r.children("tbody").append(n),o(e),r.trigger("aftertablesort",{column:e.th_index,direction:e.sort_dir,$th:a}),r.css("display"))},10),a}},i.fn.updateSortVal=function(t){var n=i(this);return n.is("[data-sort-value]")&&n.attr("data-sort-value",t),n.data("sort-value",t),n},i.fn.stupidtable_build=function(){return this.each(function(){var t=i(this),a=[];t.children("tbody").children("tr").each(function(t,n){var e={$tr:i(n),columns:[],index:t};i(n).children("td").each(function(t,n){var a=i(n).data("sort-value");if(void 0===a){var r=i(n).text();i(n).data("sort-value",r),a=r}e.columns.push(a)}),a.push(e)}),t.data("stupidsort_internaltable",a)})};var s=function(s){var t,n=s.$table.data("stupidsort_internaltable"),d=s.th_index,a=s.$th.data("sort-multicolumn");t=a?a.split(","):[];var o=i.map(t,function(t,n){return r(s.$table,t)});return n.sort(function(t,n){for(var a=o.slice(0),r=s.compare_fn(t.columns[d],n.columns[d]);0===r&&a.length;){var e=a[0],i=e.$e.data("sort");r=(0,s.$table.data("sortFns")[i])(t.columns[e.index],n.columns[e.index]),a.shift()}return 0===r?t.index-n.index:r}),s.sort_dir!=i.fn.stupidtable.dir.ASC&&n.reverse(),n},r=function(t,n){var a,r=t.find("th"),e=parseInt(n,10);return e||0===e?a=r.eq(e):(a=r.siblings("#"+n),e=r.index(a)),{index:e,$e:a}},d=function(t,a){var n=i.map(t,function(t,n){return[[t.columns[a.th_index],t.$tr,n]]});return a.column=n,i.map(t,function(t){return t.$tr})},o=function(t){var n=t.$table,a=t.$th,r=a.data("sort-dir");n.find("th").data("sort-dir",null).removeClass("sorting-desc sorting-asc"),a.data("sort-dir",r).addClass("sorting-"+r)},u=function(t,n){var a,r=n.$th,e=i.fn.stupidtable.dir;return t?a=t:(a=t||r.data("sort-default")||e.ASC,r.data("sort-dir")&&(a=r.data("sort-dir")===e.ASC?e.DESC:e.ASC)),a},l=function(t){var n=0,a=t.$th.index();return t.$th.parents("tr").find("th").slice(0,a).each(function(){var t=i(this).attr("colspan")||1;n+=parseInt(t,10)}),n}}(window.jQuery);
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:6f1478ada7534b954caaec991bb2a3a24767b978de82533965e0c21c3d02831f
|
|
||||||
size 8491
|
|
||||||
3
ReallifeGamemode.Client/dlcpacks/fibgarage/dlc.rpf
Normal file
3
ReallifeGamemode.Client/dlcpacks/fibgarage/dlc.rpf
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:d7c638247cd28299585423da1746b80f7262daa3e86ffafd9d3254b9a66ef8e2
|
||||||
|
size 38912
|
||||||
3
ReallifeGamemode.Client/dlcpacks/heal/dlc.rpf
Normal file
3
ReallifeGamemode.Client/dlcpacks/heal/dlc.rpf
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:bb41e0f12df5bc1a1d0425d0b01f0918a18d27d6e10fec95145cd5d4633a29cd
|
||||||
|
size 38912
|
||||||
3
ReallifeGamemode.Client/dlcpacks/polcoquette/dlc.rpf
Normal file
3
ReallifeGamemode.Client/dlcpacks/polcoquette/dlc.rpf
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:fc9132404cdc1d20830d4684697bf82f3738bc4345cc6d1189cf2b63f0b15de8
|
||||||
|
size 2962432
|
||||||
3
ReallifeGamemode.Client/dlcpacks/sheriffcoqm/dlc.rpf
Normal file
3
ReallifeGamemode.Client/dlcpacks/sheriffcoqm/dlc.rpf
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:7a66cd9ec235636bd61c7cf90c0602be8bf97c303fe2fa6703b49c42352aeb7c
|
||||||
|
size 18657792
|
||||||
3
ReallifeGamemode.Client/dlcpacks/vagos/dlc.rpf
Normal file
3
ReallifeGamemode.Client/dlcpacks/vagos/dlc.rpf
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:e881ff859b49942bfa942525cb5acac5bd5a123c3febbbec28da3b84acc266b6
|
||||||
|
size 98816
|
||||||
3
ReallifeGamemode.Client/dlcpacks/vtvicechee/dlc.rpf
Normal file
3
ReallifeGamemode.Client/dlcpacks/vtvicechee/dlc.rpf
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:a7eb55afdb7bc022b5308388902e886291bff38a688b38e0dfcb48d492232a1a
|
||||||
|
size 5581312
|
||||||
6
ReallifeGamemode.Client/global.d.ts
vendored
6
ReallifeGamemode.Client/global.d.ts
vendored
@@ -91,6 +91,12 @@ declare type WeaponCategory = {
|
|||||||
Weapons: Weapon[];
|
Weapons: Weapon[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
declare type RentcarProperty = {
|
||||||
|
Name: string;
|
||||||
|
Price: number;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
declare type PlayerCharacterData = {
|
declare type PlayerCharacterData = {
|
||||||
Gender: boolean;
|
Gender: boolean;
|
||||||
Father: number;
|
Father: number;
|
||||||
|
|||||||
@@ -186,8 +186,8 @@ ped();
|
|||||||
import reportList from './Player/reportmenu';
|
import reportList from './Player/reportmenu';
|
||||||
reportList(globalData);
|
reportList(globalData);
|
||||||
|
|
||||||
import nodmHandler from './Player/nodm';
|
import polygonHandler from './Player/polygons';
|
||||||
nodmHandler();
|
polygonHandler();
|
||||||
|
|
||||||
import checkpointHandle from './util/checkpoint';
|
import checkpointHandle from './util/checkpoint';
|
||||||
checkpointHandle(globalData);
|
checkpointHandle(globalData);
|
||||||
@@ -208,7 +208,7 @@ import PilotRouteList from './Jobs/PilotRouteSelect';
|
|||||||
PilotRouteList(globalData);
|
PilotRouteList(globalData);
|
||||||
|
|
||||||
import weapondamageUtil from './util/weapondamage';
|
import weapondamageUtil from './util/weapondamage';
|
||||||
weapondamageUtil();
|
weapondamageUtil(globalData);
|
||||||
|
|
||||||
import soundUtil from './util/sound';
|
import soundUtil from './util/sound';
|
||||||
soundUtil();
|
soundUtil();
|
||||||
@@ -277,6 +277,14 @@ handsup();
|
|||||||
import spawnschutz from './Player/spawnschutz';
|
import spawnschutz from './Player/spawnschutz';
|
||||||
spawnschutz();
|
spawnschutz();
|
||||||
|
|
||||||
|
import bigmap from './Gui/bigmap';
|
||||||
|
bigmap();
|
||||||
|
|
||||||
|
import notification from './Gui/notification';
|
||||||
|
notification();
|
||||||
|
|
||||||
|
import rentCar from './util/rentcar';
|
||||||
|
rentCar(globalData);
|
||||||
|
|
||||||
require('./Gui/policedepartment');
|
require('./Gui/policedepartment');
|
||||||
require('./Gui/helptext');
|
require('./Gui/helptext');
|
||||||
|
|||||||
@@ -12,51 +12,27 @@
|
|||||||
|
|
||||||
var loaded = false;
|
var loaded = false;
|
||||||
|
|
||||||
mp.events.add('inventoryShow', () => {
|
mp.events.add('loadInventoryCEF', () => {
|
||||||
|
itemArr = [];
|
||||||
|
vehItemArr = [];
|
||||||
if (invBrowser !== null) {
|
if (invBrowser !== null) {
|
||||||
invBrowser.destroy()
|
invBrowser.destroy
|
||||||
invBrowser = null;
|
|
||||||
globalData.InMenu = false;
|
|
||||||
loaded = false;
|
|
||||||
mp.gui.cursor.show(false, false);
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
if (!globalData.InMenu) {
|
|
||||||
globalData.InMenu = true;
|
|
||||||
mp.gui.cursor.show(true, true);
|
|
||||||
itemArr = [];
|
|
||||||
vehItemArr = [];
|
|
||||||
invBrowser = mp.browsers.new('package://assets/html/inventory/inventory.html');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
var offer = 0;
|
|
||||||
|
|
||||||
var tradeItemID;
|
|
||||||
var tradeItemAmount;
|
|
||||||
var tradeItemName;
|
|
||||||
var tradeItemWeight;
|
|
||||||
|
|
||||||
mp.events.add('openInventory', () => {
|
|
||||||
globalData.InMenu = true;
|
|
||||||
mp.gui.cursor.show(true, true);
|
|
||||||
itemArr = [];
|
|
||||||
vehItemArr = [];
|
|
||||||
invBrowser = mp.browsers.new('package://assets/html/inventory/inventory.html');
|
invBrowser = mp.browsers.new('package://assets/html/inventory/inventory.html');
|
||||||
});
|
});
|
||||||
mp.events.add('closeInventory', () => {
|
|
||||||
invBrowser.destroy()
|
|
||||||
invBrowser = null;
|
|
||||||
globalData.InMenu = false;
|
|
||||||
loaded = false;
|
|
||||||
mp.gui.cursor.show(false, false);
|
|
||||||
return;
|
|
||||||
});
|
|
||||||
|
|
||||||
mp.events.addDataHandler("tradeOffer", (entity, value) => {
|
mp.events.add('inventoryShow', () => {
|
||||||
if (entity.type === "player") {
|
if (!globalData.InMenu && !loaded) {
|
||||||
offer = parseInt(value);
|
globalData.InMenu = true;
|
||||||
if (invBrowser != null)
|
mp.gui.cursor.show(true, true);
|
||||||
invBrowser.execute(`changeTradeStatus('${JSON.stringify(offer)}')`);
|
loaded = true;
|
||||||
|
|
||||||
|
invBrowser.execute(`showInventory()`);
|
||||||
|
} else if (loaded) {
|
||||||
|
globalData.InMenu = false;
|
||||||
|
mp.gui.cursor.show(false, false);
|
||||||
|
loaded = false;
|
||||||
|
invBrowser.execute(`closeInventory()`);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -81,17 +57,6 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
mp.events.add("CEF:InventoryLoaded", () => {
|
|
||||||
invBrowser.execute(`setBackpackItems('${JSON.stringify(itemArr)}')`);
|
|
||||||
if (vehItemArr.length != 0) {
|
|
||||||
invBrowser.execute(`setVehicleItems('${JSON.stringify(vehItemArr)}')`);
|
|
||||||
}
|
|
||||||
|
|
||||||
//invBrowser.execute(`setTradeItems('${JSON.stringify(tradeItemArr)}')`);
|
|
||||||
//invBrowser.execute(`setOfferItems('${JSON.stringify(offerItemArr)}')`);
|
|
||||||
loaded = true;
|
|
||||||
});
|
|
||||||
|
|
||||||
mp.events.add("CEF:callVehicleInventory", () => {
|
mp.events.add("CEF:callVehicleInventory", () => {
|
||||||
mp.events.callRemote("CLIENT:getVehicleInventory")
|
mp.events.callRemote("CLIENT:getVehicleInventory")
|
||||||
});
|
});
|
||||||
@@ -117,8 +82,8 @@
|
|||||||
mp.events.add("aproveUse", (amount, name) => {
|
mp.events.add("aproveUse", (amount, name) => {
|
||||||
if (invBrowser !== null) {
|
if (invBrowser !== null) {
|
||||||
mp.game.audio.playSoundFrontend(1, "LOCAL_PLYR_CASH_COUNTER_COMPLETE", "DLC_HEISTS_GENERAL_FRONTEND_SOUNDS", true);
|
mp.game.audio.playSoundFrontend(1, "LOCAL_PLYR_CASH_COUNTER_COMPLETE", "DLC_HEISTS_GENERAL_FRONTEND_SOUNDS", true);
|
||||||
invBrowser.execute(`alertGreen('${JSON.stringify(amount)}','${JSON.stringify(name)}')`);
|
//invBrowser.execute(`alertGreen('${JSON.stringify(amount)}','${JSON.stringify(name)}')`);
|
||||||
mp.events.call("closeInventory");
|
//mp.events.call("inventoryShow");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -171,16 +136,4 @@
|
|||||||
mp.events.add("CEF:UseItemInv", (itemId) => {
|
mp.events.add("CEF:UseItemInv", (itemId) => {
|
||||||
mp.events.callRemote('invUseItem', itemId);
|
mp.events.callRemote('invUseItem', itemId);
|
||||||
});
|
});
|
||||||
|
|
||||||
mp.events.add("CEF:tradeItem", (money, User, tradeItems, tradeItemAmount) => {
|
|
||||||
if (invBrowser !== null) {
|
|
||||||
try {
|
|
||||||
invBrowser.destroy()
|
|
||||||
invBrowser = null;
|
|
||||||
mp.events.callRemote('tradeItem', 0, User, tradeItems, tradeItemAmount);
|
|
||||||
} finally {
|
|
||||||
mp.gui.cursor.show(false, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,6 @@
|
|||||||
export default function gangwarHandle(globalData: IGlobalData) {
|
export default function gangwarHandle(globalData: IGlobalData) {
|
||||||
|
var gangwarKillCounter = 0;
|
||||||
|
|
||||||
function inside(point, vs) {
|
function inside(point, vs) {
|
||||||
let x = point[0],
|
let x = point[0],
|
||||||
y = point[1];
|
y = point[1];
|
||||||
@@ -625,4 +627,12 @@
|
|||||||
//turf.render();
|
//turf.render();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
mp.events.add("gangWarKillNotification", (deathPlayername) => {
|
||||||
|
mp.events.call("BN_Show", "~y~GANGWAR~w~: Du hast ~r~" + deathPlayername + " ~w~getötet. Kills: " + ++gangwarKillCounter);
|
||||||
|
});
|
||||||
|
|
||||||
|
mp.events.add("resetKillcounter", () => {
|
||||||
|
gangwarKillCounter = 0;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
@@ -87,7 +87,7 @@ export default function animationSync() {
|
|||||||
mp.events.addDataHandler("AnimationData", (entity, string) => {
|
mp.events.addDataHandler("AnimationData", (entity, string) => {
|
||||||
entity.clearTasksImmediately();
|
entity.clearTasksImmediately();
|
||||||
if (animationBreakTimer) {
|
if (animationBreakTimer) {
|
||||||
clearInterval(animationBreakTimer);
|
clearTimeout(animationBreakTimer);
|
||||||
animationBreakTimer = null;
|
animationBreakTimer = null;
|
||||||
}
|
}
|
||||||
if (string == null) {
|
if (string == null) {
|
||||||
@@ -109,13 +109,12 @@ export default function animationSync() {
|
|||||||
|
|
||||||
if (mp.players.local == entity) {
|
if (mp.players.local == entity) {
|
||||||
if (!endless) {
|
if (!endless) {
|
||||||
animationBreakTimer = setInterval(() => breakAnimation(name), 120000);
|
animationBreakTimer = setTimeout(() => breakAnimation(name), 120000);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!loop) {
|
if (!loop) {
|
||||||
let a = setInterval(function () {
|
let a = setTimeout(function () {
|
||||||
clearInterval(a);
|
clearTimeout(a);
|
||||||
mp.game.wait(500);
|
|
||||||
mp.events.callRemote("CLIENT:ClearAnimationData", true);
|
mp.events.callRemote("CLIENT:ClearAnimationData", true);
|
||||||
}, duration);
|
}, duration);
|
||||||
}
|
}
|
||||||
@@ -126,7 +125,7 @@ export default function animationSync() {
|
|||||||
let { animName, msg } = animationBreakMessage.find(c => c.animName == name)
|
let { animName, msg } = animationBreakMessage.find(c => c.animName == name)
|
||||||
|
|
||||||
if (msg)
|
if (msg)
|
||||||
mp.events.call("renderTextOnScreen", msg);
|
mp.events.call("BN_Show", msg);
|
||||||
|
|
||||||
clearInterval(animationBreakTimer);
|
clearInterval(animationBreakTimer);
|
||||||
animationBreakTimer = null;
|
animationBreakTimer = null;
|
||||||
|
|||||||
102
ReallifeGamemode.Client/util/rentcar.ts
Normal file
102
ReallifeGamemode.Client/util/rentcar.ts
Normal file
@@ -0,0 +1,102 @@
|
|||||||
|
import * as NativeUI from '../libs/NativeUI';
|
||||||
|
|
||||||
|
const Menu = NativeUI.Menu;
|
||||||
|
const UIMenuItem = NativeUI.UIMenuItem;
|
||||||
|
const UIMenuListItem = NativeUI.UIMenuListItem;
|
||||||
|
const Point = NativeUI.Point;
|
||||||
|
const ItemsCollection = NativeUI.ItemsCollection;
|
||||||
|
const Color = NativeUI.Color;
|
||||||
|
|
||||||
|
|
||||||
|
let screenRes = mp.game.graphics.getScreenResolution(0, 0);
|
||||||
|
|
||||||
|
let sendItem = new UIMenuItem("Mieten", "Fahrzeug Mieten");
|
||||||
|
sendItem.BackColor = new Color(13, 71, 161);
|
||||||
|
sendItem.HighlightedBackColor = new Color(25, 118, 210);
|
||||||
|
|
||||||
|
let cancelItem = new UIMenuItem("Abbrechen", "");
|
||||||
|
cancelItem.BackColor = new Color(213, 0, 0);
|
||||||
|
cancelItem.HighlightedBackColor = new Color(229, 57, 53);
|
||||||
|
|
||||||
|
|
||||||
|
export default function rentCar(globalData: IGlobalData) {
|
||||||
|
|
||||||
|
var rentcarMenu: NativeUI.Menu;
|
||||||
|
var vehiclesToRent: RentcarProperty[] = [];
|
||||||
|
var vehicleNames: string[] = [];
|
||||||
|
var vehiclePrices: number[] = [];
|
||||||
|
var selectedIndex: number;
|
||||||
|
|
||||||
|
var payTimer;
|
||||||
|
var totalTime: number = 0;
|
||||||
|
var totalBill: number = 0;
|
||||||
|
|
||||||
|
mp.events.add('showRentcarMenu', (vehiclestring, rentcarLocation) => {
|
||||||
|
if (globalData.InMenu) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
globalData.InMenu = true;
|
||||||
|
|
||||||
|
vehiclesToRent = JSON.parse(vehiclestring);
|
||||||
|
|
||||||
|
vehicleNames = [];
|
||||||
|
vehiclePrices = [];
|
||||||
|
for (let entry of vehiclesToRent) {
|
||||||
|
vehicleNames.push(entry.Name);
|
||||||
|
vehiclePrices.push(entry.Price);
|
||||||
|
}
|
||||||
|
|
||||||
|
rentcarMenu = new Menu("Fahrzeugverleih", "", new Point(0, screenRes.y / 3), null, null);
|
||||||
|
rentcarMenu.AddItem(new UIMenuListItem("Fahrzeug", "$" + vehiclePrices[0] + " alle 3 Minuten", new ItemsCollection(vehicleNames)));
|
||||||
|
|
||||||
|
rentcarMenu.AddItem(sendItem);
|
||||||
|
rentcarMenu.AddItem(cancelItem);
|
||||||
|
rentcarMenu.Visible = true;
|
||||||
|
//outeText = "Route 1";
|
||||||
|
|
||||||
|
selectedIndex = 0;
|
||||||
|
|
||||||
|
rentcarMenu.ListChange.on((item: NativeUI.UIMenuListItem, index) => {
|
||||||
|
switch (item.Text) {
|
||||||
|
case "Fahrzeug":
|
||||||
|
item.Description = "$" + vehiclePrices[index] + " alle 3 Minuten";
|
||||||
|
selectedIndex = index;
|
||||||
|
//item.Description = item.SelectedValue;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
rentcarMenu.ItemSelect.on((item) => {
|
||||||
|
if (item.Text === "Mieten") {
|
||||||
|
mp.events.callRemote("SERVER:rentcarBooked", vehicleNames[selectedIndex], vehiclePrices[selectedIndex], rentcarLocation);
|
||||||
|
rentcarMenu.Close();
|
||||||
|
globalData.InMenu = false;
|
||||||
|
} else if (item.Text === "Abbrechen") {
|
||||||
|
rentcarMenu.Close();
|
||||||
|
globalData.InMenu = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
rentcarMenu.MenuClose.on(() => {
|
||||||
|
globalData.InMenu = false;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
mp.events.add('triggerRentcarTimer', (interval, pricePerInterval) => {
|
||||||
|
totalBill = pricePerInterval;
|
||||||
|
mp.events.callRemote("SERVER:updateRentCarBill", totalBill, totalTime);
|
||||||
|
clearInterval(payTimer);
|
||||||
|
|
||||||
|
payTimer = setInterval(() => {
|
||||||
|
totalTime += interval;
|
||||||
|
totalBill += pricePerInterval;
|
||||||
|
|
||||||
|
mp.events.callRemote("SERVER:updateRentCarBill", totalBill, totalTime);
|
||||||
|
}, interval * 1000);
|
||||||
|
});
|
||||||
|
|
||||||
|
mp.events.add('abortRentcarTimer', () => {
|
||||||
|
clearInterval(payTimer);
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import { isInAnyNoDMPolygon, listNoDMZones } from "../Player/nodm";
|
import { isInAnyNoDMPolygon, listNoDMZones } from "../Player/polygons";
|
||||||
import polygons from "../polygons";
|
import polygons from "../polygons";
|
||||||
import { getWantedCount } from "../Gui/wanteds";
|
import { getWantedCount } from "../Gui/wanteds";
|
||||||
import { spawnschutzEnabled } from "../Player/spawnschutz";
|
import { spawnschutzEnabled } from "../Player/spawnschutz";
|
||||||
@@ -18,7 +18,7 @@ function isTargetInPolygon(pos): boolean {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function weapondamageUtil() {
|
export default function weapondamageUtil(globalData: IGlobalData) {
|
||||||
let blockInput = false;
|
let blockInput = false;
|
||||||
|
|
||||||
mp.players.local.setSuffersCriticalHits(false);
|
mp.players.local.setSuffersCriticalHits(false);
|
||||||
@@ -32,12 +32,16 @@ export default function weapondamageUtil() {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (globalData.IsAfk == true && getWantedCount() === 0) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (spawnschutzEnabled && getWantedCount() === 0) {
|
if (spawnschutzEnabled && getWantedCount() === 0) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
mp.events.add('outgoingDamage', (sourceEntity, targetEntity, sourcePlayer, weapon, boneIndex, damage) => {
|
mp.events.add(RageEnums.EventKey.OUTGOING_DAMAGE, (sourceEntity, targetEntity, sourcePlayer, weapon, boneIndex, damage) => {
|
||||||
if (spawnschutzEnabled && getWantedCount() === 0) {
|
if (spawnschutzEnabled && getWantedCount() === 0) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ namespace ReallifeGamemode.Database.Entities
|
|||||||
public float Y { get; set; }
|
public float Y { get; set; }
|
||||||
public float Z { get; set; }
|
public float Z { get; set; }
|
||||||
public float Radius { get; set; }
|
public float Radius { get; set; }
|
||||||
|
public bool AlwaysOpen { get; set; }
|
||||||
|
|
||||||
[NotMapped]
|
[NotMapped]
|
||||||
public Vector3 Position => new Vector3(X, Y, Z);
|
public Vector3 Position => new Vector3(X, Y, Z);
|
||||||
|
|||||||
2180
ReallifeGamemode.Database/Migrations/20210429134927_AddDoorAlwaysOpenFlag.Designer.cs
generated
Normal file
2180
ReallifeGamemode.Database/Migrations/20210429134927_AddDoorAlwaysOpenFlag.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,23 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
namespace ReallifeGamemode.Database.Migrations
|
||||||
|
{
|
||||||
|
public partial class AddDoorAlwaysOpenFlag : Migration
|
||||||
|
{
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<bool>(
|
||||||
|
name: "AlwaysOpen",
|
||||||
|
table: "Doors",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: false);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "AlwaysOpen",
|
||||||
|
table: "Doors");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -398,6 +398,9 @@ namespace ReallifeGamemode.Database.Migrations
|
|||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
.HasColumnType("int");
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<bool>("AlwaysOpen")
|
||||||
|
.HasColumnType("tinyint(1)");
|
||||||
|
|
||||||
b.Property<string>("Category")
|
b.Property<string>("Category")
|
||||||
.HasColumnType("longtext CHARACTER SET utf8mb4");
|
.HasColumnType("longtext CHARACTER SET utf8mb4");
|
||||||
|
|
||||||
|
|||||||
@@ -150,6 +150,7 @@ namespace ReallifeGamemode.Server.Bank
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
player.SendNotification($"~w~Du hast {target.Name} $~g~{amount} ~w~Überwiesen.");
|
player.SendNotification($"~w~Du hast {target.Name} $~g~{amount} ~w~Überwiesen.");
|
||||||
|
target.SendNotification($"~w~{player.Name} hat dir $~g~{amount} ~w~Überwiesen.");
|
||||||
player.GetUser(dbContext).BankAccount.Balance -= (int)(amount * 1.05);
|
player.GetUser(dbContext).BankAccount.Balance -= (int)(amount * 1.05);
|
||||||
target.GetUser(dbContext).otheramount += amount;
|
target.GetUser(dbContext).otheramount += amount;
|
||||||
dbContext.SaveChanges();
|
dbContext.SaveChanges();
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
@@ -545,6 +545,29 @@ namespace ReallifeGamemode.Server.Commands
|
|||||||
|
|
||||||
#region Admin
|
#region Admin
|
||||||
|
|
||||||
|
[Command("remspawnschutz", "~m~Benutzung: ~s~/rmss [Target]", Alias = "rmss")]
|
||||||
|
public void CmdAdminRmss(Player player, String targetname)
|
||||||
|
{
|
||||||
|
if (!player.GetUser()?.IsAdmin(AdminLevel.ADMIN) ?? true)
|
||||||
|
{
|
||||||
|
ChatService.NotAuthorized(player);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Player target = PlayerService.GetPlayerByNameOrId(targetname);
|
||||||
|
|
||||||
|
if (target == null || !target.IsLoggedIn())
|
||||||
|
{
|
||||||
|
ChatService.PlayerNotFound(player);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
target.SendChatMessage(player.Name + " hat deinen Spawnschutz entfernt");
|
||||||
|
player.SendChatMessage("Du hast den Spawnschutz von " + target.Name + " entfernt");
|
||||||
|
target.TriggerEvent("abortSpawnschutz");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
[Command("countdown", "~m~Benutzung: ~s~/countdown [Zeit] [Text]", GreedyArg = true)]
|
[Command("countdown", "~m~Benutzung: ~s~/countdown [Zeit] [Text]", GreedyArg = true)]
|
||||||
public void CmdAdminCountdown(Player player, string timer_string, string text)
|
public void CmdAdminCountdown(Player player, string timer_string, string text)
|
||||||
{
|
{
|
||||||
@@ -614,7 +637,7 @@ namespace ReallifeGamemode.Server.Commands
|
|||||||
[Command("mark", "~m~Benutzung: ~s~/mark")]
|
[Command("mark", "~m~Benutzung: ~s~/mark")]
|
||||||
public void CmdAdminMark(Player player)
|
public void CmdAdminMark(Player player)
|
||||||
{
|
{
|
||||||
if (!player.GetUser()?.IsAdmin(AdminLevel.ADMIN) ?? true)
|
if (!player.GetUser()?.IsAdmin(AdminLevel.SUPPORTER) ?? true)
|
||||||
{
|
{
|
||||||
ChatService.NotAuthorized(player);
|
ChatService.NotAuthorized(player);
|
||||||
return;
|
return;
|
||||||
@@ -626,7 +649,7 @@ namespace ReallifeGamemode.Server.Commands
|
|||||||
[Command("gotomark", "~m~Benutzung: ~s~/gotomark")]
|
[Command("gotomark", "~m~Benutzung: ~s~/gotomark")]
|
||||||
public void CmdAdminGotoMark(Player player)
|
public void CmdAdminGotoMark(Player player)
|
||||||
{
|
{
|
||||||
if (!player.GetUser()?.IsAdmin(AdminLevel.ADMIN) ?? true)
|
if (!player.GetUser()?.IsAdmin(AdminLevel.SUPPORTER) ?? true)
|
||||||
{
|
{
|
||||||
ChatService.NotAuthorized(player);
|
ChatService.NotAuthorized(player);
|
||||||
return;
|
return;
|
||||||
@@ -1488,33 +1511,6 @@ namespace ReallifeGamemode.Server.Commands
|
|||||||
Medic.delReviveTask(target);
|
Medic.delReviveTask(target);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Command("aunshow", "~m~Benutzung:~s~ /aunshow")]
|
|
||||||
public void CmdAdminUnshow(Player player)
|
|
||||||
{
|
|
||||||
User user = player.GetUser();
|
|
||||||
if (!user.IsAdmin(AdminLevel.HEADADMIN))
|
|
||||||
{
|
|
||||||
ChatService.NotAuthorized(player);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool currentStatus = user.GetData<bool>("adminUnshow");
|
|
||||||
currentStatus = !currentStatus;
|
|
||||||
user.SetData("adminUnshow", currentStatus);
|
|
||||||
player.TriggerEvent("toggleAdminUnshowMode", currentStatus);
|
|
||||||
|
|
||||||
user.SetBlipAndNametagColor();
|
|
||||||
|
|
||||||
if(currentStatus)
|
|
||||||
{
|
|
||||||
ChatService.SendMessage(player, "~b~[ADMIN]~s~ Du bist nun Unshow");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ChatService.SendMessage(player, "~b~[ADMIN]~s~ Du bist nun nicht mehr Unshow");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[Command("setap", "~m~Benutzung: ~s~/setap [Spieler] (Armor)")]
|
[Command("setap", "~m~Benutzung: ~s~/setap [Spieler] (Armor)")]
|
||||||
public void CmdAdminSetAP(Player player, string name, int armor = 100)
|
public void CmdAdminSetAP(Player player, string name, int armor = 100)
|
||||||
{
|
{
|
||||||
@@ -1810,6 +1806,38 @@ namespace ReallifeGamemode.Server.Commands
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Command("aunshow", "~m~Benutzung:~s~ /aunshow")]
|
||||||
|
public void CmdAdminUnshow(Player player)
|
||||||
|
{
|
||||||
|
User user = player.GetUser();
|
||||||
|
if (!user.IsAdmin(AdminLevel.ADMIN))
|
||||||
|
{
|
||||||
|
ChatService.NotAuthorized(player);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!player.IsTSupport())
|
||||||
|
{
|
||||||
|
ChatService.ErrorMessage(player, "Du bist nicht im T-Support");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool currentStatus = user.GetData<bool>("adminUnshow");
|
||||||
|
currentStatus = !currentStatus;
|
||||||
|
user.SetData("adminUnshow", currentStatus);
|
||||||
|
player.TriggerEvent("toggleAdminUnshowMode", currentStatus);
|
||||||
|
|
||||||
|
user.SetBlipAndNametagColor();
|
||||||
|
|
||||||
|
if (currentStatus)
|
||||||
|
{
|
||||||
|
ChatService.SendMessage(player, "~b~[ADMIN]~s~ Du bist nun Unshow");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ChatService.SendMessage(player, "~b~[ADMIN]~s~ Du bist nun nicht mehr Unshow");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endregion Admin
|
#endregion Admin
|
||||||
|
|
||||||
@@ -3878,10 +3906,16 @@ namespace ReallifeGamemode.Server.Commands
|
|||||||
[RemoteEvent("Noclip")]
|
[RemoteEvent("Noclip")]
|
||||||
public void Noclip(Player player)
|
public void Noclip(Player player)
|
||||||
{
|
{
|
||||||
if (!player.GetUser()?.IsAdmin(AdminLevel.HEADADMIN) ?? true)
|
if (!player.GetUser()?.IsAdmin(AdminLevel.ADMIN) ?? true)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (!player.IsTSupport())
|
||||||
|
{
|
||||||
|
ChatService.ErrorMessage(player, "Du bist nicht im T-Support");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (player.HasData("Adminduty") && player.GetData<bool>("Adminduty"))
|
if (player.HasData("Adminduty") && player.GetData<bool>("Adminduty"))
|
||||||
player.TriggerEvent("ADMIN:NoClip");
|
player.TriggerEvent("ADMIN:NoClip");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
@@ -82,15 +82,15 @@ namespace ReallifeGamemode.Server.Commands
|
|||||||
|
|
||||||
message = Regex.Replace(message, "(~[a-zA-Z]~)|(!{(.*)})", "");
|
message = Regex.Replace(message, "(~[a-zA-Z]~)|(!{(.*)})", "");
|
||||||
|
|
||||||
string rank = string.Empty;
|
string factionName = string.Empty;
|
||||||
|
|
||||||
if (f?.GangOwned == true)
|
if (f?.GangOwned == true)
|
||||||
{
|
{
|
||||||
rank = user.FactionRank.RankName;
|
factionName = user.Faction.Name + " – " + user.FactionRank.RankName;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
rank = "[ADMIN]";
|
factionName = "ADMIN";
|
||||||
}
|
}
|
||||||
|
|
||||||
var logEntry = new GangChatLogEntry()
|
var logEntry = new GangChatLogEntry()
|
||||||
@@ -102,7 +102,7 @@ namespace ReallifeGamemode.Server.Commands
|
|||||||
dbContext.GangChatLogs.Add(logEntry);
|
dbContext.GangChatLogs.Add(logEntry);
|
||||||
dbContext.SaveChanges();
|
dbContext.SaveChanges();
|
||||||
|
|
||||||
string broadcastMessage = "!{FF0000}** " + rank + " " + player.Name + ": " + message + " **";
|
string broadcastMessage = "!{E52222}** [" + factionName + "] " + player.Name + ": " + message + " **";
|
||||||
using (var context = new DatabaseContext())
|
using (var context = new DatabaseContext())
|
||||||
{
|
{
|
||||||
ChatService.BroadcastFaction(broadcastMessage, context.Factions.ToList().FindAll(c => c.GangOwned), true, (admin) => admin.HasData("togga"));
|
ChatService.BroadcastFaction(broadcastMessage, context.Factions.ToList().FindAll(c => c.GangOwned), true, (admin) => admin.HasData("togga"));
|
||||||
@@ -166,11 +166,11 @@ namespace ReallifeGamemode.Server.Commands
|
|||||||
|
|
||||||
if (f?.StateOwned ?? false)
|
if (f?.StateOwned ?? false)
|
||||||
{
|
{
|
||||||
factionName = user.FactionRank.RankName;
|
factionName = user.Faction.Name + " – " + user.FactionRank.RankName;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
factionName = "[ADMIN]";
|
factionName = "ADMIN";
|
||||||
}
|
}
|
||||||
|
|
||||||
var logEntry = new DepartmentChatLogEntry()
|
var logEntry = new DepartmentChatLogEntry()
|
||||||
@@ -182,7 +182,7 @@ namespace ReallifeGamemode.Server.Commands
|
|||||||
dbContext.DepartmentChatLogs.Add(logEntry);
|
dbContext.DepartmentChatLogs.Add(logEntry);
|
||||||
dbContext.SaveChanges();
|
dbContext.SaveChanges();
|
||||||
|
|
||||||
string broadcastMessage = "!{CC3333}** " + factionName + " " + player.Name + ": " + message + ", over **";
|
string broadcastMessage = "!{CC3333}** [" + factionName + "] " + player.Name + ": " + message + ", over **";
|
||||||
using (var context = new DatabaseContext())
|
using (var context = new DatabaseContext())
|
||||||
{
|
{
|
||||||
ChatService.BroadcastFaction(broadcastMessage, context.Factions.ToList().FindAll(c => c.StateOwned), true, (admin) => admin.HasData("togd"));
|
ChatService.BroadcastFaction(broadcastMessage, context.Factions.ToList().FindAll(c => c.StateOwned), true, (admin) => admin.HasData("togd"));
|
||||||
@@ -402,10 +402,17 @@ namespace ReallifeGamemode.Server.Commands
|
|||||||
ChatService.ErrorMessage(player, "Der Spieler hat eine Revivesperre");
|
ChatService.ErrorMessage(player, "Der Spieler hat eine Revivesperre");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
using (var dbContext = new DatabaseContext())
|
using (var dbContext = new DatabaseContext())
|
||||||
{
|
{
|
||||||
var deadPlayerUser = deadPlayer.GetUser(dbContext);
|
var deadPlayerUser = deadPlayer.GetUser(dbContext);
|
||||||
|
|
||||||
|
if (deadPlayerUser.Wanteds > 0)
|
||||||
|
{
|
||||||
|
ChatService.ErrorMessage(player, "Dieser Spieler hat Wanteds");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (deadPlayerUser.Handmoney >= 100)
|
if (deadPlayerUser.Handmoney >= 100)
|
||||||
{
|
{
|
||||||
deadPlayerUser.Handmoney -= 100;
|
deadPlayerUser.Handmoney -= 100;
|
||||||
@@ -504,7 +511,7 @@ namespace ReallifeGamemode.Server.Commands
|
|||||||
|
|
||||||
#region Staatsfraktionen (LSPD / FBI) Commands
|
#region Staatsfraktionen (LSPD / FBI) Commands
|
||||||
|
|
||||||
[Command("m", "~m~Benutzung: ~s~/m [Message]", GreedyArg = true)]
|
[Command("m", "~m~Benutzung: ~s~/m [Nachricht]", GreedyArg = true)]
|
||||||
public void CmdFactionMegaphone(Player player, string message)
|
public void CmdFactionMegaphone(Player player, string message)
|
||||||
{
|
{
|
||||||
User user = player.GetUser();
|
User user = player.GetUser();
|
||||||
@@ -526,7 +533,7 @@ namespace ReallifeGamemode.Server.Commands
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ChatService.SendInRange(player.Position, 50, "!{#FFFF00}[" + player.GetUser().Faction.Name + " " + player.Name + ": !{#FFFF00}" + message + "]");
|
ChatService.SendInRange(player.Position, 50, "!{#FFFF00}Megafon (" + player.Name + "): " + message);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Command("cuff", "~m~Benutzung: ~s~/cuff")]
|
[Command("cuff", "~m~Benutzung: ~s~/cuff")]
|
||||||
|
|||||||
@@ -17,6 +17,79 @@ namespace ReallifeGamemode.Server.Commands
|
|||||||
{
|
{
|
||||||
internal class UserCommands : Script
|
internal class UserCommands : Script
|
||||||
{
|
{
|
||||||
|
[Command("rent", "~m~rent stop")]
|
||||||
|
public void CmdUserStopRent(Player player, String option = "") {
|
||||||
|
if (!player.IsLoggedIn()) return;
|
||||||
|
|
||||||
|
if (option != "stop")
|
||||||
|
{
|
||||||
|
player.SendChatMessage("Mit \"/rent stop\" kannst du die Miete kündigen");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!player.HasData("hasRentcar"))
|
||||||
|
{
|
||||||
|
ChatService.ErrorMessage(player, "Du hast zurzeit kein Fahrzeug gemietet");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Rentcar.cancelRent(player);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Command("eventport", "~m~eventport")]
|
||||||
|
public void CmdUserEventport(Player player, String option = "")
|
||||||
|
{
|
||||||
|
if (!player.IsLoggedIn()) return;
|
||||||
|
|
||||||
|
if (option == "on")
|
||||||
|
{
|
||||||
|
if (!player.GetUser()?.IsAdmin(AdminLevel.ADMIN) ?? true)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
PositionManager.eventportPosition = player.Position;
|
||||||
|
PositionManager.eventportActive = true;
|
||||||
|
player.SendChatMessage("~y~Du hast hier erfolgreich einen Eventport gesetzt.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (option == "off")
|
||||||
|
{
|
||||||
|
if (!player.GetUser()?.IsAdmin(AdminLevel.ADMIN) ?? true)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
PositionManager.eventportActive = false;
|
||||||
|
player.SendChatMessage("~y~Du hast den Eventport deaktiviert.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!PositionManager.eventportActive || PositionManager.eventportPosition == null)
|
||||||
|
{
|
||||||
|
player.SendChatMessage("~y~Im Moment ist kein Eventport aktiv.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
using (var dbContext = new DatabaseContext())
|
||||||
|
{
|
||||||
|
User user = player.GetUser(dbContext);
|
||||||
|
if (user.Wanteds > 0 || user.JailTime > 0 || player.HasData("inGangWar") || !player.IsAlive())
|
||||||
|
{
|
||||||
|
ChatService.ErrorMessage(player, "Momentan kannst du keinen Eventport nutzen");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Random rnd = new Random();
|
||||||
|
int randomX = rnd.Next(-3, 3);
|
||||||
|
int randomY = rnd.Next(-3, 3);
|
||||||
|
|
||||||
|
Vector3 teleportPosition = new Vector3(PositionManager.eventportPosition.X + randomX, PositionManager.eventportPosition.Y + randomY, PositionManager.eventportPosition.Z);
|
||||||
|
|
||||||
|
player.SafeTeleport(teleportPosition);
|
||||||
|
player.SendNotification("Du hast dich zum Event teleportiert");
|
||||||
|
}
|
||||||
|
|
||||||
[Command("look", "~m~look")]
|
[Command("look", "~m~look")]
|
||||||
public void CmdUserLook(Player player)
|
public void CmdUserLook(Player player)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ namespace ReallifeGamemode.Server.DrivingSchool
|
|||||||
new Vector3(-255.55, -1419.48, 32.75),
|
new Vector3(-255.55, -1419.48, 32.75),
|
||||||
new Vector3(-369.08, -1415.37, 29.68),
|
new Vector3(-369.08, -1415.37, 29.68),
|
||||||
new Vector3(-114.48, -1251.43, 37.59),
|
new Vector3(-114.48, -1251.43, 37.59),
|
||||||
new Vector3(59.22, -1261.71, 29.84),
|
new Vector3(70.312744, -1250.7972, 29.84),
|
||||||
new Vector3(39.12, -1165.28, 29.87),
|
new Vector3(39.12, -1165.28, 29.87),
|
||||||
new Vector3(-307.52, -1200.85, 37.79),
|
new Vector3(-307.52, -1200.85, 37.79),
|
||||||
new Vector3(-441.79, -1251.67, 46.37),
|
new Vector3(-441.79, -1251.67, 46.37),
|
||||||
|
|||||||
@@ -77,6 +77,13 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
player.TriggerEvent("CLIENT:AddPed", 2, "player_two", 1706.76953125, 3277.220947265625, 41.1555061340332, -159.447998046875, 0, false, true, 0, "none", true, true, true);//Ped_Pilot Sandyshores
|
player.TriggerEvent("CLIENT:AddPed", 2, "player_two", 1706.76953125, 3277.220947265625, 41.1555061340332, -159.447998046875, 0, false, true, 0, "none", true, true, true);//Ped_Pilot Sandyshores
|
||||||
player.TriggerEvent("CLIENT:AddPed", 3, "s_m_m_pilot_01", -1621.4542236328125, -3152.724365234375, 13.991769790649414, 50.73009490966797, 0, false, true, 0, "none", true, true, true);//Ped_Pilot LS Airport
|
player.TriggerEvent("CLIENT:AddPed", 3, "s_m_m_pilot_01", -1621.4542236328125, -3152.724365234375, 13.991769790649414, 50.73009490966797, 0, false, true, 0, "none", true, true, true);//Ped_Pilot LS Airport
|
||||||
player.TriggerEvent("CLIENT:AddPed", 4, "u_m_o_finguru_01", -534.4425659179688, -2145.747314453125, 5.992100715637207, 53.96156692504883, 0, false, true, 0, "none", true, true, true);//Ped Busfahrer
|
player.TriggerEvent("CLIENT:AddPed", 4, "u_m_o_finguru_01", -534.4425659179688, -2145.747314453125, 5.992100715637207, 53.96156692504883, 0, false, true, 0, "none", true, true, true);//Ped Busfahrer
|
||||||
|
player.TriggerEvent("CLIENT:AddPed", 5, "csb_prolsec", 1690.84, 2591.17 , 45.91, -2.66, 0, false, true, 0, "none", true, true, true);//Ped Knast
|
||||||
|
player.TriggerEvent("CLIENT:AddPed", 6, "ig_siemonyetarian", -1023.1589, -2693.6948, 13.98, 173.95613, 0, false, true, 0, "none", true, true, true);//Ped Rentcar NoobSpawn
|
||||||
|
player.TriggerEvent("CLIENT:AddPed", 7, "ig_siemonyetarian", -369.1589, -230.92816, 36.028805, 150.26433, 0, false, true, 0, "none", true, true, true);//Ped Rentcar KH/Stadthalle
|
||||||
|
player.TriggerEvent("CLIENT:AddPed", 8, "ig_siemonyetarian", 1222.0868, 2726.5286, 38.00415, 113.77263, 0, false, true, 0, "none", true, true, true);//Ped Rentcar Knast
|
||||||
|
player.TriggerEvent("CLIENT:AddPed", 9, "ig_siemonyetarian", -215.4218292236328, 6218.90478515625, 31.491567611694336, -135.07437133789062, 0, false, true, 0, "none", true, true, true);//Ped Rentcar Paleto
|
||||||
|
player.TriggerEvent("CLIENT:AddPed", 10, "ig_siemonyetarian", 818.239990234375, -1040.833984375, 26.750696182250977, 3.0542829036712646, 0, false, true, 0, "none", true, true, true);//Ped Rentcar Lamesa
|
||||||
|
|
||||||
TimeSpan currentTime = TimeManager.CurrentTime;
|
TimeSpan currentTime = TimeManager.CurrentTime;
|
||||||
bool disableLightMode = currentTime > LightModeTimeFrom && currentTime < LightModeTimeTo;
|
bool disableLightMode = currentTime > LightModeTimeFrom && currentTime < LightModeTimeTo;
|
||||||
|
|
||||||
|
|||||||
@@ -79,6 +79,7 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
|
|
||||||
var playerInGangwar = player.HasData("inGangWar");
|
var playerInGangwar = player.HasData("inGangWar");
|
||||||
var killerInGangwar = killer.HasData("inGangWar");
|
var killerInGangwar = killer.HasData("inGangWar");
|
||||||
|
|
||||||
NAPI.Util.ConsoleOutput($"OnPlayerDeath - Player {player.Name} died - PlayerInGangwar = {playerInGangwar}, KillerInGangwar = {killerInGangwar}");
|
NAPI.Util.ConsoleOutput($"OnPlayerDeath - Player {player.Name} died - PlayerInGangwar = {playerInGangwar}, KillerInGangwar = {killerInGangwar}");
|
||||||
if (playerInGangwar && killerInGangwar)
|
if (playerInGangwar && killerInGangwar)
|
||||||
{
|
{
|
||||||
@@ -148,7 +149,7 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
if (copNearby)
|
if (copNearby)
|
||||||
{
|
{
|
||||||
user.SetJailTime(true, dbContext);
|
user.SetJailTime(true, dbContext);
|
||||||
Jail.Check_PutBehindBars(user);
|
Jail.Check_PutBehindBars(user, JailInLocations.InCell);
|
||||||
ChatService.HQMessage(user.Name + " wurde ins Gefängnis eingeliefert.");
|
ChatService.HQMessage(user.Name + " wurde ins Gefängnis eingeliefert.");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -163,7 +164,7 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
{
|
{
|
||||||
user.Dead = true;
|
user.Dead = true;
|
||||||
|
|
||||||
if (!player.HasData("reviveSperre") && player.GetData<bool>("isDead") == false && !player.HasData("inGangWar") && player.GetData<bool>("SAdminduty") == false)
|
if (user.Wanteds == 0 && !player.HasData("reviveSperre") && player.GetData<bool>("isDead") == false && !player.HasData("inGangWar") && player.GetData<bool>("SAdminduty") == false)
|
||||||
{
|
{
|
||||||
//MEDIC AUFTRAG
|
//MEDIC AUFTRAG
|
||||||
MedicTask reviveTask = new MedicTask()
|
MedicTask reviveTask = new MedicTask()
|
||||||
|
|||||||
@@ -127,6 +127,11 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Rentcar.mapPlayerRentcarBill.ContainsKey(player.Name))
|
||||||
|
{
|
||||||
|
Rentcar.cancelRent(player);
|
||||||
|
}
|
||||||
|
|
||||||
//Vehicle LastVehicle = player.GetData<Vehicle>("LastVehicle");
|
//Vehicle LastVehicle = player.GetData<Vehicle>("LastVehicle");
|
||||||
JobBase job = JobManager.GetJob(player.GetUser().JobId ?? -1);
|
JobBase job = JobManager.GetJob(player.GetUser().JobId ?? -1);
|
||||||
if (job != null)
|
if (job != null)
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using GTANetworkAPI;
|
using GTANetworkAPI;
|
||||||
@@ -34,7 +35,7 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
[RemoteEvent("keyPress:NUM2")]
|
[RemoteEvent("keyPress:NUM2")]
|
||||||
public void KeyPressNUM2(Player player)
|
public void KeyPressNUM2(Player player)
|
||||||
{
|
{
|
||||||
if (!player.IsLoggedIn()) return;
|
if (!player.IsLoggedIn() || player.GetData<bool>("isDead")) return;
|
||||||
if (player.GetData<bool>("editmode") == true && player.GetUser().IsAdmin(AdminLevel.HEADADMIN) == true)
|
if (player.GetData<bool>("editmode") == true && player.GetUser().IsAdmin(AdminLevel.HEADADMIN) == true)
|
||||||
{
|
{
|
||||||
var saveMode = player.GetData<string>("quicksavemode");
|
var saveMode = player.GetData<string>("quicksavemode");
|
||||||
@@ -91,7 +92,7 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
[RemoteEvent("keyPress:RIGHT_ARROW")]
|
[RemoteEvent("keyPress:RIGHT_ARROW")]
|
||||||
public void KeyPressRightArrow(Player player)
|
public void KeyPressRightArrow(Player player)
|
||||||
{
|
{
|
||||||
if (!player.IsLoggedIn()) return;
|
if (!player.IsLoggedIn() || player.GetData<bool>("isDead")) return;
|
||||||
User user = player.GetUser();
|
User user = player.GetUser();
|
||||||
|
|
||||||
if (!player.IsDuty())
|
if (!player.IsDuty())
|
||||||
@@ -116,10 +117,10 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
[RemoteEvent("keyPress:M")]
|
[RemoteEvent("keyPress:M")]
|
||||||
public void KeyPressM(Player player)
|
public void KeyPressM(Player player)
|
||||||
{
|
{
|
||||||
|
if (!player.IsLoggedIn()) return;
|
||||||
using var dbContext = new DatabaseContext();
|
using var dbContext = new DatabaseContext();
|
||||||
User u = player.GetUser(dbContext);
|
User u = player.GetUser(dbContext);
|
||||||
if (u == null) return;
|
if (u == null) return;
|
||||||
if (player.GetData<bool>("isDead")) return;
|
|
||||||
|
|
||||||
var vehicles = dbContext.UserVehicles.Where(veh => veh.UserId == u.Id).OrderBy(veh => veh.Id).Select(v => new
|
var vehicles = dbContext.UserVehicles.Where(veh => veh.UserId == u.Id).OrderBy(veh => veh.Id).Select(v => new
|
||||||
{
|
{
|
||||||
@@ -135,7 +136,6 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
Price = f.BuyPrice
|
Price = f.BuyPrice
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
Paycheck paycheck = null;
|
Paycheck paycheck = null;
|
||||||
if (Economy.Paychecks.ContainsKey(u.Id)) paycheck = Economy.Paychecks[u.Id];
|
if (Economy.Paychecks.ContainsKey(u.Id)) paycheck = Economy.Paychecks[u.Id];
|
||||||
|
|
||||||
@@ -189,6 +189,7 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
int ticket_amount = 0;
|
int ticket_amount = 0;
|
||||||
int pay_amount = 0;
|
int pay_amount = 0;
|
||||||
bool house = false;
|
bool house = false;
|
||||||
|
bool hasRentcar = player.GetData<bool>("hasRentcar") == true;
|
||||||
|
|
||||||
if (u.House != null)
|
if (u.House != null)
|
||||||
{
|
{
|
||||||
@@ -204,13 +205,14 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
{
|
{
|
||||||
pay_amount = player.GetData<int>("pay_amount");
|
pay_amount = player.GetData<int>("pay_amount");
|
||||||
}
|
}
|
||||||
player.TriggerEvent("SERVER:InteractionMenu_OpenMenu", JsonConvert.SerializeObject(accountData), factionleader, JsonConvert.SerializeObject(memberList), JsonConvert.SerializeObject(jobData), faction, group, factionInvite, groupInvite, ticket_boolean, ticket_amount, pay_amount, house);
|
|
||||||
|
player.TriggerEvent("SERVER:InteractionMenu_OpenMenu", JsonConvert.SerializeObject(accountData), factionleader, JsonConvert.SerializeObject(memberList), JsonConvert.SerializeObject(jobData), faction, group, factionInvite, groupInvite, ticket_boolean, ticket_amount, pay_amount, JsonConvert.SerializeObject(hasRentcar), house);
|
||||||
}
|
}
|
||||||
|
|
||||||
[RemoteEvent("keyPress:E")]
|
[RemoteEvent("keyPress:E")]
|
||||||
public void KeyPressE(Player player)
|
public void KeyPressE(Player player)
|
||||||
{
|
{
|
||||||
if (!player.IsLoggedIn()) return;
|
if (!player.IsLoggedIn() || player.GetData<bool>("isDead") || player.IsInVehicle) return;
|
||||||
var user = player.GetUser();
|
var user = player.GetUser();
|
||||||
|
|
||||||
if (player.HasData("nearATM"))
|
if (player.HasData("nearATM"))
|
||||||
@@ -219,13 +221,10 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!player.IsInVehicle)
|
|
||||||
{
|
|
||||||
if (GroundItem.PickUpGroundItem(player))
|
if (GroundItem.PickUpGroundItem(player))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
DutyPoint nearestDuty = PositionManager.DutyPoints.Find(d => d.Position.DistanceTo(player.Position) <= 1.5 && d.FactionId == user.FactionId);
|
DutyPoint nearestDuty = PositionManager.DutyPoints.Find(d => d.Position.DistanceTo(player.Position) <= 1.5 && d.FactionId == user.FactionId);
|
||||||
WeaponPoint nearestWeapon = PositionManager.WeaponPoints.Find(w => w.Position.DistanceTo(player.Position) <= 1.5 && w.FactionId == user.FactionId);
|
WeaponPoint nearestWeapon = PositionManager.WeaponPoints.Find(w => w.Position.DistanceTo(player.Position) <= 1.5 && w.FactionId == user.FactionId);
|
||||||
@@ -237,6 +236,7 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
JobPoint nearestJobPoint = PositionManager.JobPoints.Find(s => s.Position.DistanceTo(player.Position) <= 1.6);
|
JobPoint nearestJobPoint = PositionManager.JobPoints.Find(s => s.Position.DistanceTo(player.Position) <= 1.6);
|
||||||
Player nearestCuffPlayer = PositionManager.cuffPoints.Find(s => s.Position.DistanceTo(player.Position) <= 1.6 && user.GetData<bool>("duty"));
|
Player nearestCuffPlayer = PositionManager.cuffPoints.Find(s => s.Position.DistanceTo(player.Position) <= 1.6 && user.GetData<bool>("duty"));
|
||||||
AmmunationPoint nearestAmmunationPoint = PositionManager.AmmunationPoints.Find(s => s.Position.DistanceTo(player.Position) <= 1.5);
|
AmmunationPoint nearestAmmunationPoint = PositionManager.AmmunationPoints.Find(s => s.Position.DistanceTo(player.Position) <= 1.5);
|
||||||
|
RentcarPoint nearestRentcarPoint = PositionManager.rentcarPoints.Find(s => s.Position.DistanceTo(player.Position) <= 1.5);
|
||||||
|
|
||||||
if (user?.FactionId != null)
|
if (user?.FactionId != null)
|
||||||
{
|
{
|
||||||
@@ -355,6 +355,41 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
user.SetBlipAndNametagColor();
|
user.SetBlipAndNametagColor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Rentcar Points
|
||||||
|
if (nearestRentcarPoint != null)
|
||||||
|
{
|
||||||
|
if (player.IsInVehicle)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Noobspawn
|
||||||
|
if (player.Position.DistanceTo(PositionManager.rentcarPoints[0].Position) <= 1.5)
|
||||||
|
{
|
||||||
|
player.TriggerEvent("showRentcarMenu", JsonConvert.SerializeObject(Rentcar.noobspawnVehicleProperties), "noobspawn");
|
||||||
|
}
|
||||||
|
//Stadthalle
|
||||||
|
else if (player.Position.DistanceTo(PositionManager.rentcarPoints[1].Position) <= 1.5)
|
||||||
|
{
|
||||||
|
player.TriggerEvent("showRentcarMenu", JsonConvert.SerializeObject(Rentcar.stadthalleVehicleProperties), "stadthalle");
|
||||||
|
}
|
||||||
|
//Knast
|
||||||
|
else if (player.Position.DistanceTo(PositionManager.rentcarPoints[2].Position) <= 1.5)
|
||||||
|
{
|
||||||
|
player.TriggerEvent("showRentcarMenu", JsonConvert.SerializeObject(Rentcar.knastVehicleProperties), "knast");
|
||||||
|
}
|
||||||
|
//Paleto
|
||||||
|
else if (player.Position.DistanceTo(PositionManager.rentcarPoints[3].Position) <= 1.5)
|
||||||
|
{
|
||||||
|
player.TriggerEvent("showRentcarMenu", JsonConvert.SerializeObject(Rentcar.paletoVehicleProperties), "paleto");
|
||||||
|
}
|
||||||
|
//Lamesa
|
||||||
|
else if (player.Position.DistanceTo(PositionManager.rentcarPoints[4].Position) <= 1.5)
|
||||||
|
{
|
||||||
|
player.TriggerEvent("showRentcarMenu", JsonConvert.SerializeObject(Rentcar.paletoVehicleProperties), "lamesa");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (nearestWeapon != null) // Weapon Point
|
if (nearestWeapon != null) // Weapon Point
|
||||||
{
|
{
|
||||||
List<string> primarys = new List<string>();
|
List<string> primarys = new List<string>();
|
||||||
@@ -466,9 +501,7 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
player.TriggerEvent("showWeaponMenu", primarys.ToArray(), secondarys.ToArray(), melees.ToArray(), specials.ToArray(), armor.ToArray(), JsonConvert.SerializeObject(timer.ToArray()), JsonConvert.SerializeObject(amountInfos));
|
player.TriggerEvent("showWeaponMenu", primarys.ToArray(), secondarys.ToArray(), melees.ToArray(), specials.ToArray(), armor.ToArray(), JsonConvert.SerializeObject(timer.ToArray()), JsonConvert.SerializeObject(amountInfos));
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (nearestJailReleasePoint != null)
|
if (nearestJailReleasePoint != null)
|
||||||
@@ -558,7 +591,8 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
ChatService.ErrorMessage(player, "Du benötigst $15.000 auf dem Bankkonto um die Operation durchzuführen");
|
ChatService.ErrorMessage(player, "Du benötigst $15.000 auf dem Bankkonto um die Operation durchzuführen");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ChatService.SendMessage(player, "~r~ACHTUNG! Dadurch wird dein alter Charakter gelöscht. Du kannst dir hiermit einen neuen erstellen.\nBeim Wechsel des Geschlechts verlierst du ebenfalls deine gekaufte Kleidung");
|
ChatService.SendMessage(player, "~r~ACHTUNG! Dadurch wird dein alter Charakter gelöscht. Du kannst dir hiermit einen neuen erstellen.");
|
||||||
|
ChatService.SendMessage(player, "Beim Wechsel des Geschlechts verlierst du ebenfalls deine gekaufte Kleidung");
|
||||||
if (freeSurgery == true)
|
if (freeSurgery == true)
|
||||||
{
|
{
|
||||||
ChatService.SendMessage(player, "Du kannst deinen Charakter dieses mal kostenlos erstellen");
|
ChatService.SendMessage(player, "Du kannst deinen Charakter dieses mal kostenlos erstellen");
|
||||||
@@ -567,8 +601,15 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
{
|
{
|
||||||
ChatService.SendMessage(player, "Die Änderung des Charakters kostet ~g~$15.000");
|
ChatService.SendMessage(player, "Die Änderung des Charakters kostet ~g~$15.000");
|
||||||
}
|
}
|
||||||
ChatService.SendMessage(player, "Du kannst die Charaktererstellung wieder verlassen und behältst deinen alten Charakter! Bitte starte mit ~g~J");
|
ChatService.SendMessage(player, "Du kannst die Charaktererstellung wieder verlassen und behältst deinen alten Charakter!");
|
||||||
|
ChatService.SendMessage(player, "Bitte starte mit ~g~J");
|
||||||
|
|
||||||
player.SetData<bool>("charSurgery", true);
|
player.SetData<bool>("charSurgery", true);
|
||||||
|
NAPI.Task.Run(() =>
|
||||||
|
{
|
||||||
|
if (player.GetData<bool>("charSurgery") == true) player.ResetData("charSurgery");
|
||||||
|
player.SendNotification("~r~Chirurg-Angebot abgebrochen.");
|
||||||
|
}, 30000);
|
||||||
}
|
}
|
||||||
if (user.FactionLeader)
|
if (user.FactionLeader)
|
||||||
{
|
{
|
||||||
@@ -628,7 +669,7 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
[RemoteEvent("keyPress:I")]
|
[RemoteEvent("keyPress:I")]
|
||||||
public void KeyPressI(Player player)
|
public void KeyPressI(Player player)
|
||||||
{
|
{
|
||||||
if (!player.IsLoggedIn()) return;
|
if (!player.IsLoggedIn() || player.GetData<bool>("isDead")) return;
|
||||||
if (player.GetData<bool>("isDead")) return;
|
if (player.GetData<bool>("isDead")) return;
|
||||||
|
|
||||||
player.TriggerEvent("inventoryShow");
|
player.TriggerEvent("inventoryShow");
|
||||||
@@ -638,7 +679,7 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
[RemoteEvent("keyPress:J")]
|
[RemoteEvent("keyPress:J")]
|
||||||
public void KeyPressJ(Player player)
|
public void KeyPressJ(Player player)
|
||||||
{
|
{
|
||||||
if (!player.IsLoggedIn()) return;
|
if (!player.IsLoggedIn() || player.GetData<bool>("isDead")) return;
|
||||||
if (player.GetData<bool>("healDecision") == true)
|
if (player.GetData<bool>("healDecision") == true)
|
||||||
{
|
{
|
||||||
player.ResetData("healDecision");
|
player.ResetData("healDecision");
|
||||||
@@ -657,7 +698,7 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
if(player.GetData<bool>("charSurgery") == true)
|
if(player.GetData<bool>("charSurgery") == true)
|
||||||
{
|
{
|
||||||
CharacterCreator.StartSurgery(player);
|
CharacterCreator.StartSurgery(player);
|
||||||
player.ResetData("charSurgery");
|
player.SetData("charSurgery",false);
|
||||||
}
|
}
|
||||||
|
|
||||||
User u = player.GetUser();
|
User u = player.GetUser();
|
||||||
@@ -740,7 +781,7 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
[RemoteEvent("keyPress:K")]
|
[RemoteEvent("keyPress:K")]
|
||||||
public void KeyPressK(Player player)
|
public void KeyPressK(Player player)
|
||||||
{
|
{
|
||||||
if (!player.IsLoggedIn()) return;
|
if (!player.IsLoggedIn() || player.GetData<bool>("isDead")) return;
|
||||||
var user = player.GetUser();
|
var user = player.GetUser();
|
||||||
if (user == null)
|
if (user == null)
|
||||||
{
|
{
|
||||||
@@ -800,14 +841,14 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
[RemoteEvent("keyPress:L")]
|
[RemoteEvent("keyPress:L")]
|
||||||
public void KeyPressL(Player player)
|
public void KeyPressL(Player player)
|
||||||
{
|
{
|
||||||
if (!player.IsLoggedIn()) return;
|
if (!player.IsLoggedIn() || player.GetData<bool>("isDead")) return;
|
||||||
DoorManager.ChangeDoorState(player);
|
DoorManager.ChangeDoorState(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
[RemoteEvent("keyPress:N")]
|
[RemoteEvent("keyPress:N")]
|
||||||
public void KeyPressN(Player player)
|
public void KeyPressN(Player player)
|
||||||
{
|
{
|
||||||
if (!player.IsLoggedIn()) return;
|
if (!player.IsLoggedIn() || player.GetData<bool>("isDead")) return;
|
||||||
|
|
||||||
if (player.GetData<bool>("healDecision") == true)
|
if (player.GetData<bool>("healDecision") == true)
|
||||||
{
|
{
|
||||||
@@ -898,10 +939,10 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
VehicleStreaming.SetEngineState(v, !state);
|
VehicleStreaming.SetEngineState(v, !state);
|
||||||
}
|
}
|
||||||
|
|
||||||
[RemoteEvent("keyPress:X")]
|
[RemoteEvent("keyPress:Z")]
|
||||||
public void KeyPressX(Player player)
|
public void KeyPressX(Player player)
|
||||||
{
|
{
|
||||||
if (!player.IsLoggedIn()) return;
|
if (!player.IsLoggedIn() || player.GetData<bool>("isDead")) return;
|
||||||
|
|
||||||
if (!player.IsInVehicle)
|
if (!player.IsInVehicle)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using GTANetworkAPI;
|
using GTANetworkAPI;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
@@ -82,6 +82,7 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
player.SetData("Adminduty", false);
|
player.SetData("Adminduty", false);
|
||||||
player.TriggerEvent("SERVER:SET_HANDMONEY", user.Handmoney, 0);
|
player.TriggerEvent("SERVER:SET_HANDMONEY", user.Handmoney, 0);
|
||||||
player.TriggerEvent("headshotoff");
|
player.TriggerEvent("headshotoff");
|
||||||
|
player.SetData("togdeath", true);
|
||||||
Gangwar.Gangwar.loadPlayer(player);
|
Gangwar.Gangwar.loadPlayer(player);
|
||||||
if (user.FactionLeader)
|
if (user.FactionLeader)
|
||||||
{
|
{
|
||||||
@@ -164,7 +165,7 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Jail.Check_PutBehindBars(user);
|
Jail.Check_PutBehindBars(user, JailInLocations.InCell);
|
||||||
}
|
}
|
||||||
|
|
||||||
player.Dimension = 0;
|
player.Dimension = 0;
|
||||||
@@ -183,6 +184,9 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
player.TriggerEvent("loadInventoryCEF");
|
||||||
|
player.TriggerEvent("loadPlayerListCEF");
|
||||||
|
|
||||||
player.TriggerEvent("draw", player.Name, player.Handle.Value);
|
player.TriggerEvent("draw", player.Name, player.Handle.Value);
|
||||||
NAPI.Task.Run(() =>
|
NAPI.Task.Run(() =>
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -186,6 +186,11 @@ namespace ReallifeGamemode.Server.Extensions
|
|||||||
return player.HasData("Adminduty") ? player.GetData<bool>("Adminduty") : false;
|
return player.HasData("Adminduty") ? player.GetData<bool>("Adminduty") : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static bool IsTSupport(this Player player)
|
||||||
|
{
|
||||||
|
return player.HasData("SAdminduty") ? player.GetData<bool>("SAdminduty") : false;
|
||||||
|
}
|
||||||
|
|
||||||
public static Vector3 GetPositionFromPlayer(Player player, float distance, int offset = 0)
|
public static Vector3 GetPositionFromPlayer(Player player, float distance, int offset = 0)
|
||||||
{
|
{
|
||||||
var pos = player.Position;
|
var pos = player.Position;
|
||||||
@@ -224,8 +229,7 @@ namespace ReallifeGamemode.Server.Extensions
|
|||||||
dbUser.SetBlipAndNametagColor();
|
dbUser.SetBlipAndNametagColor();
|
||||||
dbContext.SaveChanges();
|
dbContext.SaveChanges();
|
||||||
}
|
}
|
||||||
ChatService.SendMessage(user.Player, "!{#FF614A}Du hast ein Verbrechen begangen: " + reason + "" + (cop != null ? " | Gemeldet von: " + cop.Name + "." : ""));
|
user.Player.TriggerEvent("BN_ShowWithPicture", "Straftat", cop != null ? "Officer " + cop.Name + "" : "LSPD", "Du hast ein Verbrechen begangen: " + reason + " (" + newWanteds + ")", "DIA_POLICE", 1, true, 6);
|
||||||
ChatService.SendMessage(user.Player, " !{#FFFF00}Fahndungslevel:~s~ " + newWanteds);
|
|
||||||
|
|
||||||
foreach (var copPlayer in NAPI.Pools.GetAllPlayers())
|
foreach (var copPlayer in NAPI.Pools.GetAllPlayers())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -200,7 +200,7 @@ namespace ReallifeGamemode.Server.Finance
|
|||||||
|
|
||||||
if (putInJail != 0 && minusJail)
|
if (putInJail != 0 && minusJail)
|
||||||
{
|
{
|
||||||
Jail.Check_PutBehindBars(u);
|
Jail.Check_PutBehindBars(u, JailInLocations.InCell);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using GTANetworkAPI;
|
using GTANetworkAPI;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
@@ -13,6 +13,7 @@ namespace ReallifeGamemode.Server.Gangwar
|
|||||||
{
|
{
|
||||||
public static Turf[] _loadedTurfs;
|
public static Turf[] _loadedTurfs;
|
||||||
private static List<Turfs> turfs;
|
private static List<Turfs> turfs;
|
||||||
|
public const int GANGWAR_TOTAL_TIME = 900;
|
||||||
|
|
||||||
public static void loadTurfs()
|
public static void loadTurfs()
|
||||||
{
|
{
|
||||||
@@ -57,6 +58,7 @@ namespace ReallifeGamemode.Server.Gangwar
|
|||||||
if (killerInsideTurf && victimInsideTurf)
|
if (killerInsideTurf && victimInsideTurf)
|
||||||
{
|
{
|
||||||
NAPI.Util.ConsoleOutput($"GangwarKill - Victim {victim.Name} - Killer and Victim are in Turf area");
|
NAPI.Util.ConsoleOutput($"GangwarKill - Victim {victim.Name} - Killer and Victim are in Turf area");
|
||||||
|
killer.TriggerEvent("gangWarKillNotification", victim.Name);
|
||||||
foreach (var turf in getTurfs())
|
foreach (var turf in getTurfs())
|
||||||
{
|
{
|
||||||
if (turf.getId() == victim.GetData<int>("inGangWar"))
|
if (turf.getId() == victim.GetData<int>("inGangWar"))
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@@ -142,7 +142,7 @@ namespace ReallifeGamemode.Server.Gangwar
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
gangwarPlayer.TriggerEvent("GangwarScore", this.Attacker, this.Owner, this.Att_Score, this.Def_Score, 900 - timerCount);
|
gangwarPlayer.TriggerEvent("GangwarScore", this.Attacker, this.Owner, this.Att_Score, this.Def_Score, Gangwar.GANGWAR_TOTAL_TIME - timerCount);
|
||||||
}
|
}
|
||||||
/*if (this.Att_Score >= 200)
|
/*if (this.Att_Score >= 200)
|
||||||
{
|
{
|
||||||
@@ -153,7 +153,7 @@ namespace ReallifeGamemode.Server.Gangwar
|
|||||||
this.takeOver(this.Owner);
|
this.takeOver(this.Owner);
|
||||||
}*/
|
}*/
|
||||||
timerCount += 1;
|
timerCount += 1;
|
||||||
if (timerCount >= 900) //change to 900 (seconds) before release for testing reasons change to whatever you like
|
if (timerCount >= Gangwar.GANGWAR_TOTAL_TIME)
|
||||||
{
|
{
|
||||||
if (this.Att_Score > this.Def_Score)
|
if (this.Att_Score > this.Def_Score)
|
||||||
{
|
{
|
||||||
@@ -259,10 +259,13 @@ namespace ReallifeGamemode.Server.Gangwar
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string takeOverMessage = string.Empty;
|
||||||
|
|
||||||
if (getOwner() == FactionName)
|
if (getOwner() == FactionName)
|
||||||
{
|
{
|
||||||
ChatService.BroadcastFaction("~y~[GANGWAR] ~w~Deine Fraktion hat erfolgreich das Gebiet ~g~" + getName() + "~w~ verteidigt.", ownerFaction);
|
takeOverMessage = $"~y~[GANGWAR] ~w~Die {getOwner()} konnten ihr Gebiet ~g~{getName()} ~w~ erfolgreich gegen die {getAttacker()} verteidigen.";
|
||||||
ChatService.BroadcastFaction("~y~[GANGWAR] ~w~Deine Fraktion hat den Angrif auf das Gebiet ~r~" + getName() + "~w~ verloren.", attackerFaction);
|
//ChatService.BroadcastFaction("~y~[GANGWAR] ~w~Deine Fraktion hat erfolgreich das Gebiet ~g~" + getName() + "~w~ verteidigt.", ownerFaction);
|
||||||
|
//ChatService.BroadcastFaction("~y~[GANGWAR] ~w~Deine Fraktion hat den Angrif auf das Gebiet ~r~" + getName() + "~w~ verloren.", attackerFaction);
|
||||||
|
|
||||||
foreach (var o in owners)
|
foreach (var o in owners)
|
||||||
{
|
{
|
||||||
@@ -276,8 +279,9 @@ namespace ReallifeGamemode.Server.Gangwar
|
|||||||
}
|
}
|
||||||
else if (getOwner() != FactionName)
|
else if (getOwner() != FactionName)
|
||||||
{
|
{
|
||||||
ChatService.BroadcastFaction("~y~[GANGWAR] ~w~Deine Fraktion konnte das Gebiet ~r~" + getName() + "~w~ nicht verteidigen.", ownerFaction);
|
takeOverMessage = $"~y~[GANGWAR] ~w~Die {getAttacker()} konnten das Gebiet ~g~{getName()} ~w~ der {getOwner()} erfolgreich erobern.";
|
||||||
ChatService.BroadcastFaction("~y~[GANGWAR] ~w~Deine Fraktion konnte erfolgreich das Gebiet ~g~" + getName() + "~w~ erobern.", attackerFaction);
|
//ChatService.BroadcastFaction("~y~[GANGWAR] ~w~Deine Fraktion konnte das Gebiet ~r~" + getName() + "~w~ nicht verteidigen.", ownerFaction);
|
||||||
|
//ChatService.BroadcastFaction("~y~[GANGWAR] ~w~Deine Fraktion konnte erfolgreich das Gebiet ~g~" + getName() + "~w~ erobern.", attackerFaction);
|
||||||
foreach (var o in owners)
|
foreach (var o in owners)
|
||||||
{
|
{
|
||||||
if (o != null)
|
if (o != null)
|
||||||
@@ -294,6 +298,7 @@ namespace ReallifeGamemode.Server.Gangwar
|
|||||||
turf.Owner = this.Owner;
|
turf.Owner = this.Owner;
|
||||||
turf.FactionId = attackerFaction.Id;
|
turf.FactionId = attackerFaction.Id;
|
||||||
}
|
}
|
||||||
|
ChatService.Broadcast(takeOverMessage);
|
||||||
dbContext.SaveChanges();
|
dbContext.SaveChanges();
|
||||||
}
|
}
|
||||||
this.Attacker = null;
|
this.Attacker = null;
|
||||||
@@ -307,6 +312,7 @@ namespace ReallifeGamemode.Server.Gangwar
|
|||||||
c.TriggerEvent("CLIENT:setAttackBlip", false, TurfID);
|
c.TriggerEvent("CLIENT:setAttackBlip", false, TurfID);
|
||||||
c.ResetData("inGangWar");
|
c.ResetData("inGangWar");
|
||||||
c.ResetData("GotInsideOfTurf");
|
c.ResetData("GotInsideOfTurf");
|
||||||
|
c.TriggerEvent("resetKillcounter");
|
||||||
}
|
}
|
||||||
this.playerInGangwar = null;
|
this.playerInGangwar = null;
|
||||||
this.status = "conquered";
|
this.status = "conquered";
|
||||||
@@ -358,9 +364,11 @@ namespace ReallifeGamemode.Server.Gangwar
|
|||||||
u.TriggerEvent("CLIENT:setAttackBlip", true, TurfID);
|
u.TriggerEvent("CLIENT:setAttackBlip", true, TurfID);
|
||||||
u.TriggerEvent("GangwarScore", this.Attacker, this.Owner, this.Att_Score, this.Def_Score);
|
u.TriggerEvent("GangwarScore", this.Attacker, this.Owner, this.Att_Score, this.Def_Score);
|
||||||
u.SetData("inGangWar", getId());
|
u.SetData("inGangWar", getId());
|
||||||
ChatService.SendMessage(u, "~y~[GANGWAR]~w~ Die " + getAttacker() + " haben das Gebiet ~y~" + TurfName + "~w~ der " + getOwner() + " angegriffen.");
|
|
||||||
clientsInGangwar.Add(u);
|
clientsInGangwar.Add(u);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ChatService.Broadcast("~y~[GANGWAR]~w~ Die " + getAttacker() + " haben das Gebiet ~y~" + TurfName + "~w~ der " + getOwner() + " angegriffen.");
|
||||||
|
|
||||||
playerInGangwar = clientsInGangwar.ToArray();
|
playerInGangwar = clientsInGangwar.ToArray();
|
||||||
NAPI.ClientEvent.TriggerClientEventForAll("CLIENT:Turf_Update", JsonConvert.SerializeObject(this.TurfID), JsonConvert.SerializeObject(this.status), JsonConvert.SerializeObject(this.Owner), JsonConvert.SerializeObject(this.Attacker));
|
NAPI.ClientEvent.TriggerClientEventForAll("CLIENT:Turf_Update", JsonConvert.SerializeObject(this.TurfID), JsonConvert.SerializeObject(this.status), JsonConvert.SerializeObject(this.Owner), JsonConvert.SerializeObject(this.Attacker));
|
||||||
this.TurfTick();
|
this.TurfTick();
|
||||||
|
|||||||
@@ -24,8 +24,8 @@ namespace ReallifeGamemode.Server.Job
|
|||||||
public const string INTERMEDIATE = "Fortgeschrittener";
|
public const string INTERMEDIATE = "Fortgeschrittener";
|
||||||
public const string PROFESSIONAL = "Profi";
|
public const string PROFESSIONAL = "Profi";
|
||||||
|
|
||||||
public const int WAGE_BEGINNER = 300;
|
public const int WAGE_BEGINNER = 350;
|
||||||
public const int WAGE_INTERMEDIATE = 900;
|
public const int WAGE_INTERMEDIATE = 950;
|
||||||
|
|
||||||
public const uint VEHICLE_BEGINNER = (uint)VehicleHash.Cuban800;
|
public const uint VEHICLE_BEGINNER = (uint)VehicleHash.Cuban800;
|
||||||
public const uint VEHICLE_INTERMEDIATE = (uint)VehicleHash.Velum2;
|
public const uint VEHICLE_INTERMEDIATE = (uint)VehicleHash.Velum2;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using GTANetworkAPI;
|
using GTANetworkAPI;
|
||||||
@@ -21,7 +21,7 @@ namespace ReallifeGamemode.Server.Job
|
|||||||
public override bool NeedVehicleToStart => false;
|
public override bool NeedVehicleToStart => false;
|
||||||
|
|
||||||
private const int MAX_BAG = 40;
|
private const int MAX_BAG = 40;
|
||||||
private const int WAGE = 80;
|
private const int WAGE = 50;
|
||||||
private const int BONUS = 10;
|
private const int BONUS = 10;
|
||||||
|
|
||||||
public RefuseCollectorJob()
|
public RefuseCollectorJob()
|
||||||
@@ -273,8 +273,8 @@ namespace ReallifeGamemode.Server.Job
|
|||||||
{
|
{
|
||||||
if (target != null)
|
if (target != null)
|
||||||
{
|
{
|
||||||
user1.Wage += WAGE / 2;
|
user1.Wage += (int)(WAGE * 0.7);
|
||||||
user2.Wage += WAGE / 2;
|
user2.Wage += (int)(WAGE * 0.7);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -308,8 +308,8 @@ namespace ReallifeGamemode.Server.Job
|
|||||||
|
|
||||||
if (target != null)
|
if (target != null)
|
||||||
{
|
{
|
||||||
user1.Wage += (int)(bonus / 2);
|
user1.Wage += bonus;
|
||||||
user2.Wage += (int)(bonus / 2);
|
user2.Wage += bonus;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -146,6 +146,7 @@ namespace ReallifeGamemode.Server
|
|||||||
Introduction.Setup();
|
Introduction.Setup();
|
||||||
PositionManager.LoadPositionManager();
|
PositionManager.LoadPositionManager();
|
||||||
LoadManager.LoadLoadManager();
|
LoadManager.LoadLoadManager();
|
||||||
|
Rentcar.Setup();
|
||||||
|
|
||||||
TempBlip tempBlip = new TempBlip()
|
TempBlip tempBlip = new TempBlip()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -32,21 +32,6 @@ namespace ReallifeGamemode.Server.Managers
|
|||||||
[RemoteEvent("creatorSave")]
|
[RemoteEvent("creatorSave")]
|
||||||
public void CreatorSave(Player player, bool gender, string parentData, string featureData, string appearanceData, string hairAndColorData)
|
public void CreatorSave(Player player, bool gender, string parentData, string featureData, string appearanceData, string hairAndColorData)
|
||||||
{
|
{
|
||||||
|
|
||||||
var charExists = false;
|
|
||||||
var genderSwap = false;
|
|
||||||
|
|
||||||
var cUser = player.GetUser();
|
|
||||||
|
|
||||||
if (cUser.CharacterId != null)
|
|
||||||
{
|
|
||||||
charExists = true;
|
|
||||||
if(cUser.Character.Gender != gender)
|
|
||||||
{
|
|
||||||
genderSwap = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var jParentData = JObject.Parse(parentData);
|
var jParentData = JObject.Parse(parentData);
|
||||||
var jFeatureData = JArray.Parse(featureData);
|
var jFeatureData = JArray.Parse(featureData);
|
||||||
var jAppearanceData = JArray.Parse(appearanceData);
|
var jAppearanceData = JArray.Parse(appearanceData);
|
||||||
@@ -79,27 +64,27 @@ namespace ReallifeGamemode.Server.Managers
|
|||||||
float neckWidth = jFeatureData.Value<float>(19);
|
float neckWidth = jFeatureData.Value<float>(19);
|
||||||
|
|
||||||
byte blemishes = jAppearanceData[0].Value<byte>("Value");
|
byte blemishes = jAppearanceData[0].Value<byte>("Value");
|
||||||
float blemishesOpacity = jAppearanceData[0].Value<byte>("Opacity");
|
float blemishesOpacity = jAppearanceData[0].Value<float>("Opacity");
|
||||||
byte facialHair = jAppearanceData[1].Value<byte>("Value");
|
byte facialHair = jAppearanceData[1].Value<byte>("Value");
|
||||||
float facialHairOpacity = jAppearanceData[1].Value<byte>("Opacity");
|
float facialHairOpacity = jAppearanceData[1].Value<float>("Opacity");
|
||||||
byte eyebrows = jAppearanceData[2].Value<byte>("Value");
|
byte eyebrows = jAppearanceData[2].Value<byte>("Value");
|
||||||
float eyebrowsOpacity = jAppearanceData[2].Value<byte>("Opacity");
|
float eyebrowsOpacity = jAppearanceData[2].Value<float>("Opacity");
|
||||||
byte ageing = jAppearanceData[3].Value<byte>("Value");
|
byte ageing = jAppearanceData[3].Value<byte>("Value");
|
||||||
float ageingOpacity = jAppearanceData[3].Value<byte>("Opacity");
|
float ageingOpacity = jAppearanceData[3].Value<float>("Opacity");
|
||||||
byte makeup = jAppearanceData[4].Value<byte>("Value");
|
byte makeup = jAppearanceData[4].Value<byte>("Value");
|
||||||
float makeupOpacity = jAppearanceData[4].Value<byte>("Opacity");
|
float makeupOpacity = jAppearanceData[4].Value<float>("Opacity");
|
||||||
byte blush = jAppearanceData[5].Value<byte>("Value");
|
byte blush = jAppearanceData[5].Value<byte>("Value");
|
||||||
float blushOpacity = jAppearanceData[5].Value<byte>("Opacity");
|
float blushOpacity = jAppearanceData[5].Value<float>("Opacity");
|
||||||
byte complexion = jAppearanceData[6].Value<byte>("Value");
|
byte complexion = jAppearanceData[6].Value<byte>("Value");
|
||||||
float complexionOpacity = jAppearanceData[6].Value<byte>("Opacity");
|
float complexionOpacity = jAppearanceData[6].Value<float>("Opacity");
|
||||||
byte sunDamage = jAppearanceData[7].Value<byte>("Value");
|
byte sunDamage = jAppearanceData[7].Value<byte>("Value");
|
||||||
float sunDamageOpacity = jAppearanceData[7].Value<byte>("Opacity");
|
float sunDamageOpacity = jAppearanceData[7].Value<float>("Opacity");
|
||||||
byte lipstick = jAppearanceData[8].Value<byte>("Value");
|
byte lipstick = jAppearanceData[8].Value<byte>("Value");
|
||||||
float lipstickOpacity = jAppearanceData[8].Value<byte>("Opacity");
|
float lipstickOpacity = jAppearanceData[8].Value<float>("Opacity");
|
||||||
byte freckles = jAppearanceData[9].Value<byte>("Value");
|
byte freckles = jAppearanceData[9].Value<byte>("Value");
|
||||||
float frecklesOpacity = jAppearanceData[9].Value<byte>("Opacity");
|
float frecklesOpacity = jAppearanceData[9].Value<float>("Opacity");
|
||||||
byte chestHair = jAppearanceData[10].Value<byte>("Value");
|
byte chestHair = jAppearanceData[10].Value<byte>("Value");
|
||||||
float chestHairOpacity = jAppearanceData[10].Value<byte>("Opacity");
|
float chestHairOpacity = jAppearanceData[10].Value<float>("Opacity");
|
||||||
|
|
||||||
byte hair = jHairAndColorData.Value<byte>(0);
|
byte hair = jHairAndColorData.Value<byte>(0);
|
||||||
byte hairColor = jHairAndColorData.Value<byte>(1);
|
byte hairColor = jHairAndColorData.Value<byte>(1);
|
||||||
@@ -111,8 +96,26 @@ namespace ReallifeGamemode.Server.Managers
|
|||||||
byte lipstickColor = jHairAndColorData.Value<byte>(7);
|
byte lipstickColor = jHairAndColorData.Value<byte>(7);
|
||||||
byte chestHairColor = jHairAndColorData.Value<byte>(8);
|
byte chestHairColor = jHairAndColorData.Value<byte>(8);
|
||||||
|
|
||||||
|
var charExists = false;
|
||||||
|
var genderSwap = false;
|
||||||
|
|
||||||
using (var saveCharacter = new DatabaseContext())
|
using (var saveCharacter = new DatabaseContext())
|
||||||
{
|
{
|
||||||
|
|
||||||
|
var userId = player.GetUser(saveCharacter).Id;
|
||||||
|
var user = saveCharacter.Users.SingleOrDefault(u => u.Id == userId);
|
||||||
|
|
||||||
|
var oldChar = saveCharacter.Characters.FirstOrDefault(c => c.UserId == user.Id);
|
||||||
|
|
||||||
|
if (user.CharacterId != null)
|
||||||
|
{
|
||||||
|
charExists = true;
|
||||||
|
if (oldChar.Gender != gender)
|
||||||
|
{
|
||||||
|
genderSwap = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var character = new Database.Entities.Character
|
var character = new Database.Entities.Character
|
||||||
{
|
{
|
||||||
UserId = player.GetUser().Id,
|
UserId = player.GetUser().Id,
|
||||||
@@ -181,21 +184,16 @@ namespace ReallifeGamemode.Server.Managers
|
|||||||
saveCharacter.Characters.Add(character);
|
saveCharacter.Characters.Add(character);
|
||||||
saveCharacter.SaveChanges();
|
saveCharacter.SaveChanges();
|
||||||
|
|
||||||
var userId = player.GetUser().Id;
|
|
||||||
var user = saveCharacter.Users.SingleOrDefault(u => u.Id == userId);
|
|
||||||
|
|
||||||
user.CharacterId = character.Id;
|
user.CharacterId = character.Id;
|
||||||
|
|
||||||
if (genderSwap)
|
if (genderSwap)
|
||||||
{
|
{
|
||||||
var charClothes = saveCharacter.CharacterClothes.Where(c => c.UserId == user.Id);
|
var charClothes = saveCharacter.CharacterClothes.Where(c => c.UserId == user.Id);
|
||||||
|
saveCharacter.RemoveRange(charClothes);
|
||||||
foreach(var cloth in charClothes)
|
|
||||||
{
|
|
||||||
saveCharacter.Remove(cloth);
|
|
||||||
saveCharacter.SaveChanges();
|
saveCharacter.SaveChanges();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
for (var x = 1; x <= 11; x++)
|
for (var x = 1; x <= 11; x++)
|
||||||
{
|
{
|
||||||
@@ -280,11 +278,11 @@ namespace ReallifeGamemode.Server.Managers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (charExists)
|
if (charExists)
|
||||||
{
|
{
|
||||||
user.BankAccount.Balance -= 15000;
|
user.BankAccount.Balance -= 15000;
|
||||||
if(user.FreeSurgery == true) user.FreeSurgery = false;
|
if(user.FreeSurgery == true) user.FreeSurgery = false;
|
||||||
|
saveCharacter.Remove(oldChar);
|
||||||
}
|
}
|
||||||
saveCharacter.SaveChanges();
|
saveCharacter.SaveChanges();
|
||||||
}
|
}
|
||||||
@@ -304,14 +302,15 @@ namespace ReallifeGamemode.Server.Managers
|
|||||||
//};
|
//};
|
||||||
//player.SetHeadOverlay(4, makeupHo);
|
//player.SetHeadOverlay(4, makeupHo);
|
||||||
//player.SetHeadOverlay(5, blushHo);
|
//player.SetHeadOverlay(5, blushHo);
|
||||||
|
if (charExists)
|
||||||
|
{
|
||||||
|
LeaveSurgery(player);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
player.SafeTeleport(Main.DEFAULT_SPAWN_POSITION, Main.DEFAULT_SPAWN_HEADING, true);
|
player.SafeTeleport(Main.DEFAULT_SPAWN_POSITION, Main.DEFAULT_SPAWN_HEADING, true);
|
||||||
player.TriggerEvent("draw", player.Name, player.Handle.Value);
|
player.TriggerEvent("draw", player.Name, player.Handle.Value);
|
||||||
player.Dimension = 0;
|
player.Dimension = 0;
|
||||||
|
|
||||||
if (charExists)
|
|
||||||
{
|
|
||||||
ApplyCharacter(player);
|
|
||||||
UpdateCharacterCloth.LoadCharacterDefaults(player);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ namespace ReallifeGamemode.Server.Managers
|
|||||||
{
|
{
|
||||||
foreach (Door door in dbContext.Doors)
|
foreach (Door door in dbContext.Doors)
|
||||||
{
|
{
|
||||||
_doorColShapes[door.Id] = NAPI.ColShape.CreateSphereColShape(door.Position, 30f);
|
_doorColShapes[door.Id] = NAPI.ColShape.CreateSphereColShape(door.Position, door.AlwaysOpen ? 200f : 30f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -63,7 +63,7 @@ namespace ReallifeGamemode.Server.Managers
|
|||||||
|
|
||||||
player.SendNotification(notStr, true);
|
player.SendNotification(notStr, true);
|
||||||
|
|
||||||
NAPI.Pools.GetAllPlayers().ForEach(p => p.TriggerEvent("changeDoorState", d.Model, d.X, d.Y, d.Z, (d.Locked ? 1 : 0), 0.0f, 0.0f, 0.0f));
|
NAPI.Pools.GetAllPlayers().ForEach(p => UpdateDoorState(p, d));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dbContext.SaveChanges();
|
dbContext.SaveChanges();
|
||||||
@@ -80,9 +80,14 @@ namespace ReallifeGamemode.Server.Managers
|
|||||||
using (var dbContext = new DatabaseContext())
|
using (var dbContext = new DatabaseContext())
|
||||||
{
|
{
|
||||||
Door door = dbContext.Doors.Where(d => d.Id == doorId).First();
|
Door door = dbContext.Doors.Where(d => d.Id == doorId).First();
|
||||||
player.TriggerEvent("changeDoorState", door.Model, door.X, door.Y, door.Z, (door.Locked ? 1 : 0), 0.0f, 0.0f, 0.0f);
|
UpdateDoorState(player, door);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void UpdateDoorState(Player player, Door door)
|
||||||
|
{
|
||||||
|
player.TriggerEvent("changeDoorState", door.Model, door.X, door.Y, door.Z, (door.Locked || door.AlwaysOpen ? 1 : 0), 0.0f, 0.0f, door.AlwaysOpen ? 1.0f : 0.0f);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using GTANetworkAPI;
|
using GTANetworkAPI;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
@@ -603,16 +603,16 @@ namespace ReallifeGamemode.Server.Managers
|
|||||||
{
|
{
|
||||||
if (amount > 0 && amount <= 10000)
|
if (amount > 0 && amount <= 10000)
|
||||||
{
|
{
|
||||||
player.SendNotification($"~w~Du hast ~y~{targetname} ~w~ein Ticket in Höhe von ~b~{amount}$ ~w~gestellt. Grund: ~g~{reason}~w~.");
|
player.SendNotification($"~w~Du hast ~y~{targetname} ~w~ein Ticket in Höhe von ~b~${amount} ~w~ausgestellt. Grund: ~g~{reason}~w~.");
|
||||||
target.SendNotification($"~b~{player.GetUser().FactionRank.RankName} | {playername} ~w~hat dir ein Ticket in Höhe von ~y~{amount}$ ~w~gestellt.", true);
|
target.SendNotification($"~b~{player.GetUser().FactionRank.RankName} {playername} ~w~hat dir ein Ticket in Höhe von ~y~${amount} ~w~ausgestellt.", true);
|
||||||
target.SendNotification($"~w~Grund: ~g~{reason}~w~. ~x~Strafticket im Interaktionsmenü annehmen.", true);
|
target.SendNotification($"~w~Grund: ~g~{reason}~w~. ~x~Das Ticket kann im Interaktionsmenü angenommen werden.", true);
|
||||||
target.SetData("ticket_boolean", true);
|
target.SetData("ticket_boolean", true);
|
||||||
target.SetData<int>("ticket_amount", amount);
|
target.SetData<int>("ticket_amount", amount);
|
||||||
target.SetData<Player>("ticket_player", player);
|
target.SetData<Player>("ticket_player", player);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
player.SendNotification("~r~Du kannst nur zwischen 1$ und 10000$ angeben!");
|
player.SendNotification("~r~Du kannst nur zwischen $1 und $10.000 angeben!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -668,8 +668,8 @@ namespace ReallifeGamemode.Server.Managers
|
|||||||
targetUser.Points += amount;
|
targetUser.Points += amount;
|
||||||
|
|
||||||
player.SendNotification($"~w~Du hast ~y~{targetname} ~b~{amount} ~w~Strafpunkte gegeben. Grund: ~g~{reason}~w~.");
|
player.SendNotification($"~w~Du hast ~y~{targetname} ~b~{amount} ~w~Strafpunkte gegeben. Grund: ~g~{reason}~w~.");
|
||||||
target.SendNotification($"~b~{player.GetUser().FactionRank.RankName} | {playername} ~w~hat dir ~y~{amount} ~w~Strafpunkte gegeben.", true);
|
target.SendNotification($"~b~{player.GetUser().FactionRank.RankName} {playername} ~w~hat dir ~y~{amount} ~w~Strafpunkte gegeben (Grund: ~r~{reason}~w~).", true);
|
||||||
ChatService.HQMessage(targetname + " hat von " + playername + " " + amount + " Strafpunkt(e) erhalten. Gesamt: " + targetUser.Points);
|
ChatService.HQMessage(targetname + " hat von " + playername + " " + amount + " Strafpunkt(e) erhalten (Grund: " + reason + "). Gesamt: " + targetUser.Points);
|
||||||
|
|
||||||
if (targetUser.Points < 0)
|
if (targetUser.Points < 0)
|
||||||
{
|
{
|
||||||
@@ -677,9 +677,7 @@ namespace ReallifeGamemode.Server.Managers
|
|||||||
}
|
}
|
||||||
else if (targetUser.Points >= 12)
|
else if (targetUser.Points >= 12)
|
||||||
{
|
{
|
||||||
target.SendNotification($"~w~Grund: ~g~{reason}~w~. ~x~Du hast nun ~r~12/12 ~x~Strafpunkten.", true);
|
target.SendNotification($"~x~Du hast nun ~r~12/12 ~x~Strafpunkte. ~w~Dir wurde dein ~r~Auto- und dein Motorradführerschein ~w~entzogen.", true);
|
||||||
target.SendNotification($"~w~Dir wird ~r~Auto- ~w~und ~r~Motorradführerschein ~w~entzogen.", true); //FlashNotif
|
|
||||||
|
|
||||||
ChatService.HQMessage(targetname + " besitzt nun keinen Führerschein mehr.");
|
ChatService.HQMessage(targetname + " besitzt nun keinen Führerschein mehr.");
|
||||||
|
|
||||||
targetUser.Points = 0;
|
targetUser.Points = 0;
|
||||||
@@ -688,7 +686,7 @@ namespace ReallifeGamemode.Server.Managers
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
target.SendNotification($"~w~Grund: ~g~{reason}~w~. ~x~Du hast nun ~y~{targetUser.Points}/12 ~x~Strafpunkten.", true);
|
target.SendNotification($"~x~Du hast nun ~y~{targetUser.Points}/12 ~x~Strafpunkt(e).", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
dbContext.SaveChanges();
|
dbContext.SaveChanges();
|
||||||
@@ -755,7 +753,16 @@ namespace ReallifeGamemode.Server.Managers
|
|||||||
public void InteractionMenu_Pay(Player player, string jsonNameOrId, string stringAmount)
|
public void InteractionMenu_Pay(Player player, string jsonNameOrId, string stringAmount)
|
||||||
{
|
{
|
||||||
string nameOrId = (string)JsonConvert.DeserializeObject(jsonNameOrId);
|
string nameOrId = (string)JsonConvert.DeserializeObject(jsonNameOrId);
|
||||||
int amount = Int32.Parse(stringAmount);
|
int amount;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
amount = Int32.Parse(stringAmount);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
player.SendNotification("~r~" + stringAmount + " ist kein gültiger Betrag.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
Player target = PlayerService.GetPlayerByNameOrId(nameOrId);
|
Player target = PlayerService.GetPlayerByNameOrId(nameOrId);
|
||||||
|
|
||||||
List<Player> nearbyPlayers = NAPI.Player.GetPlayersInRadiusOfPlayer(3, player);
|
List<Player> nearbyPlayers = NAPI.Player.GetPlayersInRadiusOfPlayer(3, player);
|
||||||
@@ -771,7 +778,7 @@ namespace ReallifeGamemode.Server.Managers
|
|||||||
}
|
}
|
||||||
else if (!nearbyPlayers.Contains(target))
|
else if (!nearbyPlayers.Contains(target))
|
||||||
{
|
{
|
||||||
player.SendNotification("~r~Dieser Spieler befindet sich nicht in deiner nähe!");
|
player.SendNotification("~r~Dieser Spieler befindet sich nicht in deiner Nähe!");
|
||||||
}
|
}
|
||||||
else if (player.GetUser().Handmoney < amount)
|
else if (player.GetUser().Handmoney < amount)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -531,8 +531,7 @@ namespace ReallifeGamemode.Server.Managers
|
|||||||
{
|
{
|
||||||
if (usableItemObj.Use(fItem))
|
if (usableItemObj.Use(fItem))
|
||||||
{
|
{
|
||||||
List<InventoryItem> items = backpackItems[player];
|
SetBackpackItems(player);
|
||||||
player.SetSharedData("backpackItems", JsonConvert.SerializeObject(items.ToArray()));
|
|
||||||
player.TriggerEvent("aproveUse", 1, iItem.Name);
|
player.TriggerEvent("aproveUse", 1, iItem.Name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -590,6 +589,7 @@ namespace ReallifeGamemode.Server.Managers
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
context.SaveChanges();
|
context.SaveChanges();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
@@ -212,7 +212,7 @@ namespace ReallifeGamemode.Server.Managers
|
|||||||
playerTimersJobVehicleRespawn[player].Stop();
|
playerTimersJobVehicleRespawn[player].Stop();
|
||||||
playerTimersJobVehicleRespawn.Remove(player);
|
playerTimersJobVehicleRespawn.Remove(player);
|
||||||
}
|
}
|
||||||
else
|
else if (job != GetJob<RefuseCollectorJob>())
|
||||||
{
|
{
|
||||||
player.StopAnimation();
|
player.StopAnimation();
|
||||||
player.WarpOutOfVehicle();
|
player.WarpOutOfVehicle();
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using GTANetworkAPI;
|
using GTANetworkAPI;
|
||||||
using ReallifeGamemode.Server.Shop.Clothing;
|
using ReallifeGamemode.Server.Shop.Clothing;
|
||||||
@@ -32,6 +32,11 @@ namespace ReallifeGamemode.Server.Managers
|
|||||||
|
|
||||||
public static List<AmmunationPoint> AmmunationPoints = new List<AmmunationPoint>();
|
public static List<AmmunationPoint> AmmunationPoints = new List<AmmunationPoint>();
|
||||||
|
|
||||||
|
public static List<RentcarPoint> rentcarPoints = new List<RentcarPoint>();
|
||||||
|
|
||||||
|
public static Vector3 eventportPosition;
|
||||||
|
public static bool eventportActive = false;
|
||||||
|
|
||||||
public static void LoadPositionManager()
|
public static void LoadPositionManager()
|
||||||
{
|
{
|
||||||
#region DutyPoints
|
#region DutyPoints
|
||||||
@@ -148,7 +153,7 @@ namespace ReallifeGamemode.Server.Managers
|
|||||||
};
|
};
|
||||||
ElevatorPoint FibElevatorPointGarage = new ElevatorPoint()
|
ElevatorPoint FibElevatorPointGarage = new ElevatorPoint()
|
||||||
{
|
{
|
||||||
Position = new Vector3(124.2521, -741.3329, 33.13322), //FBI ganz ganz unten
|
Position = new Vector3(125.172, -739.3329, 33.13322), //FBI ganz ganz unten
|
||||||
FactionId = 3,
|
FactionId = 3,
|
||||||
Stage = "Garage"
|
Stage = "Garage"
|
||||||
};
|
};
|
||||||
@@ -304,8 +309,47 @@ namespace ReallifeGamemode.Server.Managers
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion Shops
|
#endregion Shops
|
||||||
|
|
||||||
|
#region RentCar
|
||||||
|
|
||||||
|
RentcarPoint rentCarNoobSpawn = new RentcarPoint()
|
||||||
|
{
|
||||||
|
Position = Rentcar.noobSpawnBlipPosition
|
||||||
|
};
|
||||||
|
RentcarPoint rentCarStadthalle = new RentcarPoint()
|
||||||
|
{
|
||||||
|
Position = Rentcar.stadthalleBlipPosition
|
||||||
|
};
|
||||||
|
RentcarPoint rentCarKnast = new RentcarPoint()
|
||||||
|
{
|
||||||
|
Position = Rentcar.knastBlipPosition
|
||||||
|
};
|
||||||
|
RentcarPoint rentCarPaleto = new RentcarPoint()
|
||||||
|
{
|
||||||
|
Position = Rentcar.paletoBlipPosition
|
||||||
|
};
|
||||||
|
RentcarPoint rentCarLamesa = new RentcarPoint()
|
||||||
|
{
|
||||||
|
Position = Rentcar.lamesaBlipPosition
|
||||||
|
};
|
||||||
|
|
||||||
|
rentcarPoints.Add(rentCarNoobSpawn);
|
||||||
|
rentcarPoints.Add(rentCarLamesa);
|
||||||
|
rentcarPoints.Add(rentCarStadthalle);
|
||||||
|
rentcarPoints.Add(rentCarKnast);
|
||||||
|
rentcarPoints.Add(rentCarPaleto);
|
||||||
|
|
||||||
|
foreach (RentcarPoint point in rentcarPoints)
|
||||||
|
{
|
||||||
|
NAPI.Marker.CreateMarker(1, new Vector3(point.Position.X, point.Position.Y, point.Position.Z - 2), new Vector3(point.Position.X, point.Position.Y, point.Position.Z + 1),
|
||||||
|
new Vector3(0, 0, 0), 1.5f, new Color(255, 255, 255, 50), false, 0);
|
||||||
|
NAPI.TextLabel.CreateTextLabel("~y~Fahrzeugverleih\n~w~Drücke ~b~E~w~ um ein Fahrzeug zu mieten", point.Position, 7, 1, 0, new Color(255, 255, 255), false, 0);
|
||||||
|
|
||||||
|
NAPI.Blip.CreateBlip(88, new Vector3(point.Position.X, point.Position.Y, point.Position.Z), (float)0.7, 59, "Fahrzeugvermietung", 255, 200, true, 0, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endregion RentCar
|
||||||
[RemoteEvent("sendClientToStage")]
|
[RemoteEvent("sendClientToStage")]
|
||||||
public void ElevatorSendToStage(Player player, string level)
|
public void ElevatorSendToStage(Player player, string level)
|
||||||
{
|
{
|
||||||
@@ -436,3 +480,9 @@ public class AmmunationPoint
|
|||||||
public Vector3 Position { get; set; }
|
public Vector3 Position { get; set; }
|
||||||
public Ammunation Ammunation { get; set; }
|
public Ammunation Ammunation { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class RentcarPoint
|
||||||
|
{
|
||||||
|
public Vector3 Position { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using System.Collections.Generic;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using GTANetworkAPI;
|
using GTANetworkAPI;
|
||||||
using ReallifeGamemode.Database.Entities;
|
using ReallifeGamemode.Database.Entities;
|
||||||
@@ -35,20 +36,50 @@ namespace ReallifeGamemode.Server.Managers
|
|||||||
colShape.OnEntityEnterColShape += (cs, c) =>
|
colShape.OnEntityEnterColShape += (cs, c) =>
|
||||||
{
|
{
|
||||||
using var dbContext = new DatabaseContext();
|
using var dbContext = new DatabaseContext();
|
||||||
if (c.IsInVehicle && c.VehicleSeat == 0)
|
if (c.IsInVehicle && c.VehicleSeat == 0 && IsPlayerAllowedToTuneVehicle(c, c.Vehicle, dbContext))
|
||||||
{
|
{
|
||||||
c.TriggerEvent("showTuningInfo");
|
c.TriggerEvent("showTuningInfo");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
colShape.OnEntityExitColShape += (cs, c) =>
|
colShape.OnEntityExitColShape += (cs, c) =>
|
||||||
|
{
|
||||||
|
if(c.IsInVehicle)
|
||||||
{
|
{
|
||||||
c.TriggerEvent("hideTuningInfo", true);
|
c.TriggerEvent("hideTuningInfo", true);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
tuningGarages.Add(colShape);
|
tuningGarages.Add(colShape);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static bool IsPlayerAllowedToTuneVehicle(Player c, Vehicle vehicle, DatabaseContext dbContext)
|
||||||
|
{
|
||||||
|
User user = c.GetUser();
|
||||||
|
if(user == null)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
ServerVehicle serverVehicle = vehicle.GetServerVehicle(dbContext);
|
||||||
|
if(serverVehicle == null)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(serverVehicle is UserVehicle userVehicle && userVehicle.UserId == user.Id)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(serverVehicle is FactionVehicle factionVehicle && factionVehicle.GetOwners().Contains(user.FactionId ?? 0))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public static void ApplyTuningToServerVehicle(ServerVehicle sVeh)
|
public static void ApplyTuningToServerVehicle(ServerVehicle sVeh)
|
||||||
{
|
{
|
||||||
Vehicle veh = VehicleManager.GetVehicleFromServerVehicle(sVeh);
|
Vehicle veh = VehicleManager.GetVehicleFromServerVehicle(sVeh);
|
||||||
@@ -81,7 +112,33 @@ namespace ReallifeGamemode.Server.Managers
|
|||||||
{
|
{
|
||||||
if (!player.IsInVehicle) return;
|
if (!player.IsInVehicle) return;
|
||||||
|
|
||||||
player.TriggerEvent("showTuningMenu");
|
player.TriggerEvent("showTuningMenu", false, GetVehicleBasePrice(player.Vehicle));
|
||||||
|
}
|
||||||
|
|
||||||
|
private int GetVehicleBasePrice(Vehicle vehicle)
|
||||||
|
{
|
||||||
|
if(vehicle == null)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
ServerVehicle serverVehicle = vehicle.GetServerVehicle();
|
||||||
|
if(serverVehicle == null)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(serverVehicle is UserVehicle userVehicle)
|
||||||
|
{
|
||||||
|
return userVehicle.Price ?? 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(serverVehicle is FactionVehicle factionVehicle)
|
||||||
|
{
|
||||||
|
return factionVehicle.BuyPrice;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
[RemoteEvent("repairVehicle")]
|
[RemoteEvent("repairVehicle")]
|
||||||
|
|||||||
@@ -5,7 +5,9 @@ using ReallifeGamemode.Database.Entities;
|
|||||||
using ReallifeGamemode.Database.Models;
|
using ReallifeGamemode.Database.Models;
|
||||||
using ReallifeGamemode.Server.Extensions;
|
using ReallifeGamemode.Server.Extensions;
|
||||||
using ReallifeGamemode.Server.Log;
|
using ReallifeGamemode.Server.Log;
|
||||||
|
using ReallifeGamemode.Server.Services;
|
||||||
using ReallifeGamemode.Server.Util;
|
using ReallifeGamemode.Server.Util;
|
||||||
|
using ReallifeGamemode.Services;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@@ -770,11 +772,13 @@ namespace ReallifeGamemode.Server.Managers
|
|||||||
"fibd2",//mod
|
"fibd2",//mod
|
||||||
"fibj",//mod
|
"fibj",//mod
|
||||||
"fibn3",//mod
|
"fibn3",//mod
|
||||||
"fibr"//mod
|
"fibr",//mod
|
||||||
|
"vicechee", //mod
|
||||||
|
"sheriffcoqm", //mod
|
||||||
|
"polcoquette", //mod
|
||||||
};
|
};
|
||||||
|
|
||||||
private static readonly Dictionary<int, NetHandle> _serverVehicles = new Dictionary<int, NetHandle>();
|
private static readonly Dictionary<int, ushort> _serverVehicles = new Dictionary<int, ushort>();
|
||||||
|
|
||||||
private static readonly Dictionary<NetHandle, Vector3> lastPositions = new Dictionary<NetHandle, Vector3>();
|
private static readonly Dictionary<NetHandle, Vector3> lastPositions = new Dictionary<NetHandle, Vector3>();
|
||||||
private static DateTime lastSave = DateTime.UtcNow;
|
private static DateTime lastSave = DateTime.UtcNow;
|
||||||
@@ -855,17 +859,23 @@ namespace ReallifeGamemode.Server.Managers
|
|||||||
{
|
{
|
||||||
if (_serverVehicles.ContainsKey(serverVehicle.Id))
|
if (_serverVehicles.ContainsKey(serverVehicle.Id))
|
||||||
{
|
{
|
||||||
logger.LogCritical("Server Vehicle {Id} already has a spawned vehicle", serverVehicle.Id);
|
var spawnedHandle = _serverVehicles.Where(s => s.Key == serverVehicle.Id).First().Value;
|
||||||
_serverVehicles[serverVehicle.Id].Entity<Vehicle>().Delete();
|
logger.LogCritical("Server Vehicle {Id} already has a spawned vehicle with handle {spawnedHandle}", serverVehicle.Id, spawnedHandle);
|
||||||
|
new NetHandle(_serverVehicles[serverVehicle.Id], EntityType.Vehicle).Entity<Vehicle>().Delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_serverVehicles.ContainsValue(vehicle.Handle))
|
if (_serverVehicles.ContainsValue(vehicle.Handle.Value))
|
||||||
{
|
{
|
||||||
logger.LogCritical("Vehicle handle {Handle} already belongs");
|
var dbId = _serverVehicles.Where(v => v.Value == vehicle.Handle.Value).First().Key;
|
||||||
|
var dbIdHandle = vehicle.Handle.Value;
|
||||||
|
logger.LogCritical("Vehicle handle {handle} already belongs to server vehicle {dbIdHandle}", dbIdHandle, dbId);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_serverVehicles[serverVehicle.Id] = vehicle.Handle;
|
var id = serverVehicle.Id;
|
||||||
|
var handle = vehicle.Handle.Value;
|
||||||
|
logger.LogInformation("Mapping server vehicle id {id} to vehicle {handle}", id, handle);
|
||||||
|
_serverVehicles[serverVehicle.Id] = vehicle.Handle.Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static void DeleteVehicle(Vehicle veh)
|
internal static void DeleteVehicle(Vehicle veh)
|
||||||
@@ -873,15 +883,18 @@ namespace ReallifeGamemode.Server.Managers
|
|||||||
ServerVehicle sVeh;
|
ServerVehicle sVeh;
|
||||||
if ((sVeh = GetServerVehicleFromVehicle(veh)) != null)
|
if ((sVeh = GetServerVehicleFromVehicle(veh)) != null)
|
||||||
{
|
{
|
||||||
|
var id = sVeh.Id;
|
||||||
|
var handle = veh.Handle.Value;
|
||||||
|
logger.LogInformation("Deleting server vehicle {id} mapping to spawned veh {handle}", id, handle);
|
||||||
_serverVehicles.Remove(sVeh.Id);
|
_serverVehicles.Remove(sVeh.Id);
|
||||||
}
|
}
|
||||||
|
|
||||||
veh?.Delete();
|
veh?.Delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Vehicle GetVehicleFromHandle(NetHandle handle)
|
public static Vehicle GetVehicleFromHandle(ushort handle)
|
||||||
{
|
{
|
||||||
return NAPI.Pools.GetAllVehicles().Find(v => v.Handle == handle);
|
return NAPI.Pools.GetAllVehicles().Find(v => v.Handle.Value == handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Vehicle GetVehicleFromId(int id)
|
public static Vehicle GetVehicleFromId(int id)
|
||||||
@@ -917,9 +930,9 @@ namespace ReallifeGamemode.Server.Managers
|
|||||||
|
|
||||||
dbContext = dbContext ?? new DatabaseContext();
|
dbContext = dbContext ?? new DatabaseContext();
|
||||||
|
|
||||||
foreach (KeyValuePair<int, NetHandle> pair in _serverVehicles)
|
foreach (KeyValuePair<int, ushort> pair in _serverVehicles)
|
||||||
{
|
{
|
||||||
if (pair.Value == veh.Handle)
|
if (pair.Value == veh.Handle.Value)
|
||||||
{
|
{
|
||||||
return dbContext.ServerVehicles.Find(pair.Key);
|
return dbContext.ServerVehicles.Find(pair.Key);
|
||||||
}
|
}
|
||||||
@@ -946,6 +959,17 @@ namespace ReallifeGamemode.Server.Managers
|
|||||||
[ServerEvent(Event.VehicleDeath)]
|
[ServerEvent(Event.VehicleDeath)]
|
||||||
public static void VehicleManagerVehicleDeath(Vehicle vehicle)
|
public static void VehicleManagerVehicleDeath(Vehicle vehicle)
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
|
String rentCarOwner = Rentcar.mapPlayerRentcarBill.FirstOrDefault(x => x.Value.Item1 == vehicle).Key;
|
||||||
|
|
||||||
|
ChatService.Broadcast("a:" + "");
|
||||||
|
if (rentCarOwner != null)
|
||||||
|
{
|
||||||
|
Player target = PlayerService.GetPlayerByNameOrId(rentCarOwner);
|
||||||
|
Rentcar.cancelRent(target);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
ServerVehicle serverVehicle = GetServerVehicleFromVehicle(vehicle);
|
ServerVehicle serverVehicle = GetServerVehicleFromVehicle(vehicle);
|
||||||
|
|
||||||
if (serverVehicle == null)
|
if (serverVehicle == null)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using GTANetworkAPI;
|
using GTANetworkAPI;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
@@ -124,7 +124,7 @@ namespace ReallifeGamemode.Server.Report
|
|||||||
{
|
{
|
||||||
user = PlayerService.GetPlayerByNameOrId(username);
|
user = PlayerService.GetPlayerByNameOrId(username);
|
||||||
|
|
||||||
if (text.Equals("quit"))
|
if (text.Equals("quit") || text.Equals("close"))
|
||||||
{
|
{
|
||||||
ChatService.SendMessage(user, "!{#008fff}[REPORT]!{#FFFFFF} Chat vom Admin beendet");
|
ChatService.SendMessage(user, "!{#008fff}[REPORT]!{#FFFFFF} Chat vom Admin beendet");
|
||||||
ChatService.SendMessage(client, "!{#008fff}[REPORT]!{#FFFFFF} Chat beendet");
|
ChatService.SendMessage(client, "!{#008fff}[REPORT]!{#FFFFFF} Chat beendet");
|
||||||
@@ -180,7 +180,7 @@ namespace ReallifeGamemode.Server.Report
|
|||||||
public void RequestReport(Player user, string type, string data)
|
public void RequestReport(Player user, string type, string data)
|
||||||
{
|
{
|
||||||
string text = JsonConvert.DeserializeObject<string>(data);
|
string text = JsonConvert.DeserializeObject<string>(data);
|
||||||
if (type == "Ticket Report")
|
if (type == "Ticket")
|
||||||
{
|
{
|
||||||
ReportManage temp = null;
|
ReportManage temp = null;
|
||||||
for (int a = 0; a < listReports.Count; a++)
|
for (int a = 0; a < listReports.Count; a++)
|
||||||
@@ -213,10 +213,10 @@ namespace ReallifeGamemode.Server.Report
|
|||||||
listReports.Add(ticket);
|
listReports.Add(ticket);
|
||||||
//ChatService.SendMessage(user, "!{#addc8d}In Bearbeitung");
|
//ChatService.SendMessage(user, "!{#addc8d}In Bearbeitung");
|
||||||
}
|
}
|
||||||
if (type == "Quick Report")
|
if (type == "Quick-Report")
|
||||||
{
|
{
|
||||||
ChatService.BroadcastAdmin("!{#008fff}[QR]~w~ " + user.Name + " (" + user.Handle.Value + ")~w~: " + text, AdminLevel.SUPPORTER);
|
ChatService.BroadcastAdmin("!{#008fff}[QR]~w~ " + user.Name + " (" + user.Handle.Value + ")~w~: " + text, AdminLevel.SUPPORTER);
|
||||||
user.SendChatMessage("~w~Dein Quick Report wurde an das Adminteam weitergeleitet");
|
user.SendChatMessage("~w~Dein Quick-Report wurde an das Adminteam weitergeleitet");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using GTANetworkAPI;
|
using GTANetworkAPI;
|
||||||
|
|
||||||
@@ -14,6 +14,10 @@ namespace ReallifeGamemode.Server.Util
|
|||||||
{ ".MichaPlays.", "Der echte Ballas Leader ist online (MichaPlays)" },
|
{ ".MichaPlays.", "Der echte Ballas Leader ist online (MichaPlays)" },
|
||||||
{ "iCroniX", "Life of Malle - Eimer für Alle - Alle für Malle - Böllern! (CroniX)" },
|
{ "iCroniX", "Life of Malle - Eimer für Alle - Alle für Malle - Böllern! (CroniX)" },
|
||||||
{ "balboistderbeste", "Hurra! Hurra! Der Balbo ist jetzt da! (balbo)" },
|
{ "balboistderbeste", "Hurra! Hurra! Der Balbo ist jetzt da! (balbo)" },
|
||||||
|
{ "AirMake", "The fresh breeze of the stone ist back. (AirMake)" },
|
||||||
|
{ "raviatex", "I'll remember you all in therapy. (aviate)" },
|
||||||
|
{ "datgame__", "KOPF ENTWICKLUNG!! (hydrant)" },
|
||||||
|
{ "Roachkook", "2head Entwickler ist wieder online (kookroach)" }
|
||||||
};
|
};
|
||||||
|
|
||||||
public static DateTime CountdownUntil { get; internal set; }
|
public static DateTime CountdownUntil { get; internal set; }
|
||||||
|
|||||||
204
ReallifeGamemode.Server/Util/Rentcar.cs
Normal file
204
ReallifeGamemode.Server/Util/Rentcar.cs
Normal file
@@ -0,0 +1,204 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
using GTANetworkAPI;
|
||||||
|
using ReallifeGamemode.Database.Entities;
|
||||||
|
using ReallifeGamemode.Database.Models;
|
||||||
|
using ReallifeGamemode.Server.Extensions;
|
||||||
|
using ReallifeGamemode.Server.Managers;
|
||||||
|
using ReallifeGamemode.Server.Services;
|
||||||
|
|
||||||
|
namespace ReallifeGamemode.Server.Util
|
||||||
|
{
|
||||||
|
class Rentcar : Script
|
||||||
|
{
|
||||||
|
//In Sekunden
|
||||||
|
public static int PAY_TIMER = 180;
|
||||||
|
|
||||||
|
//In Stunden
|
||||||
|
private static int PAYTIME_FREE = 30;
|
||||||
|
|
||||||
|
public static List<RentcarProperty> noobspawnVehicleProperties = new List<RentcarProperty>();
|
||||||
|
private static Vector3 noobspawnVehicleSpawnPosition = new Vector3(-1020.18695, -2695.2253, 13.988778);
|
||||||
|
private static double noobspawnVehicleSpawnHeading = 151.39877;
|
||||||
|
public static Vector3 noobSpawnBlipPosition = new Vector3(-1023.3046, -2694.8992, 13.906858);
|
||||||
|
|
||||||
|
public static List<RentcarProperty> stadthalleVehicleProperties = new List<RentcarProperty>();
|
||||||
|
private static Vector3 stadthalleVehicleSpawnPosition = new Vector3(-373, -236.31334, 35.8506);
|
||||||
|
private static double stadthalleVehicleSpawnHeading = 109.96821;
|
||||||
|
public static Vector3 stadthalleBlipPosition = new Vector3(-369.7236, -231.82654, 35.993023);
|
||||||
|
|
||||||
|
public static List<RentcarProperty> knastVehicleProperties = new List<RentcarProperty>();
|
||||||
|
private static Vector3 knastVehicleSpawnPosition = new Vector3(1212.741, 2726.6135, 38.00415);
|
||||||
|
private static double knastVehicleSpawnHeading = 173.14825;
|
||||||
|
public static Vector3 knastBlipPosition = new Vector3(1220.3483, 2725.4932, 38.00414);
|
||||||
|
|
||||||
|
public static List<RentcarProperty> paletoVehicleProperties = new List<RentcarProperty>();
|
||||||
|
private static Vector3 paletoVehicleSpawnPosition = new Vector3(-216.75778198242188, 6215.0068359375, 31.490657806396484);
|
||||||
|
private static double paletoVehicleSpawnHeading = -133.99148559570312;
|
||||||
|
public static Vector3 paletoBlipPosition = new Vector3(-214.52447509765625, 6218.1708984375, 31.49131965637207);
|
||||||
|
|
||||||
|
public static List<RentcarProperty> lamesaVehicleProperties = new List<RentcarProperty>();
|
||||||
|
private static Vector3 lamesaVehicleSpawnPosition = new Vector3(811.4766235351562, -1041.594482421875, 26.58707618713379);
|
||||||
|
private static double lamesaVehicleSpawnHeading = 88.71146392822266;
|
||||||
|
public static Vector3 lamesaBlipPosition = new Vector3(818.3075561523438, -1039.78759765625, 26.750783920288086);
|
||||||
|
|
||||||
|
public static Dictionary<string, (Vehicle, int)> mapPlayerRentcarBill = new Dictionary<string, (Vehicle, int)>();
|
||||||
|
|
||||||
|
public static void Setup()
|
||||||
|
{
|
||||||
|
noobspawnVehicleProperties.Add(new RentcarProperty("bmx", 10));
|
||||||
|
noobspawnVehicleProperties.Add(new RentcarProperty("faggio3", 50));
|
||||||
|
|
||||||
|
stadthalleVehicleProperties.Add(new RentcarProperty("bmx", 10));
|
||||||
|
stadthalleVehicleProperties.Add(new RentcarProperty("faggio3", 50));
|
||||||
|
|
||||||
|
knastVehicleProperties.Add(new RentcarProperty("bmx", 10));
|
||||||
|
knastVehicleProperties.Add(new RentcarProperty("faggio3", 50));
|
||||||
|
|
||||||
|
paletoVehicleProperties.Add(new RentcarProperty("bmx", 10));
|
||||||
|
paletoVehicleProperties.Add(new RentcarProperty("faggio3", 50));
|
||||||
|
|
||||||
|
lamesaVehicleProperties.Add(new RentcarProperty("bmx", 10));
|
||||||
|
lamesaVehicleProperties.Add(new RentcarProperty("faggio3", 50));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void cancelRent(Player player)
|
||||||
|
{
|
||||||
|
using (var dbContext = new DatabaseContext())
|
||||||
|
{
|
||||||
|
User user = player.GetUser(dbContext);
|
||||||
|
user.BankAccount.Balance -= mapPlayerRentcarBill[player.Name].Item2;
|
||||||
|
dbContext.SaveChanges();
|
||||||
|
}
|
||||||
|
|
||||||
|
player.SetData("hasRentcar", false);
|
||||||
|
player.TriggerEvent("abortRentcarTimer");
|
||||||
|
player.SendChatMessage("Fahrzeugmiete erfolgreich gekündigt (Kosten: ~g~$" + mapPlayerRentcarBill[player.Name].Item2 + ").");
|
||||||
|
VehicleManager.DeleteVehicle(mapPlayerRentcarBill[player.Name].Item1);
|
||||||
|
Rentcar.mapPlayerRentcarBill.Remove(player.Name);
|
||||||
|
}
|
||||||
|
|
||||||
|
[RemoteEvent("SERVER:updateRentCarBill")]
|
||||||
|
public void updateRentCarBill(Player player, int bill, int time)
|
||||||
|
{
|
||||||
|
if (canRentForFree(player))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
using (var dbContext = new DatabaseContext())
|
||||||
|
{
|
||||||
|
User user = player.GetUser(dbContext);
|
||||||
|
|
||||||
|
if (bill > user.BankAccount.Balance)
|
||||||
|
{
|
||||||
|
ChatService.ErrorMessage(player, "Du hast nicht genügend Geld auf dem Konto. Dein Mietfahrzeug wurde zurückgegeben");
|
||||||
|
cancelRent(player);
|
||||||
|
dbContext.SaveChanges();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
dbContext.SaveChanges();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!mapPlayerRentcarBill.ContainsKey(player.Name))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
player.TriggerEvent("BN_Show", "Fahrzeug seit ~b~" + (int)(time / 60) + "~w~ Minuten gemietet (Gesamtkosten: ~g~$" + bill + "~s~).");
|
||||||
|
mapPlayerRentcarBill[player.Name] = (mapPlayerRentcarBill[player.Name].Item1, bill);
|
||||||
|
}
|
||||||
|
|
||||||
|
[RemoteEvent("SERVER:rentcarBooked")]
|
||||||
|
public void rentcarBooked(Player player, string vehicleName, int price, String rentcarLocation)
|
||||||
|
{
|
||||||
|
if (player.GetData<bool>("hasRentcar") == true)
|
||||||
|
{
|
||||||
|
ChatService.ErrorMessage(player, "Du hast bereits ein Fahrzeug gemietet. Mit '/rent stop' kündigst du den Mietvertrag");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!uint.TryParse(vehicleName, out uint uHash))
|
||||||
|
uHash = NAPI.Util.GetHashKey(vehicleName);
|
||||||
|
|
||||||
|
if (!VehicleManager.IsValidHash(uHash))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
using (var dbContext = new DatabaseContext())
|
||||||
|
{
|
||||||
|
User user = player.GetUser(dbContext);
|
||||||
|
|
||||||
|
if (price > user.BankAccount.Balance)
|
||||||
|
{
|
||||||
|
ChatService.ErrorMessage(player, "Du hast nicht genügend Geld auf dem Konto");
|
||||||
|
dbContext.SaveChanges();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
dbContext.SaveChanges();
|
||||||
|
}
|
||||||
|
Vehicle v = null;
|
||||||
|
|
||||||
|
if (rentcarLocation == "noobspawn")
|
||||||
|
{
|
||||||
|
v = NAPI.Vehicle.CreateVehicle(uHash, noobspawnVehicleSpawnPosition, (float)noobspawnVehicleSpawnHeading, 111, 111, engine: true);
|
||||||
|
}
|
||||||
|
else if (rentcarLocation == "stadthalle")
|
||||||
|
{
|
||||||
|
v = NAPI.Vehicle.CreateVehicle(uHash, stadthalleVehicleSpawnPosition, (float)stadthalleVehicleSpawnHeading, 111, 111, engine: true);
|
||||||
|
}
|
||||||
|
else if (rentcarLocation == "knast")
|
||||||
|
{
|
||||||
|
v = NAPI.Vehicle.CreateVehicle(uHash, knastVehicleSpawnPosition, (float)knastVehicleSpawnHeading, 111, 111, engine: true);
|
||||||
|
}
|
||||||
|
else if (rentcarLocation == "paleto")
|
||||||
|
{
|
||||||
|
v = NAPI.Vehicle.CreateVehicle(uHash, paletoVehicleSpawnPosition, (float)paletoVehicleSpawnHeading, 111, 111, engine: true);
|
||||||
|
}
|
||||||
|
else if (rentcarLocation == "lamesa")
|
||||||
|
{
|
||||||
|
v = NAPI.Vehicle.CreateVehicle(uHash, lamesaVehicleSpawnPosition, (float)lamesaVehicleSpawnHeading, 111, 111, engine: true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (v == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
VehicleStreaming.SetEngineState(v, true);
|
||||||
|
VehicleStreaming.SetLockStatus(v, false);
|
||||||
|
|
||||||
|
mapPlayerRentcarBill[player.Name] = (v, 0);
|
||||||
|
|
||||||
|
player.SendChatMessage("~y~[Fahrzeugvermietung] ~w~Viel Spaß mit deinem Fahrzeug! Mit '/rent stop' kannst du den Mietvertrag kündigen.");
|
||||||
|
|
||||||
|
if (canRentForFree(player))
|
||||||
|
{
|
||||||
|
player.SendChatMessage("~y~[Fahrzeugvermietung] ~w~Da du neu in der Stadt bist, wird dir diese Fahrt nicht in Rechnung gestellt.");
|
||||||
|
}
|
||||||
|
|
||||||
|
player.SetData("hasRentcar", true);
|
||||||
|
player.TriggerEvent("triggerRentcarTimer", PAY_TIMER, price);
|
||||||
|
}
|
||||||
|
public static bool canRentForFree(Player player)
|
||||||
|
{
|
||||||
|
bool ret = false;
|
||||||
|
|
||||||
|
using (var dbContext = new DatabaseContext())
|
||||||
|
{
|
||||||
|
User user = player.GetUser(dbContext);
|
||||||
|
|
||||||
|
if (user.PlayedMinutes < PAYTIME_FREE * 60)
|
||||||
|
{
|
||||||
|
ret = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
dbContext.SaveChanges();
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
18
ReallifeGamemode.Server/Util/RentcarProperty.cs
Normal file
18
ReallifeGamemode.Server/Util/RentcarProperty.cs
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace ReallifeGamemode.Server.Util
|
||||||
|
{
|
||||||
|
class RentcarProperty
|
||||||
|
{
|
||||||
|
public string Name { get; set; }
|
||||||
|
public int Price { get; set; }
|
||||||
|
|
||||||
|
public RentcarProperty(String n, int p){
|
||||||
|
Name = n;
|
||||||
|
Price = p;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -32,9 +32,6 @@ namespace ReallifeGamemode.Server.Util
|
|||||||
timer5000.Start();
|
timer5000.Start();
|
||||||
timer5000.Elapsed += Timer5000_Elapsed;
|
timer5000.Elapsed += Timer5000_Elapsed;
|
||||||
|
|
||||||
timer10000.Start();
|
|
||||||
timer10000.Elapsed += Timer10000_Elapsed;
|
|
||||||
|
|
||||||
timer60000.Start();
|
timer60000.Start();
|
||||||
timer60000.Elapsed += Timer60000_Elapsed;
|
timer60000.Elapsed += Timer60000_Elapsed;
|
||||||
}
|
}
|
||||||
@@ -65,7 +62,6 @@ namespace ReallifeGamemode.Server.Util
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static void Timer60000_Elapsed(object sender, ElapsedEventArgs e)
|
private static void Timer60000_Elapsed(object sender, ElapsedEventArgs e)
|
||||||
{
|
{
|
||||||
NAPI.Task.Run(() =>
|
NAPI.Task.Run(() =>
|
||||||
@@ -78,19 +74,10 @@ namespace ReallifeGamemode.Server.Util
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void Timer10000_Elapsed(object sender, ElapsedEventArgs e)
|
|
||||||
{
|
|
||||||
NAPI.Task.Run(() =>
|
|
||||||
{
|
|
||||||
Jail.BrakeOut_Elapsed();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void Timer2500_Elapsed(object sender, ElapsedEventArgs e)
|
private static void Timer2500_Elapsed(object sender, ElapsedEventArgs e)
|
||||||
{
|
{
|
||||||
NAPI.Task.Run(() =>
|
NAPI.Task.Run(() =>
|
||||||
{
|
{
|
||||||
WantedEscapeTimer.Timer_Elapsed();
|
|
||||||
Jail.JailIn_Elapsed();
|
Jail.JailIn_Elapsed();
|
||||||
Gangwar.Gangwar.Value_TimerElapsed();
|
Gangwar.Gangwar.Value_TimerElapsed();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -19,7 +19,17 @@ namespace ReallifeGamemode.Server.Wanted
|
|||||||
{
|
{
|
||||||
private static Dictionary<int, int> Jailtime { get; set; } = new Dictionary<int, int>(); //time in seconds
|
private static Dictionary<int, int> Jailtime { get; set; } = new Dictionary<int, int>(); //time in seconds
|
||||||
|
|
||||||
public static void Check_PutBehindBars(User user)
|
private static Vector3 JailIn_Point = new Vector3(1690.754, 2591.0464, 45.914402);
|
||||||
|
private static int JailIn_Range = 3;
|
||||||
|
private static Vector3 JailOut_Point = new Vector3(1848.3097, 2585.9036, 45.67201);
|
||||||
|
|
||||||
|
private static List<Vector3> prisonCells = new List<Vector3>() {
|
||||||
|
new Vector3(1629.2026, 2569.8057, 45.564846),
|
||||||
|
new Vector3(1642.7831, 2570.2622, 45.56483),
|
||||||
|
new Vector3(1651.512, 2570.2249, 45.564907)
|
||||||
|
};
|
||||||
|
|
||||||
|
public static void Check_PutBehindBars(User user, JailInLocations positionInJail)
|
||||||
{
|
{
|
||||||
user.SetBlipAndNametagColor();
|
user.SetBlipAndNametagColor();
|
||||||
Player player = user.Player;
|
Player player = user.Player;
|
||||||
@@ -31,15 +41,20 @@ namespace ReallifeGamemode.Server.Wanted
|
|||||||
player.ClearAnimation();
|
player.ClearAnimation();
|
||||||
player.SafeSetHealth(100);
|
player.SafeSetHealth(100);
|
||||||
player.Armor = 0;
|
player.Armor = 0;
|
||||||
|
|
||||||
|
Vector3 position = null;
|
||||||
|
|
||||||
|
if (positionInJail == JailInLocations.InCell)
|
||||||
|
{
|
||||||
Random rnd = new Random();
|
Random rnd = new Random();
|
||||||
int rndInt = rnd.Next(1, 3);
|
int rndInt = rnd.Next(1, 3);
|
||||||
Vector3 position = new Vector3();
|
position = prisonCells[rndInt];
|
||||||
if (rndInt == 1)
|
|
||||||
position = new Vector3(458.9842, -997.2126, 24.91485); //send client to jail
|
}
|
||||||
if (rndInt == 2)
|
else if (positionInJail == JailInLocations.Outside)
|
||||||
position = new Vector3(459.696, -994.3766, 24.91486); //send client to jail
|
{
|
||||||
if (rndInt == 3)
|
position = new Vector3(1691.42, 2562.77, 45.56);
|
||||||
position = new Vector3(458.3372, -1001.258, 24.91485); //send client to jail
|
}
|
||||||
|
|
||||||
player.SafeTeleport(position, 0, true);
|
player.SafeTeleport(position, 0, true);
|
||||||
|
|
||||||
@@ -78,7 +93,7 @@ namespace ReallifeGamemode.Server.Wanted
|
|||||||
using var dbContext = new DatabaseContext();
|
using var dbContext = new DatabaseContext();
|
||||||
foreach (var player in NAPI.Pools.GetAllPlayers())
|
foreach (var player in NAPI.Pools.GetAllPlayers())
|
||||||
{
|
{
|
||||||
if (player.Position.DistanceTo(new Vector3(458.9842, -997.2126, 24.91485)) > 7)
|
if (player.Position.DistanceTo(JailIn_Point) > JailIn_Range)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -98,7 +113,8 @@ namespace ReallifeGamemode.Server.Wanted
|
|||||||
user.SetBlipAndNametagColor();
|
user.SetBlipAndNametagColor();
|
||||||
user.AnnouncePlayerJailedIn();
|
user.AnnouncePlayerJailedIn();
|
||||||
dbContext.SaveChanges();
|
dbContext.SaveChanges();
|
||||||
Check_PutBehindBars(user);
|
//HERE: Freilauf
|
||||||
|
Check_PutBehindBars(user, JailInLocations.Outside);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -107,27 +123,6 @@ namespace ReallifeGamemode.Server.Wanted
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void BrakeOut_Elapsed()
|
|
||||||
{
|
|
||||||
foreach (var player in NAPI.Pools.GetAllPlayers())
|
|
||||||
{
|
|
||||||
User user = player.GetUser();
|
|
||||||
|
|
||||||
if (user != null && player.Position.DistanceTo2D(new Vector3(458.9842, -997.2126, 24.91485)) > 7 && Jailtime.ContainsKey(user.Id))
|
|
||||||
{
|
|
||||||
using (var dbContext = new DatabaseContext())
|
|
||||||
{
|
|
||||||
user = player.GetUser(dbContext);
|
|
||||||
user.JailTime = 0;
|
|
||||||
user.GiveWanteds(null, 50, "Knast-Ausbruch");
|
|
||||||
player.TriggerEvent("jailTime", 0);
|
|
||||||
dbContext.SaveChanges();
|
|
||||||
Jailtime.Remove(user.Id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void JailOut_Elapsed()
|
public static void JailOut_Elapsed()
|
||||||
{
|
{
|
||||||
using var dbContext = new DatabaseContext();
|
using var dbContext = new DatabaseContext();
|
||||||
@@ -139,7 +134,7 @@ namespace ReallifeGamemode.Server.Wanted
|
|||||||
if (user.JailTime <= 0)
|
if (user.JailTime <= 0)
|
||||||
{
|
{
|
||||||
Jailtime.Remove(user.Id);
|
Jailtime.Remove(user.Id);
|
||||||
player.SafeTeleport(new Vector3(427.879, -984.65, 30.71));
|
player.SafeTeleport(JailOut_Point);
|
||||||
player.TriggerEvent("jailTime", 0);
|
player.TriggerEvent("jailTime", 0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -183,7 +178,7 @@ namespace ReallifeGamemode.Server.Wanted
|
|||||||
dbContext.SaveChanges();
|
dbContext.SaveChanges();
|
||||||
}
|
}
|
||||||
player.SafeSetHealth(100);
|
player.SafeSetHealth(100);
|
||||||
player.SafeTeleport(new Vector3(427.879, -984.65, 30.71));
|
player.SafeTeleport(JailOut_Point);
|
||||||
|
|
||||||
ChatService.HQMessage("Beamter " + cop.Name + " hat " + user.Name + " aus dem Knast entlassen.");
|
ChatService.HQMessage("Beamter " + cop.Name + " hat " + user.Name + " aus dem Knast entlassen.");
|
||||||
ChatService.SendMessage(player, "!{#8181E9}Der Beamte " + cop.Name + " hat dich aus dem Knast entlassen");
|
ChatService.SendMessage(player, "!{#8181E9}Der Beamte " + cop.Name + " hat dich aus dem Knast entlassen");
|
||||||
@@ -203,7 +198,7 @@ namespace ReallifeGamemode.Server.Wanted
|
|||||||
dbContext.SaveChanges();
|
dbContext.SaveChanges();
|
||||||
|
|
||||||
target.SafeSetHealth(100);
|
target.SafeSetHealth(100);
|
||||||
target.SafeTeleport(new Vector3(427.879, -984.65, 30.71));
|
target.SafeTeleport(JailOut_Point);
|
||||||
|
|
||||||
ChatService.HQMessage(" Admin " + admin.Name + " hat " + user.Name + " aus dem Knast entlassen.");
|
ChatService.HQMessage(" Admin " + admin.Name + " hat " + user.Name + " aus dem Knast entlassen.");
|
||||||
ChatService.SendMessage(target, "!{#8181E9}Admin " + admin.Name + " hat dich aus dem Knast entlassen");
|
ChatService.SendMessage(target, "!{#8181E9}Admin " + admin.Name + " hat dich aus dem Knast entlassen");
|
||||||
@@ -211,5 +206,39 @@ namespace ReallifeGamemode.Server.Wanted
|
|||||||
target.TriggerEvent("jailTime", 0);
|
target.TriggerEvent("jailTime", 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void BreakOut(Player player)
|
||||||
|
{
|
||||||
|
User user = player.GetUser();
|
||||||
|
|
||||||
|
using (var dbContext = new DatabaseContext())
|
||||||
|
{
|
||||||
|
user = player.GetUser(dbContext);
|
||||||
|
user.JailTime = 0;
|
||||||
|
user.GiveWanteds(null, 50, "Knast-Ausbruch");
|
||||||
|
player.TriggerEvent("jailTime", 0);
|
||||||
|
dbContext.SaveChanges();
|
||||||
|
Jailtime.Remove(user.Id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[RemoteEvent("SERVER:BreakOutIfInPrison")]
|
||||||
|
public void breakOutIfInPrison(Player player)
|
||||||
|
{
|
||||||
|
User user = player.GetUser();
|
||||||
|
|
||||||
|
using (var dbContext = new DatabaseContext())
|
||||||
|
{
|
||||||
|
if (Jailtime.ContainsKey(user.Id))
|
||||||
|
{
|
||||||
|
user = player.GetUser(dbContext);
|
||||||
|
user.JailTime = 0;
|
||||||
|
user.GiveWanteds(null, 50, "Knast-Ausbruch");
|
||||||
|
player.TriggerEvent("jailTime", 0);
|
||||||
|
dbContext.SaveChanges();
|
||||||
|
Jailtime.Remove(user.Id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
12
ReallifeGamemode.Server/Wanted/JailInLocations.cs
Normal file
12
ReallifeGamemode.Server/Wanted/JailInLocations.cs
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace ReallifeGamemode.Server.Wanted
|
||||||
|
{
|
||||||
|
public enum JailInLocations
|
||||||
|
{
|
||||||
|
Outside,
|
||||||
|
InCell
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -13,61 +13,18 @@ using ReallifeGamemode.Server.Services;
|
|||||||
|
|
||||||
namespace ReallifeGamemode.Server.Wanted
|
namespace ReallifeGamemode.Server.Wanted
|
||||||
{
|
{
|
||||||
public class WantedEscapeTimer
|
public class WantedEscapeTimer : Script
|
||||||
{
|
{
|
||||||
private const int WantedEscapeTime = 300000;
|
[RemoteEvent("CLIENT:EscapeWanted")]
|
||||||
|
public void WantedEscape(Player player)
|
||||||
public static Dictionary<int, int> waTimer { get; set; } = new Dictionary<int, int>(); //zeit in ms
|
|
||||||
/*
|
|
||||||
public static void WantedTimer()
|
|
||||||
{
|
|
||||||
//System.Timers.Timer timer = new System.Timers.Timer(2500);
|
|
||||||
//timer.Start();
|
|
||||||
//timer.Elapsed += Timer_Elapsed;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
public static void ResetWantedTimeToElapse(User user)
|
|
||||||
{
|
|
||||||
waTimer[user.Id] = WantedEscapeTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void Timer_Elapsed()
|
|
||||||
{
|
{
|
||||||
using var dbContext = new DatabaseContext();
|
using var dbContext = new DatabaseContext();
|
||||||
foreach (var player in NAPI.Pools.GetAllPlayers())
|
|
||||||
{
|
|
||||||
User user = player.GetUser(dbContext);
|
User user = player.GetUser(dbContext);
|
||||||
if (user != null && user.Wanteds > 0)
|
|
||||||
{
|
|
||||||
if (!waTimer.ContainsKey(user.Id))
|
|
||||||
ResetWantedTimeToElapse(user);
|
|
||||||
|
|
||||||
bool isNearCop = false;
|
if (user.Wanteds <= 0)
|
||||||
foreach (var playerCop in NAPI.Pools.GetAllPlayers())
|
return;
|
||||||
{
|
|
||||||
if (!playerCop.IsLoggedIn()) continue;
|
|
||||||
|
|
||||||
User cop = playerCop.GetUser();
|
player.TriggerEvent("BN_ShowWithPicture", "Abgetaucht", "Lester", "Du hast erfolgreich ein Wanted ~y~abgetaucht", "CHAR_LESTER", 1, true);
|
||||||
if (cop != null && (cop.FactionId == 1 || cop.FactionId == 3))
|
|
||||||
{
|
|
||||||
if (cop.GetData<bool>("duty") && playerCop.Position.DistanceTo2D(player.Position) <= 500)
|
|
||||||
{
|
|
||||||
//Schriftzug 'abgetaucht' zerstören :(
|
|
||||||
isNearCop = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
//Hier abgetaucht schriftzug einfügen :)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!waTimer.ContainsKey(user.Id))
|
|
||||||
waTimer[user.Id] = 300000;
|
|
||||||
|
|
||||||
if (waTimer[user.Id] <= 0)
|
|
||||||
{
|
|
||||||
ResetWantedTimeToElapse(user);
|
|
||||||
player.SendChatMessage("~y~Du hast erfolgreich einen Wanted abgetaucht.");
|
|
||||||
user.Wanteds -= 1;
|
user.Wanteds -= 1;
|
||||||
if (user.Wanteds == 0)
|
if (user.Wanteds == 0)
|
||||||
{
|
{
|
||||||
@@ -75,20 +32,6 @@ namespace ReallifeGamemode.Server.Wanted
|
|||||||
user.SetBlipAndNametagColor();
|
user.SetBlipAndNametagColor();
|
||||||
}
|
}
|
||||||
dbContext.SaveChanges();
|
dbContext.SaveChanges();
|
||||||
waTimer[user.Id] = WantedEscapeTime;
|
|
||||||
}
|
|
||||||
else if (!isNearCop && !player.IsAfk())
|
|
||||||
{
|
|
||||||
player.TriggerEvent("SERVER:SetWantedFlash", true);
|
|
||||||
waTimer[user.Id] -= 2500;
|
|
||||||
}
|
|
||||||
else if (isNearCop)
|
|
||||||
{
|
|
||||||
player.TriggerEvent("SERVER:SetWantedFlash", false);
|
|
||||||
ResetWantedTimeToElapse(user);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,6 +41,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ReallifeGamemode.Server.Log
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ReallifeGamemode.Server.Core.Extensions", "ReallifeGamemode.Server.Core.Extensions\ReallifeGamemode.Server.Core.Extensions.csproj", "{C21396B2-31D3-47C5-8D87-651FA16E60FD}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ReallifeGamemode.Server.Core.Extensions", "ReallifeGamemode.Server.Core.Extensions\ReallifeGamemode.Server.Core.Extensions.csproj", "{C21396B2-31D3-47C5-8D87-651FA16E60FD}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReallifeGamemode.Client.Core", "ReallifeGamemode.Client.Core\ReallifeGamemode.Client.Core.csproj", "{EF0A3ED3-FA93-4FFA-B080-C92FE556D7F1}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
@@ -288,6 +290,24 @@ Global
|
|||||||
{C21396B2-31D3-47C5-8D87-651FA16E60FD}.ServerBuild|x64.Build.0 = Debug|Any CPU
|
{C21396B2-31D3-47C5-8D87-651FA16E60FD}.ServerBuild|x64.Build.0 = Debug|Any CPU
|
||||||
{C21396B2-31D3-47C5-8D87-651FA16E60FD}.ServerBuild|x86.ActiveCfg = Release|Any CPU
|
{C21396B2-31D3-47C5-8D87-651FA16E60FD}.ServerBuild|x86.ActiveCfg = Release|Any CPU
|
||||||
{C21396B2-31D3-47C5-8D87-651FA16E60FD}.ServerBuild|x86.Build.0 = Release|Any CPU
|
{C21396B2-31D3-47C5-8D87-651FA16E60FD}.ServerBuild|x86.Build.0 = Release|Any CPU
|
||||||
|
{EF0A3ED3-FA93-4FFA-B080-C92FE556D7F1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{EF0A3ED3-FA93-4FFA-B080-C92FE556D7F1}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{EF0A3ED3-FA93-4FFA-B080-C92FE556D7F1}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||||
|
{EF0A3ED3-FA93-4FFA-B080-C92FE556D7F1}.Debug|x64.Build.0 = Debug|Any CPU
|
||||||
|
{EF0A3ED3-FA93-4FFA-B080-C92FE556D7F1}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||||
|
{EF0A3ED3-FA93-4FFA-B080-C92FE556D7F1}.Debug|x86.Build.0 = Debug|Any CPU
|
||||||
|
{EF0A3ED3-FA93-4FFA-B080-C92FE556D7F1}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{EF0A3ED3-FA93-4FFA-B080-C92FE556D7F1}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{EF0A3ED3-FA93-4FFA-B080-C92FE556D7F1}.Release|x64.ActiveCfg = Release|Any CPU
|
||||||
|
{EF0A3ED3-FA93-4FFA-B080-C92FE556D7F1}.Release|x64.Build.0 = Release|Any CPU
|
||||||
|
{EF0A3ED3-FA93-4FFA-B080-C92FE556D7F1}.Release|x86.ActiveCfg = Release|Any CPU
|
||||||
|
{EF0A3ED3-FA93-4FFA-B080-C92FE556D7F1}.Release|x86.Build.0 = Release|Any CPU
|
||||||
|
{EF0A3ED3-FA93-4FFA-B080-C92FE556D7F1}.ServerBuild|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{EF0A3ED3-FA93-4FFA-B080-C92FE556D7F1}.ServerBuild|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{EF0A3ED3-FA93-4FFA-B080-C92FE556D7F1}.ServerBuild|x64.ActiveCfg = Debug|Any CPU
|
||||||
|
{EF0A3ED3-FA93-4FFA-B080-C92FE556D7F1}.ServerBuild|x64.Build.0 = Debug|Any CPU
|
||||||
|
{EF0A3ED3-FA93-4FFA-B080-C92FE556D7F1}.ServerBuild|x86.ActiveCfg = Debug|Any CPU
|
||||||
|
{EF0A3ED3-FA93-4FFA-B080-C92FE556D7F1}.ServerBuild|x86.Build.0 = Debug|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
|||||||
Reference in New Issue
Block a user