Merge branch 'develop' into 'master'
0.0.7 See merge request log-gtav/reallife-gamemode!60
This commit is contained in:
@@ -122,3 +122,5 @@ csharp_preserve_single_line_blocks = true
|
||||
[*.vb]
|
||||
# Modifier preferences
|
||||
visual_basic_preferred_modifier_order = Partial,Default,Private,Protected,Public,Friend,NotOverridable,Overridable,MustOverride,Overloads,Overrides,MustInherit,NotInheritable,Static,Shared,Shadows,ReadOnly,WriteOnly,Dim,Const,WithEvents,Widening,Narrowing,Custom,Async:suggestion
|
||||
[*.js]
|
||||
encoding=utf-8-bom
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -336,7 +336,7 @@ ASALocalRun/
|
||||
launchSettings.json
|
||||
|
||||
tmp/
|
||||
index.js
|
||||
ReallifeGamemode.Client/index.js
|
||||
|
||||
# post build config
|
||||
postbuild.config.xml
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as NativeUI from '../libs/NativeUI';
|
||||
import * as NativeUI from '../libs/NativeUI';
|
||||
const Menu = NativeUI.Menu;
|
||||
const UIMenuItem = NativeUI.UIMenuItem;
|
||||
const UIMenuListItem = NativeUI.UIMenuListItem;
|
||||
@@ -37,6 +37,8 @@ export default function carDealer(globalData: IGlobalData) {
|
||||
var text = label.text.replace("SHOPVEHICLE", realName);
|
||||
label.text = text;
|
||||
|
||||
entity.setOnGroundProperly();
|
||||
entity.setExplodesOnHighExplosionDamage(false);
|
||||
entity.freezePosition(true);
|
||||
}
|
||||
|
||||
@@ -62,7 +64,7 @@ export default function carDealer(globalData: IGlobalData) {
|
||||
shopMenu.AddItem(priceItem);
|
||||
|
||||
var targetsCollection = new ItemsCollection(availableOptions);
|
||||
var targetItem = new UIMenuListItem("Kaufen f<EFBFBD>r", "W<EFBFBD>hle den Besitzer aus", targetsCollection);
|
||||
var targetItem = new UIMenuListItem("Kaufen für", "Wähle den Besitzer aus", targetsCollection);
|
||||
shopMenu.AddItem(targetItem);
|
||||
|
||||
shopMenu.ListChange.on((item, index) => {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const fathers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 42, 43, 44];
|
||||
const fathers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 42, 43, 44];
|
||||
const mothers = [21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 45];
|
||||
const fatherNames = ["Benjamin", "Daniel", "Joshua", "Noah", "Andrew", "Juan", "Alex", "Isaac", "Evan", "Ethan", "Vincent", "Angel", "Diego", "Adrian", "Gabriel", "Michael", "Santiago", "Kevin", "Louis", "Samuel", "Anthony", "Claude", "Niko", "John"];
|
||||
const motherNames = ["Hannah", "Aubrey", "Jasmine", "Gisele", "Amelia", "Isabella", "Zoe", "Ava", "Camila", "Violet", "Sophia", "Evelyn", "Nicole", "Ashley", "Gracie", "Brianna", "Natalie", "Olivia", "Elizabeth", "Charlotte", "Emma", "Misty"];
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// shitcode will be better in the future
|
||||
// shitcode will be better in the future
|
||||
// , \u00dc, \u00fc
|
||||
// , \u00c4, \u00e4
|
||||
// , \u00d6, \u00f6
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import InputHelper from '../../inputhelper';
|
||||
import InputHelper from '../../inputhelper';
|
||||
|
||||
export default function inventory(globalData: IGlobalData) {
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import InputHelper from '../../inputhelper';
|
||||
import InputHelper from '../../inputhelper';
|
||||
|
||||
export default function inventory(globalData: IGlobalData) {
|
||||
var q;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
/**
|
||||
* @overview Life of German Reallife - Gui Infobox infobox.js
|
||||
* @author VegaZ
|
||||
* @copyright (c) 2008 - 2018 Life of German
|
||||
@@ -68,7 +68,7 @@ export default function deathScreen() {
|
||||
|
||||
var medicString;
|
||||
if (dutyMedics > 0) {
|
||||
medicString = "Das L.S.E.D. wurde benachrichtigt\nDerzeit";
|
||||
medicString = "Das L.S.E.D. wurde benachrichtigt\nDerzeit ";
|
||||
if (dutyMedics === 1) {
|
||||
medicString += "befindet sich ~g~" + dutyMedics + " Mitglied";
|
||||
} else {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* @overview Life of German Reallife - Gui Infobox infobox.js
|
||||
* @author VegaZ
|
||||
* @copyright (c) 2008 - 2018 Life of German
|
||||
*/
|
||||
* @overview Life of German Reallife - Gui Infobox infobox.js
|
||||
* @author VegaZ
|
||||
* @copyright (c) 2008 - 2018 Life of German
|
||||
*/
|
||||
|
||||
import moneyFormat from "../moneyformat";
|
||||
|
||||
@@ -16,6 +16,7 @@ export default function (globalData: IGlobalData): void {
|
||||
var adutyMode = false;
|
||||
var adminUnshow = false;
|
||||
var adminTSupport = false;
|
||||
var noDmZone = false;
|
||||
var dutyMode = false;
|
||||
let jailTime = 0;
|
||||
let att_score = 0;
|
||||
@@ -27,6 +28,7 @@ export default function (globalData: IGlobalData): void {
|
||||
var cdTimestamp;
|
||||
var countdownText;
|
||||
var blackScreenMode = false;
|
||||
let spawnschutz = false;
|
||||
|
||||
let posX = 0.92;
|
||||
let posY = 0.45;
|
||||
@@ -84,6 +86,14 @@ export default function (globalData: IGlobalData): void {
|
||||
blackScreenMode = toggle;
|
||||
});
|
||||
|
||||
mp.events.add("toggleNoDmZone", (toggle) => {
|
||||
noDmZone = toggle;
|
||||
});
|
||||
|
||||
mp.events.add("toggleSpawnschutz", (toggle) => {
|
||||
spawnschutz = toggle;
|
||||
});
|
||||
|
||||
mp.events.add("jailTime", (time) => {
|
||||
jailTime = JSON.parse(time);
|
||||
});
|
||||
@@ -345,6 +355,28 @@ export default function (globalData: IGlobalData): void {
|
||||
})
|
||||
}
|
||||
|
||||
if (noDmZone) {
|
||||
mp.game.graphics.drawText("~r~NoDM Zone", [0.92, 0.7],
|
||||
{
|
||||
font: 2,
|
||||
color: [255, 255, 255, 255],
|
||||
scale: [0.7, 0.7],
|
||||
outline: true,
|
||||
centre: false
|
||||
})
|
||||
}
|
||||
|
||||
if (spawnschutz) {
|
||||
mp.game.graphics.drawText("~r~Spawnschutz", [0.92, 0.75],
|
||||
{
|
||||
font: 2,
|
||||
color: [255, 255, 255, 255],
|
||||
scale: [0.7, 0.7],
|
||||
outline: true,
|
||||
centre: false
|
||||
})
|
||||
}
|
||||
|
||||
if (countdown > 0) {
|
||||
var now = Date.now();
|
||||
var diff = Math.trunc((now - cdTimestamp) / 1000);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import game from "..";
|
||||
import game from "..";
|
||||
import { Key } from "../game";
|
||||
|
||||
var interiorId = -1;
|
||||
@@ -14,7 +14,7 @@ game.events.add('SERVER:InteriorManager_ClearHelpText', () => {
|
||||
|
||||
game.events.add('SERVER:InteriorManager_ShowHelpText', (interior, intId, entEx) => {
|
||||
//game.ui.setHelpText('Drücke ~INPUT_CONTEXT~, um ~b~' + interior + ' ~s~zu ' + (entEx === 0 ? 'betreten' : 'verlassen'));
|
||||
helpText = "~s~Drücke ~g~E~s~ um ~b~" + interior + " ~s~zu " + (entEx === 0 ? "betreten" : "verlassen");
|
||||
helpText = "~s~Drücke ~g~E~s~, um ~b~" + interior + " ~s~zu " + (entEx === 0 ? "betreten" : "verlassen");
|
||||
mp.events.call("renderHelpTextOnScreen", helpText)
|
||||
interiorId = intId;
|
||||
enterExit = entEx;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
/**
|
||||
* @overview Life of German Reallife - Gui Playerlist playerlist.js
|
||||
* @author VegaZ. Siga.
|
||||
* @copyright (c) 2008 - 2018 Life of German
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import InputHelper from '../inputhelper';
|
||||
import InputHelper from '../inputhelper';
|
||||
|
||||
let browser: BrowserMp;
|
||||
let price: Number;
|
||||
|
||||
@@ -1,11 +1,19 @@
|
||||
export default function wanteds(globalData: IGlobalData) {
|
||||
let wantedCount = 0;
|
||||
|
||||
export default function wanteds(globalData: IGlobalData) {
|
||||
var browser = mp.browsers.new("package://assets/html/wanteds/index.html");
|
||||
|
||||
mp.events.add("SERVER:SetWanteds", (count: number) => {
|
||||
browser.execute(`setWanteds(${count});`);
|
||||
wantedCount = count;
|
||||
});
|
||||
|
||||
|
||||
mp.events.add("SERVER:SetWantedFlash", (flash) => {
|
||||
browser.execute(`setFlashing(${flash});`);
|
||||
});
|
||||
}
|
||||
|
||||
export function getWantedCount(): number {
|
||||
return wantedCount;
|
||||
}
|
||||
@@ -19,16 +19,28 @@ let cancelItem = new UIMenuItem("Abbrechen", "");
|
||||
cancelItem.BackColor = new Color(213, 0, 0);
|
||||
cancelItem.HighlightedBackColor = new Color(229, 57, 53);
|
||||
|
||||
var routeMenu: NativeUI.Menu;
|
||||
var busRouteSelectColShape = mp.colshapes.newCircle(-535, -2144, 2.5);
|
||||
|
||||
export default function busRouteList(globalData: IGlobalData) {
|
||||
var routeMenu: NativeUI.Menu;
|
||||
var skillSelect;
|
||||
var routeSelect;
|
||||
var skill = 0;
|
||||
var routeSelected = false;
|
||||
|
||||
mp.events.add(RageEnums.EventKey.PLAYER_EXIT_COLSHAPE, (colshape) => {
|
||||
if (colshape == busRouteSelectColShape) {
|
||||
if (routeMenu && routeMenu.Visible) {
|
||||
routeMenu.Close();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
mp.events.add('SERVER:StartBusJob', (jobskill) => {
|
||||
skill = jobskill;
|
||||
if (!globalData.InMenu) {
|
||||
globalData.InMenu = true;
|
||||
|
||||
skillSelect = ["Anfänger", "Fortgeschrittener", "Profi"];
|
||||
|
||||
routeMenu = new Menu("Bus Job", "", new Point(0, screenRes.y / 3), null, null);
|
||||
@@ -59,20 +71,23 @@ export default function busRouteList(globalData: IGlobalData) {
|
||||
else
|
||||
{
|
||||
mp.events.callRemote("CLIENT:StartBusRoute", routeSelect);
|
||||
routeSelected = true;
|
||||
routeMenu.Close();
|
||||
globalData.InMenu = false;
|
||||
}
|
||||
|
||||
|
||||
} else if (item.Text === "Abbrechen") {
|
||||
mp.events.callRemote("CLIENT:Job_StopJob");
|
||||
|
||||
routeMenu.Close();
|
||||
globalData.InMenu = false;
|
||||
}
|
||||
});
|
||||
|
||||
routeMenu.MenuClose.on(() => {
|
||||
if (!routeSelected) {
|
||||
mp.events.callRemote("CLIENT:Job_StopJob");
|
||||
}
|
||||
routeSelected = false;
|
||||
|
||||
globalData.InMenu = false;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
/**
|
||||
* @overview Life of German Reallife - Login Main main.js
|
||||
* @author VegaZ, hydrant
|
||||
* @author VegaZ, hydrant, balbo
|
||||
* @copyright (c) 2008 - 2018 Life of German
|
||||
*/
|
||||
import { getWantedCount } from "../Gui/wanteds";
|
||||
|
||||
export default function (globalData: IGlobalData): void {
|
||||
var loginBrowser: BrowserMp;
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
let distance = mp.game.gameplay.getDistanceBetweenCoords(lp.x, lp.y, lp.z, np.x, np.y, np.z, false);
|
||||
|
||||
if (distance <= 5) {
|
||||
if (distance <= 1.5) {
|
||||
if (!afkStatus) {
|
||||
afkCounter++;
|
||||
}
|
||||
|
||||
11
ReallifeGamemode.Client/Player/handsup.ts
Normal file
11
ReallifeGamemode.Client/Player/handsup.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
export default function handsup() {
|
||||
mp.events.add("SERVER:Handsup_CheckIfPlayerCanHandsup", () => {
|
||||
var player = mp.players.local;
|
||||
|
||||
var isStopped = player.isStopped();
|
||||
|
||||
if (isStopped) {
|
||||
mp.events.callRemote("CLIENT:Handsup_TogglePlayerHup");
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -138,7 +138,7 @@ export default function keys(globalData: IGlobalData) {
|
||||
});
|
||||
|
||||
mp.keys.bind(0x7A, false, () => {
|
||||
mp.gui.takeScreenshot(new Date().toLocaleDateString(), 1, 100, 80);
|
||||
mp.gui.takeScreenshot(new Date().toLocaleTimeString() + ".png", 1, 100, 80);
|
||||
});
|
||||
|
||||
KeyBinder.bind("ctrl+h", () => {
|
||||
|
||||
94
ReallifeGamemode.Client/Player/polygons.ts
Normal file
94
ReallifeGamemode.Client/Player/polygons.ts
Normal file
@@ -0,0 +1,94 @@
|
||||
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 busbaseVector2 = new mp.Vector3(-584.9822, -2072.467, 5.9921026);
|
||||
const busbaseVector3 = new mp.Vector3(-669.1689, -2172.7917, 6.009973);
|
||||
const busbaseVector4 = new mp.Vector3(-600.4804, -2230.3953, 6.213662);
|
||||
|
||||
const stadthalleVector1 = new mp.Vector3(-464.26273, -242.73814, 35.946384);
|
||||
const stadthalleVector2 = new mp.Vector3(-505.32938, -170.14832, 37.859695);
|
||||
const stadthalleVector3 = new mp.Vector3(-589.5164, -224.41574, 36.648193);
|
||||
const stadthalleVector4 = new mp.Vector3(-556.6909, -280.71564, 35.163292);
|
||||
|
||||
const fahrschuleVector1 = new mp.Vector3(-812.13043, -1406.9983, 4.9805145);
|
||||
const fahrschuleVector2 = new mp.Vector3(-727.035, -1305.2482, 5.084054);
|
||||
const fahrschuleVector3 = new mp.Vector3(-757.4177, -1279.31, 5.1093183);
|
||||
const fahrschuleVector4 = new mp.Vector3(-832.14087, -1268.561, 4.9827914);
|
||||
const fahrschuleVector5 = new mp.Vector3(-856.8085, -1286.7786, 6.474576);
|
||||
|
||||
const pilotAnfaengerVector1 = new mp.Vector3(1759.6045, 3305.2988, 41.1526);
|
||||
const pilotAnfaengerVector2 = new mp.Vector3(1785.29944, 3230.2786, 42.553444);
|
||||
const pilotAnfaengerVector3 = new mp.Vector3(1655.139, 3198.6257, 42.723602);
|
||||
const pilotAnfaengerVector4 = new mp.Vector3(1624.4799, 3294.2612, 39.53612);
|
||||
|
||||
const pilotProfiVector1 = new mp.Vector3(-1595.5433, -3130.2798, 13.944942);
|
||||
const pilotProfiVector2 = new mp.Vector3(-1679.6715, -3082.12, 13.948778);
|
||||
const pilotProfiVector3 = new mp.Vector3(-1728.0858, -3164.9736, 14.055883);
|
||||
const pilotProfiVector4 = new mp.Vector3(-1640.4034, -3213.0503, 13.8741665);
|
||||
|
||||
const muellbaseVector1 = new mp.Vector3(521.6251, -2194.5068, 5.985945);
|
||||
const muellbaseVector2 = new mp.Vector3(454.88348, -2158.1938, 5.9788494);
|
||||
const muellbaseVector3 = new mp.Vector3(529.06635, -2088.4097, 8.303088);
|
||||
|
||||
const polygon_busbase = polygons.add([busbaseVector1, busbaseVector2, busbaseVector3, busbaseVector4], 15, false, [255, 155, 0, 255], 0);
|
||||
const polygon_stadthalle = polygons.add([stadthalleVector1, stadthalleVector2, stadthalleVector3, stadthalleVector4], 15, false, [255, 155, 0, 255], 0);
|
||||
const polygon_fahrschule = polygons.add([fahrschuleVector1, fahrschuleVector2, fahrschuleVector3, fahrschuleVector4, fahrschuleVector5], 15, false, [255, 155, 0, 255], 0);
|
||||
const polygon_pilotAnfaenger = polygons.add([pilotAnfaengerVector1, pilotAnfaengerVector2, pilotAnfaengerVector3, pilotAnfaengerVector4], 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_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 isInAnyNoDMPolygon;
|
||||
|
||||
export default function polygonHandler() {
|
||||
|
||||
mp.events.add('playerEnterPolygon', (polygon) => {
|
||||
|
||||
if (listNoDMZones.indexOf(polygon) != -1){
|
||||
mp.events.call('toggleNoDmZone', true);
|
||||
isInAnyNoDMPolygon = true;
|
||||
}
|
||||
});
|
||||
|
||||
mp.events.add('playerLeavePolygon', (polygon) => {
|
||||
|
||||
if (listNoDMZones.indexOf(polygon) != -1) {
|
||||
mp.events.call('toggleNoDmZone', false);
|
||||
isInAnyNoDMPolygon = false;
|
||||
}
|
||||
|
||||
if (polygon == polygon_prison) {
|
||||
mp.events.callRemote("SERVER:BreakOutIfInPrison");
|
||||
}
|
||||
});
|
||||
}
|
||||
24
ReallifeGamemode.Client/Player/spawnschutz.ts
Normal file
24
ReallifeGamemode.Client/Player/spawnschutz.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
export let spawnschutzEnabled = true;
|
||||
var spawnschutzTimer;
|
||||
|
||||
export default function spawnschutz() {
|
||||
|
||||
mp.events.add("enableSpawnschutz", () => {
|
||||
spawnschutzEnabled = true;
|
||||
mp.events.call("toggleSpawnschutz", true);
|
||||
mp.events.call("triggerSpawnschutzTimer");
|
||||
});
|
||||
|
||||
mp.events.add("abortSpawnschutz", () => {
|
||||
spawnschutzEnabled = false;
|
||||
mp.events.call("toggleSpawnschutz", false);
|
||||
clearInterval(spawnschutzTimer);
|
||||
});
|
||||
|
||||
mp.events.add("triggerSpawnschutzTimer", () => {
|
||||
spawnschutzTimer = setTimeout(() => {
|
||||
mp.events.call("toggleSpawnschutz", false);
|
||||
spawnschutzEnabled = false;
|
||||
}, 60000);
|
||||
});
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as NativeUI from '../libs/NativeUI';
|
||||
import * as NativeUI from '../libs/NativeUI';
|
||||
|
||||
const Menu = NativeUI.Menu;
|
||||
const UIMenuItem = NativeUI.UIMenuItem;
|
||||
@@ -10,7 +10,7 @@ const ItemsCollection = NativeUI.ItemsCollection;
|
||||
const Color = NativeUI.Color;
|
||||
|
||||
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.HighlightedBackColor = new Color(25, 118, 210);
|
||||
|
||||
@@ -131,7 +131,7 @@ export default function weaponList(globalData: IGlobalData) {
|
||||
|
||||
|
||||
weaponMenu.ItemSelect.on((item) => {
|
||||
if (item.Text === "Waffen Nehmen") {
|
||||
if (item.Text === "Waffen nehmen") {
|
||||
mp.events.callRemote("saveWeaponSelection", primary, secondary, melee, specialWep, armor);
|
||||
weaponMenu.Close();
|
||||
globalData.InMenu = false;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
let player = mp.players.local;
|
||||
let player = mp.players.local;
|
||||
|
||||
export default function speedometer(globalData: IGlobalData) {
|
||||
var dictLoaded = false;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const vehicleColors = {
|
||||
const vehicleColors = {
|
||||
"Klassisch (Util)": {
|
||||
"Schwarz": 15,
|
||||
"Silber": 18,
|
||||
@@ -126,7 +126,7 @@ const vehicleColors = {
|
||||
"Lila": 148,
|
||||
"Dunkellila": 149,
|
||||
"W\u00fcstenbraun": 153,
|
||||
"W\u00fcstenbr<62>une": 154
|
||||
"W\u00fcstenbr<62>une": 154
|
||||
},
|
||||
"Spezial": {
|
||||
"Geb\u00fcrsteter Stahl": 117,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
/**
|
||||
* @overview Life of German Reallife - Voice Main main.ts
|
||||
* @author Zeuto
|
||||
* @copyright (c) 2008 - 2019 Life of German
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
});
|
||||
|
||||
mp.events.add("client:checkInvincible", () => {
|
||||
if (mp.players.local.dimension == 0) return
|
||||
//if (mp.players.local.dimension == 0) return
|
||||
if (!Behaviour.active) return
|
||||
var healthBefore = Behaviour.health
|
||||
mp.players.local.applyDamageTo(1, true);
|
||||
@@ -49,9 +49,9 @@
|
||||
}, 500);
|
||||
})
|
||||
|
||||
setInterval(() => {
|
||||
mp.events.call("client:checkInvincible")
|
||||
}, 30000);
|
||||
//setInterval(() => {
|
||||
// mp.events.call("client:checkInvincible")
|
||||
//}, 30000);
|
||||
|
||||
mp.events.add('SERVER:AntiCheat:weaponSwap', () => {
|
||||
Behaviour.resetWeapon()
|
||||
@@ -62,7 +62,7 @@
|
||||
mp.events.callRemote("CLIENT:CheatDetection", "Unallowed Weapon", Behaviour.weapon)
|
||||
}
|
||||
if (Behaviour.reloadingWeapon) {
|
||||
mp.events.callRemote("CLIENT:CheatDetection", "No Reload")
|
||||
//mp.events.callRemote("CLIENT:CheatDetection", "No Reload")
|
||||
Behaviour.resetWeapon()
|
||||
}
|
||||
Behaviour.updateMagSize()
|
||||
@@ -182,9 +182,24 @@
|
||||
var Behaviour = new PlayerBehaviour()
|
||||
var loop = Behaviour.secs()
|
||||
|
||||
function isUsingController() {
|
||||
return !mp.game.controls.isInputDisabled(0);
|
||||
}
|
||||
|
||||
mp.events.add("render", () => {
|
||||
mp.game.player.setHealthRechargeMultiplier(0);
|
||||
|
||||
if (isUsingController()) {
|
||||
mp.game.controls.disableControlAction(32, 24, true);
|
||||
mp.game.controls.disableControlAction(32, 25, true);
|
||||
|
||||
mp.game.controls.disableControlAction(32, 91, true);
|
||||
mp.game.controls.disableControlAction(32, 92, true);
|
||||
|
||||
mp.game.controls.disableControlAction(32, 69, true);
|
||||
mp.game.controls.disableControlAction(32, 70, true);
|
||||
}
|
||||
|
||||
Behaviour.health = Number(mp.players.local.getHealth()) + Number(mp.players.local.getArmour())
|
||||
if (loop < Behaviour.secs()) {
|
||||
if (Behaviour.active) {
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" type="text/css" href="style/checkbox.css" media="screen">
|
||||
<link rel="stylesheet" type="text/css" href="style/main.css" media="screen">
|
||||
<meta charset="utf-8" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="chat" class="ui_element">
|
||||
<ul id="chat_messages"></ul>
|
||||
</div>
|
||||
<script type="text/javascript" src="jquery-1.11.3.min.js"></script>
|
||||
<script src="js/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
108
ReallifeGamemode.Client/assets/css/chat/main.css
Normal file
108
ReallifeGamemode.Client/assets/css/chat/main.css
Normal file
@@ -0,0 +1,108 @@
|
||||
html {
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
*, *:before, *:after {
|
||||
-webkit-box-sizing: inherit;
|
||||
box-sizing: inherit;
|
||||
}
|
||||
|
||||
*, body, html {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#chat, a, body, html {
|
||||
color: white;
|
||||
}
|
||||
|
||||
body, html {
|
||||
-webkit-font-smoothing: antialiased;
|
||||
overflow: hidden;
|
||||
font-size: 14px;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
|
||||
font-size: calc(.75em + .3vw);
|
||||
font-weight: 500;
|
||||
direction: ltr;
|
||||
}
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.ui_element {
|
||||
display: none;
|
||||
position: absolute;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
#chat {
|
||||
display: block;
|
||||
z-index: 0;
|
||||
line-height: 1.25;
|
||||
text-shadow: 1px 1px 0 #000,-1px -1px 0 #000,1px -1px 0 #000,-1px 1px 0 #000,1px 1px 0 #000;
|
||||
letter-spacing: .4px;
|
||||
margin-top: 1em;
|
||||
margin-left: 1em;
|
||||
}
|
||||
|
||||
#chat ul#chat_messages {
|
||||
height: 16.45em;
|
||||
min-width: 50ch;
|
||||
max-width: calc(45vw + 10px);
|
||||
-webkit-transform: rotate(0deg);
|
||||
transform: rotate(0deg);
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
word-break: break-all;
|
||||
list-style-type: none;
|
||||
margin-bottom: .25em;
|
||||
}
|
||||
|
||||
#chat ul#chat_messages > li {
|
||||
-webkit-transform: rotate(0deg);
|
||||
transform: rotate(0deg);
|
||||
margin-bottom: .125em;
|
||||
}
|
||||
|
||||
#chat ul#chat_messages > li:last-child {
|
||||
margin-bottom: .25em;
|
||||
}
|
||||
|
||||
#chat input#chat_msg {
|
||||
width: 45vw;
|
||||
outline: 0;
|
||||
border: none;
|
||||
border-radius: 3px;
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
font-weight: inherit;
|
||||
line-height: 1;
|
||||
color: white;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
padding: .25em .5em .5em;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar {
|
||||
width: 10px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
background: rgba(255, 17, 0, 0);
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
background: rgba(255, 17, 0, 0);
|
||||
}
|
||||
/*# sourceMappingURL=main.css.map */
|
||||
9
ReallifeGamemode.Client/assets/css/chat/main.css.map
Normal file
9
ReallifeGamemode.Client/assets/css/chat/main.css.map
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"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;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,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,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,eAAe;CACzB;;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",
|
||||
"sources": [
|
||||
"main.scss"
|
||||
],
|
||||
"names": [],
|
||||
"file": "main.css"
|
||||
}
|
||||
95
ReallifeGamemode.Client/assets/css/chat/main.scss
Normal file
95
ReallifeGamemode.Client/assets/css/chat/main.scss
Normal file
@@ -0,0 +1,95 @@
|
||||
html { box-sizing: border-box; }
|
||||
*, *:before, *:after { box-sizing: inherit; }
|
||||
|
||||
|
||||
*, body, html {
|
||||
padding: 0;
|
||||
margin: 0
|
||||
}
|
||||
|
||||
#chat, a, body, html { color: white; }
|
||||
|
||||
body, html {
|
||||
-webkit-font-smoothing: antialiased;
|
||||
overflow: hidden;
|
||||
font-size: 14px;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
|
||||
font-size: calc(.75em + .3vw);
|
||||
font-weight: 500;
|
||||
direction: ltr;
|
||||
}
|
||||
|
||||
a { text-decoration: none; }
|
||||
|
||||
.ui_element {
|
||||
display: none;
|
||||
position: absolute;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
z-index: 2
|
||||
}
|
||||
|
||||
#chat {
|
||||
display: block;
|
||||
z-index: 0;
|
||||
|
||||
line-height: 1.25;
|
||||
text-shadow: 1px 1px 0 #000,-1px -1px 0 #000,1px -1px 0 #000,-1px 1px 0 #000,1px 1px 0 #000;
|
||||
letter-spacing: .4px;
|
||||
|
||||
margin-top: 1em;
|
||||
margin-left: 1em;
|
||||
|
||||
ul#chat_messages {
|
||||
height: 16.45em;
|
||||
min-width: 50ch;
|
||||
max-width: calc(45vw + 10px);
|
||||
transform: rotate(0deg);
|
||||
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
word-break: break-all;
|
||||
|
||||
list-style-type: none;
|
||||
margin-bottom: .25em;
|
||||
|
||||
&> li {
|
||||
transform: rotate(0deg);
|
||||
margin-bottom: .125em;
|
||||
|
||||
&:last-child { margin-bottom: .25em; }
|
||||
}
|
||||
}
|
||||
|
||||
input#chat_msg {
|
||||
width: 45vw;
|
||||
outline: 0;
|
||||
border: none;
|
||||
border-radius: 3px;
|
||||
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
font-weight: inherit;
|
||||
line-height: 1;
|
||||
|
||||
color: white;
|
||||
background: rgba(0, 0, 0, .5);
|
||||
|
||||
padding: .25em .5em .5em;
|
||||
}
|
||||
}
|
||||
|
||||
::-webkit-scrollbar {
|
||||
width: 10px;
|
||||
|
||||
&-thumb {
|
||||
background: rgba(255, 17, 0, 0);
|
||||
border-radius: 3px;
|
||||
|
||||
&:hover { background: rgba(255, 17, 0, 0); }
|
||||
}
|
||||
}
|
||||
@@ -1,122 +1,138 @@
|
||||
html {
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
user-select: none;
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
*, *::before, *::after {
|
||||
-webkit-box-sizing: inherit;
|
||||
box-sizing: inherit;
|
||||
-webkit-box-sizing: inherit;
|
||||
box-sizing: inherit;
|
||||
}
|
||||
|
||||
body {
|
||||
display: -webkit-box;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-box-direction: normal;
|
||||
-ms-flex-direction: column;
|
||||
flex-direction: column;
|
||||
-webkit-box-pack: center;
|
||||
-ms-flex-pack: center;
|
||||
justify-content: center;
|
||||
height: 100vh;
|
||||
width: -webkit-fit-content;
|
||||
width: -moz-fit-content;
|
||||
width: fit-content;
|
||||
margin: 0 auto;
|
||||
padding: 1em .5em;
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
|
||||
font-weight: 400;
|
||||
color: #FFF;
|
||||
|
||||
display: -webkit-box;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-box-direction: normal;
|
||||
-ms-flex-direction: column;
|
||||
flex-direction: column;
|
||||
-webkit-box-pack: center;
|
||||
-ms-flex-pack: center;
|
||||
justify-content: center;
|
||||
height: 100vh;
|
||||
width: -webkit-fit-content;
|
||||
width: -moz-fit-content;
|
||||
width: fit-content;
|
||||
margin: 0 auto;
|
||||
padding: 1em .5em;
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
|
||||
font-weight: 400;
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
main {
|
||||
height: auto;
|
||||
position: relative;
|
||||
min-width: 50ch;
|
||||
max-width: 35vw;
|
||||
padding: 1em;
|
||||
border-radius: .25em;
|
||||
font-size: 1em;
|
||||
line-height: 1.25;
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
|
||||
height: auto;
|
||||
max-height: 60vh;
|
||||
position: relative;
|
||||
min-width: 45ch;
|
||||
max-width: 30vw;
|
||||
padding: 1em;
|
||||
border-radius: .25em;
|
||||
font-size: 1em;
|
||||
line-height: 1.25;
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
|
||||
main a#close {
|
||||
position: absolute;
|
||||
right: 1em;
|
||||
top: 1em;
|
||||
height: 1em;
|
||||
width: 1em;
|
||||
opacity: 0.25;
|
||||
main a#close {
|
||||
position: absolute;
|
||||
right: 1em;
|
||||
top: 1em;
|
||||
height: 1em;
|
||||
width: 1em;
|
||||
opacity: 0.25;
|
||||
}
|
||||
|
||||
main a#close:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
main a#close:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
main a#close:before, main a#close:after {
|
||||
content: ' ';
|
||||
position: absolute;
|
||||
left: .5em;
|
||||
height: 1em;
|
||||
width: 2px;
|
||||
background-color: #FFF;
|
||||
border-radius: 1px;
|
||||
}
|
||||
|
||||
main a#close:before {
|
||||
-webkit-transform: rotate(45deg);
|
||||
transform: rotate(45deg);
|
||||
}
|
||||
|
||||
main a#close:after {
|
||||
-webkit-transform: rotate(-45deg);
|
||||
transform: rotate(-45deg);
|
||||
}
|
||||
|
||||
main h1, main p {
|
||||
margin: 0;
|
||||
main a#close:before, main a#close:after {
|
||||
content: ' ';
|
||||
position: absolute;
|
||||
left: .5em;
|
||||
height: 1em;
|
||||
width: 2px;
|
||||
background-color: #FFF;
|
||||
border-radius: 1px;
|
||||
}
|
||||
|
||||
main h1 {
|
||||
font-size: 1.5em;
|
||||
line-height: 1;
|
||||
margin-bottom: .125em;
|
||||
padding-right: 1em;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
main a#close:before {
|
||||
-webkit-transform: rotate(45deg);
|
||||
transform: rotate(45deg);
|
||||
}
|
||||
|
||||
main p {
|
||||
margin-bottom: 1em;
|
||||
line-height: 1.125;
|
||||
main a#close:after {
|
||||
-webkit-transform: rotate(-45deg);
|
||||
transform: rotate(-45deg);
|
||||
}
|
||||
|
||||
main .form {
|
||||
margin-top: .25em;
|
||||
main h1, main p {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
main h1 {
|
||||
font-size: 1.5em;
|
||||
line-height: 1.125;
|
||||
margin-bottom: .25em;
|
||||
padding-right: 1em;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
main p {
|
||||
margin-bottom: .5em;
|
||||
line-height: 1.125;
|
||||
max-height: 12em;
|
||||
overflow-y: auto;
|
||||
padding-right: .5em;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
main p::-webkit-scrollbar {
|
||||
width: 5px;
|
||||
}
|
||||
|
||||
main p::-webkit-scrollbar-track {
|
||||
background-color: rgba(0, 0, 0, .125);
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
main p::-webkit-scrollbar-thumb {
|
||||
background-color: rgba(0, 0, 0, .125);
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
main .form {
|
||||
margin-top: .25em;
|
||||
}
|
||||
|
||||
main .form input {
|
||||
width: 100%;
|
||||
padding: .5em;
|
||||
font-family: "Roboto Mono";
|
||||
font-weight: 500;
|
||||
font-size: 1em;
|
||||
border: none;
|
||||
border-radius: 5px;
|
||||
background-color: rgba(0, 0, 0, 0.125);
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
main .form input {
|
||||
width: 100%;
|
||||
padding: .5em;
|
||||
font-family: "Roboto Mono";
|
||||
font-weight: 500;
|
||||
font-size: 1em;
|
||||
border: none;
|
||||
border-radius: 5px;
|
||||
background-color: rgba(0, 0, 0, 0.125);
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
main .form input:focus {
|
||||
outline-width: 0;
|
||||
}
|
||||
main .form input:focus {
|
||||
outline-width: 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -19,8 +19,8 @@ html, body {
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 15vh auto 0;
|
||||
width: 32vw;
|
||||
margin: 10vh auto 0;
|
||||
width: 35vw;
|
||||
color: white;
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
|
||||
font-size: 1em;
|
||||
@@ -49,13 +49,23 @@ h2 {
|
||||
-webkit-box-align: start;
|
||||
-ms-flex-align: start;
|
||||
align-items: flex-start;
|
||||
margin-bottom: 1.5em;
|
||||
margin-bottom: 1em;
|
||||
padding: 1em 1em 0;
|
||||
}
|
||||
|
||||
.factions {
|
||||
position: -webkit-sticky;
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 3;
|
||||
font-size: .9em;
|
||||
background-color: #222;
|
||||
padding: 1em 0;
|
||||
}
|
||||
|
||||
.wrapper {
|
||||
min-height: 50vh;
|
||||
max-height: 70vh;
|
||||
min-height: 60vh;
|
||||
max-height: 80vh;
|
||||
overflow-y: scroll;
|
||||
border-radius: .25em;
|
||||
background-color: rgba(0, 0, 0, 0.75);
|
||||
@@ -74,10 +84,10 @@ table {
|
||||
table th {
|
||||
position: -webkit-sticky;
|
||||
position: sticky;
|
||||
top: 0;
|
||||
top: 3em;
|
||||
text-align: left;
|
||||
z-index: 2;
|
||||
background-color: black;
|
||||
background-color: #222;
|
||||
}
|
||||
|
||||
table th:first-child {
|
||||
@@ -203,18 +213,6 @@ ol.inline.stats {
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
ol.inline.stats:first-of-type {
|
||||
margin-top: 1em !important;
|
||||
}
|
||||
|
||||
ol.inline.stats:last-of-type {
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
|
||||
ol.inline.stats:not(:last-of-type) {
|
||||
margin-bottom: .125em;
|
||||
}
|
||||
|
||||
ol.inline.stats abbr {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"version": 3,
|
||||
"mappings": "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",
|
||||
"mappings": "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",
|
||||
"sources": [
|
||||
"style.scss"
|
||||
],
|
||||
|
||||
@@ -9,9 +9,9 @@ html, body { margin: unset; }
|
||||
*, *:before, *:after { box-sizing: inherit; }
|
||||
|
||||
body {
|
||||
margin: 15vh auto 0;
|
||||
margin: 10vh auto 0;
|
||||
|
||||
width: 32vw;
|
||||
width: 35vw;
|
||||
color: white;
|
||||
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
|
||||
@@ -30,17 +30,28 @@ h2 { font-size: 1.125em; }
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: flex-start;
|
||||
margin-bottom: 1.5em;
|
||||
margin-bottom: 1em;
|
||||
padding: 1em 1em 0;
|
||||
}
|
||||
|
||||
.factions {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 3;
|
||||
|
||||
font-size: .9em;
|
||||
background-color: #222;
|
||||
|
||||
padding: 1em 0;
|
||||
}
|
||||
|
||||
.wrapper {
|
||||
min-height: 50vh;
|
||||
max-height: 70vh;
|
||||
min-height: 60vh;
|
||||
max-height: 80vh;
|
||||
overflow-y: scroll;
|
||||
|
||||
border-radius: .25em;
|
||||
background-color: rgba(0, 0, 0, .75);
|
||||
background-color: rgba(black, .75);
|
||||
|
||||
&::-webkit-scrollbar { display: none; }
|
||||
}
|
||||
@@ -52,11 +63,11 @@ table {
|
||||
|
||||
th {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
top: 3em;
|
||||
text-align: left;
|
||||
z-index: 2;
|
||||
|
||||
background-color: black;
|
||||
background-color: #222;
|
||||
|
||||
&:first-child { border-top-left-radius: .25em; }
|
||||
&:last-child { border-top-right-radius: .25em; }
|
||||
@@ -130,9 +141,5 @@ ol.inline {
|
||||
ol.inline.stats {
|
||||
justify-content: center;
|
||||
|
||||
&:first-of-type { margin-top: 1em !important; }
|
||||
&:last-of-type { margin-bottom: 1em; }
|
||||
&:not(:last-of-type) { margin-bottom: .125em; }
|
||||
|
||||
abbr { text-decoration: none; }
|
||||
}
|
||||
16
ReallifeGamemode.Client/assets/html/chat/index.html
Normal file
16
ReallifeGamemode.Client/assets/html/chat/index.html
Normal file
@@ -0,0 +1,16 @@
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" type="text/css" href="package://assets/css/chat/checkbox.css" media="screen">
|
||||
<link rel="stylesheet" type="text/css" href="package://assets/css/chat/main.css" media="screen">
|
||||
<meta charset="utf-8" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="chat" class="ui_element">
|
||||
<ul id="chat_messages"></ul>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript" src="package://assets/js/chat/jquery-1.11.3.min.js"></script>
|
||||
<script src="package://assets/js/chat/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,4 +1,4 @@
|
||||
<!DOCTYPE html>
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
@@ -6,22 +6,25 @@
|
||||
<title>Eingabe | Life of German</title>
|
||||
|
||||
<link rel="stylesheet" href="package://assets/css/inputhelper/style.css" />
|
||||
<link rel="stylesheet" href="../../font/font-awesome/css/fontawesome.min.css">
|
||||
<link rel="stylesheet" href="../../font/font-awesome/css/regular.min.css">
|
||||
<link rel="stylesheet" href="../../font/roboto-mono/include_500.css">
|
||||
<link rel="stylesheet" href="package://assets/font/font-awesome/css/fontawesome.min.css">
|
||||
<link rel="stylesheet" href="package://assets/font/font-awesome/css/regular.min.css">
|
||||
<link rel="stylesheet" href="package://assets/font/roboto-mono/include_500.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<main>
|
||||
<div class="input-main">
|
||||
<h1></h1>
|
||||
<h1 id="heading">{{ Überschrift }}</h1>
|
||||
|
||||
<p id="description"></p>
|
||||
</div>
|
||||
|
||||
<div id="content" class="form" role="form">
|
||||
<input type="text" name="input" id="input-value" autofocus>
|
||||
</div>
|
||||
|
||||
<a target="_blank" id="close"></a>
|
||||
<!--<a target="_blank" id="close"></a>-->
|
||||
</main>
|
||||
<script type="text/javascript" src="package://assets/js/jquery-3.3.1.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
@@ -45,7 +48,6 @@
|
||||
$('.input-main h1').text(title);
|
||||
}
|
||||
</script>
|
||||
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js"></script>
|
||||
<script src="package://assets/js/inputhelper/application.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -5,7 +5,7 @@
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
||||
<title>Spielerliste</title>
|
||||
<link rel="stylesheet" href="package://assets/css/onlinelist/style.css">
|
||||
<link rel="stylesheet" href="../../css/onlinelist/style.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="wrapper">
|
||||
@@ -14,6 +14,21 @@
|
||||
<h2>Spieler: <span id="player-count">0</span></h2>
|
||||
</div>
|
||||
|
||||
<div class="factions">
|
||||
<ol class="inline stats">
|
||||
<li><span class="group group--1">LSPD</span>: <span id="1">0</span></li>
|
||||
<li><span class="group group--3">FIB</span>: <span id="3">0</span></li>
|
||||
<li><span class="group group--2">LSED</span>: <span id="2">0</span></li>
|
||||
|
||||
<li><span class="group group--7">GSF</span>: <span id="7">0</span></li>
|
||||
<li><span class="group group--8">FYB</span>: <span id="8">0</span></li>
|
||||
<li><span class="group group--5">LSV</span>: <span id="5">0</span></li>
|
||||
|
||||
<li><span class="group group--9">WZN</span>: <span id="9">0</span></li>
|
||||
<li><span class="group group--0">ZIVI</span>: <span id="0">0</span></li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -27,26 +42,8 @@
|
||||
<tbody id="players">
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<ol class="inline stats">
|
||||
<li><abbr title="Los Santos Police Department" class="group group--1">LSPD</abbr>: <span id="1">0</span></li>
|
||||
<li><abbr title="Federal Investigation Bureau" class="group group--3">FIB</abbr>: <span id="3">0</span></li>
|
||||
<li><abbr title="Los Santos Emergency Department" class="group group--2">LSED</abbr>: <span id="2">0</span></li>
|
||||
</ol>
|
||||
|
||||
<ol class="inline stats">
|
||||
<li><abbr title="Grove Street Families" class="group group--7">GSF</abbr>: <span id="7">0</span></li>
|
||||
<li><abbr title="Front Yard Ballas" class="group group--8">FYB</abbr>: <span id="8">0</span></li>
|
||||
<li><abbr title="Los Santos Vagos" class="group group--5">LSV</abbr>: <span id="5">0</span></li>
|
||||
</ol>
|
||||
|
||||
<ol class="inline stats">
|
||||
<li><abbr title="Weazel News" class="group group--9">WZN</abbr>: <span id="9">0</span></li>
|
||||
<li><abbr title="Zivilisten" class="group group--0">Zivilisten</abbr>: <span id="0">0</span></li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
<script src="package://assets/js/jquery-3.3.1.min.js"></script>
|
||||
<script src="package://assets/js/onlinelist/script.js"></script>
|
||||
<script src="../../js/onlinelist/script.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
let chat =
|
||||
let chat =
|
||||
{
|
||||
size: 0,
|
||||
history_limit: 50,
|
||||
@@ -1,4 +1,4 @@
|
||||
let content = document.getElementById('content');
|
||||
let content = document.getElementById('content');
|
||||
|
||||
let heading = document.getElementById('heading');
|
||||
let description = document.getElementById('description');
|
||||
@@ -6,7 +6,7 @@ let description = document.getElementById('description');
|
||||
let input = document.getElementById('input');
|
||||
let close = document.getElementById('close');
|
||||
|
||||
fzunction setInputFieldType(value) {
|
||||
function setInputFieldType(value) {
|
||||
if (input.type == value) return;
|
||||
|
||||
var field = document.createElement('input');
|
||||
@@ -21,7 +21,6 @@ fzunction setInputFieldType(value) {
|
||||
return field;
|
||||
}
|
||||
|
||||
|
||||
function setText(heading, description) {
|
||||
setHeading(heading);
|
||||
setDescription(description);
|
||||
@@ -53,9 +52,6 @@ close.onclick = function closeWindow() {
|
||||
console.log('Fenster geschlossen!');
|
||||
}
|
||||
|
||||
setInputFieldType('text');
|
||||
setText("Überschrift", "Lorem ipsum dolor sit amet consectetur adipisicing elit. Maiores laboriosam atque ut voluptates molestiae ab autem? Est consectetur voluptatem quia, commodi sint a omnis consequuntur. Tempora dolores ullam natus in?");
|
||||
|
||||
/* Enter wird im Input-Feld gedrückt */
|
||||
input.onkeyup = e => {
|
||||
let code = e.keyCode ? e.keyCode : e.which;
|
||||
@@ -72,3 +68,4 @@ document.onkeyup = e => {
|
||||
}
|
||||
|
||||
close.onclick = e => { closeWindow(); }
|
||||
setInputFieldType('text');
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
window.onbeforeunload = () => { window.scrollTo(0, 0); }
|
||||
|
||||
$(document).ready(function () {
|
||||
mp.trigger('CEF:PlayerList_Loaded');
|
||||
});
|
||||
|
||||
setPlayerCount = (factionId, value) => {
|
||||
if (factionId == -1) {
|
||||
document.getElementById('player-count').innerHTML = value;
|
||||
addTableSorting();
|
||||
} else if (factionId >= 0 && factionId <= 9) {
|
||||
document.getElementById(factionId).innerHTML = value;
|
||||
}
|
||||
@@ -21,7 +18,7 @@ function getFactionNameByFactionId(factionId) {
|
||||
case 5: return "Vagos";
|
||||
case 7: return "Grove Street";
|
||||
case 8: return "Ballas";
|
||||
case 9: return "Weazle News";
|
||||
case 9: return "Weazel News";
|
||||
default: return "Zivilisten";
|
||||
}
|
||||
}
|
||||
@@ -30,3 +27,34 @@ function addPlayerEntry(userId, userName, factionId, userPing) {
|
||||
var factionName = getFactionNameByFactionId(factionId);
|
||||
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/
|
||||
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,4 +1,4 @@
|
||||
export default function coloredHeadLights() {
|
||||
export default function coloredHeadLights() {
|
||||
function setHeadlightsColor(vehicle, color) {
|
||||
if (typeof color !== "number" || isNaN(color) || color < 0 || color === 255) {
|
||||
// Disable
|
||||
|
||||
@@ -188,6 +188,10 @@ class RagePlayerPool implements IPlayerPool {
|
||||
fn(new RagePlayer(e));
|
||||
});
|
||||
}
|
||||
|
||||
exists(entity: IPlayer): boolean {
|
||||
return mp.players.exists(entity.id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -280,6 +284,10 @@ class RageVehiclePool implements IVehiclePool {
|
||||
fn(new RageVehicle(e));
|
||||
})
|
||||
}
|
||||
|
||||
exists(entity: IVehicle): boolean {
|
||||
return mp.vehicles.exists(entity.id);
|
||||
}
|
||||
}
|
||||
|
||||
export {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { IGame, IUi, IEvents, IPlayerPool, IVehiclePool, IEntityAttachmentPool } from "../../game";
|
||||
import { IGame, IUi, IEvents, IPlayerPool, IVehiclePool, IEntityAttachmentPool } from "../../game";
|
||||
import RageEvents from "./events";
|
||||
import RageUi from "./ui";
|
||||
import { RagePlayerPool, RageVehiclePool, RageEntityAttachmentPool } from "./entities";
|
||||
@@ -10,8 +10,8 @@ export default class RageGame implements IGame {
|
||||
events: IEvents = new RageEvents;
|
||||
ui: IUi = new RageUi;
|
||||
|
||||
async wait(ms: number): Promise<void> {
|
||||
await mp.game.waitAsync(ms);
|
||||
wait(ms: number): void {
|
||||
mp.game.wait(ms);
|
||||
}
|
||||
|
||||
disableDefaultEngineBehaviour(): void {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { IUi, IBrowser } from "../../game";
|
||||
import { IUi, IBrowser } from "../../game";
|
||||
import { Menu } from "../../libs/NativeUI/index";
|
||||
import { GlobalData } from "../..";
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
interface IGame {
|
||||
wait(ms: number): Promise<void>;
|
||||
wait(ms: number): void;
|
||||
events: IEvents;
|
||||
ui: IUi;
|
||||
|
||||
@@ -75,6 +75,7 @@ interface IVehicle extends IEntity {
|
||||
interface IEntityPool<TEntity> {
|
||||
at(id: number): TEntity;
|
||||
forEach(fn: (entity: TEntity) => void): void;
|
||||
exists(entity: TEntity): boolean;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
/**
|
||||
* @overview Life of German Reallife - Login index.js
|
||||
* @author VegaZ, hydrant
|
||||
* @copyright (c) 2008 - 2018 Life of German
|
||||
@@ -39,7 +39,7 @@ game.events.onPlayerCommand((cmd) => {
|
||||
mp.game.vehicle.defaultEngineBehaviour = false;
|
||||
|
||||
mp.gui.chat.show(false);
|
||||
const chatbox = mp.browsers.new("package://assets/chat/index.html");
|
||||
const chatbox = mp.browsers.new("package://assets/html/chat/index.html");
|
||||
chatbox.markAsChat();
|
||||
|
||||
require('./Gui/house');
|
||||
@@ -186,6 +186,9 @@ ped();
|
||||
import reportList from './Player/reportmenu';
|
||||
reportList(globalData);
|
||||
|
||||
import polygonHandler from './Player/polygons';
|
||||
polygonHandler();
|
||||
|
||||
import checkpointHandle from './util/checkpoint';
|
||||
checkpointHandle(globalData);
|
||||
|
||||
@@ -265,9 +268,17 @@ antiAfk(globalData);
|
||||
import ammunation from './Interaction/ammunation/ammunation';
|
||||
ammunation(globalData);
|
||||
|
||||
import handsup from './Player/handsup';
|
||||
handsup();
|
||||
|
||||
import spawnschutz from './Player/spawnschutz';
|
||||
spawnschutz();
|
||||
|
||||
|
||||
require('./Gui/policedepartment');
|
||||
require('./Gui/helptext');
|
||||
require('./admin/spectate');
|
||||
require('./polygons/index');
|
||||
|
||||
interface VehicleData {
|
||||
EngineState: boolean;
|
||||
|
||||
22
ReallifeGamemode.Client/polygons/events.ts
Normal file
22
ReallifeGamemode.Client/polygons/events.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import polygons from ".";
|
||||
|
||||
setInterval(() => {
|
||||
const { position, dimension } = mp.players.local;
|
||||
|
||||
polygons.pool.map((polygon) => {
|
||||
|
||||
if (polygon.colliding) {
|
||||
if (!polygons.isPositionWithinPolygon(position, polygon, dimension)) {
|
||||
polygon.colliding = false;
|
||||
mp.events.call('playerLeavePolygon', polygon);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (polygons.isPositionWithinPolygon(position, polygon, dimension)) {
|
||||
polygon.colliding = true;
|
||||
mp.events.call('playerEnterPolygon', polygon);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}, 100);
|
||||
55
ReallifeGamemode.Client/polygons/helpers.ts
Normal file
55
ReallifeGamemode.Client/polygons/helpers.ts
Normal file
@@ -0,0 +1,55 @@
|
||||
import polygons from ".";
|
||||
|
||||
const isPointInArea2D = (point, area): boolean => {
|
||||
let x = point[0], y = point[1];
|
||||
|
||||
let inside = false;
|
||||
|
||||
for (let i = 0, j = area.length - 1; i < area.length; j = i++) {
|
||||
let xi = area[i][0], yi = area[i][1];
|
||||
let xj = area[j][0], yj = area[j][1];
|
||||
|
||||
let intersect = ((yi > y) != (yj > y))
|
||||
&& (x < (xj - xi) * (y - yi) / (yj - yi) + xi);
|
||||
|
||||
if (intersect)
|
||||
inside = !inside;
|
||||
}
|
||||
|
||||
return inside;
|
||||
};
|
||||
|
||||
const TWOPI = 6.283185307179586476925287;
|
||||
const EPSILON = 0.0000001;
|
||||
|
||||
const modulus = (p): number => Math.sqrt((p.x * p.x) + (p.y * p.y) + (p.z *p.z));
|
||||
|
||||
const getAngleSumBetweenPositionAndVertices = (position, vertices): number => {
|
||||
let i;
|
||||
let m1, m2;
|
||||
let anglesum=0, costheta;
|
||||
|
||||
for (i = 0; i < vertices.length; i++) {
|
||||
|
||||
const p1 = new mp.Vector3(vertices[i].x - position.x, vertices[i].y - position.y, vertices[i].z - position.z);
|
||||
const p2 = new mp.Vector3(vertices[(i+1)%vertices.length].x - position.x, vertices[(i+1)%vertices.length].y - position.y, vertices[(i+1)%vertices.length].z - position.z);
|
||||
|
||||
m1 = modulus(p1);
|
||||
m2 = modulus(p2);
|
||||
|
||||
if (m1*m2 <= EPSILON)
|
||||
return(TWOPI);
|
||||
else
|
||||
costheta = (p1.x*p2.x + p1.y*p2.y + p1.z*p2.z) / (m1*m2);
|
||||
|
||||
anglesum += Math.acos(costheta);
|
||||
}
|
||||
return (anglesum);
|
||||
}
|
||||
|
||||
const generateUniquePolygonId = (): number => {
|
||||
const timestamp = Date.now();
|
||||
return polygons.pool.some(p => p.id === timestamp) ? generateUniquePolygonId() : timestamp;
|
||||
};
|
||||
|
||||
export { isPointInArea2D, generateUniquePolygonId, getAngleSumBetweenPositionAndVertices };
|
||||
71
ReallifeGamemode.Client/polygons/index.ts
Normal file
71
ReallifeGamemode.Client/polygons/index.ts
Normal file
@@ -0,0 +1,71 @@
|
||||
const { generateUniquePolygonId, getAngleSumBetweenPositionAndVertices, isPointInArea2D } = require('./helpers');
|
||||
|
||||
require('./render');
|
||||
require('./events');
|
||||
|
||||
class PolygonManager {
|
||||
pool: Polygon[] = new Array<Polygon>();
|
||||
|
||||
add(vertices: Vector3Mp[], height: number, visible: boolean, lineColorRGBA: [number, number, number, number], dimension: number = 0) {
|
||||
|
||||
const polygon: Polygon = {
|
||||
id: generateUniquePolygonId(),
|
||||
vertices,
|
||||
height,
|
||||
colliding: false,
|
||||
lineColorRGBA: lineColorRGBA,
|
||||
dimension: dimension,
|
||||
visible: visible
|
||||
}
|
||||
|
||||
this.pool.push(polygon);
|
||||
|
||||
return polygon;
|
||||
}
|
||||
|
||||
remove(polygon: Polygon) {
|
||||
const index = this.pool.findIndex(p => p.id === polygon.id);
|
||||
|
||||
if (index !== -1)
|
||||
this.pool.splice(index, 1);
|
||||
}
|
||||
|
||||
exists(polygon: Polygon) {
|
||||
return this.pool.some(p => p.id === polygon.id)
|
||||
}
|
||||
|
||||
isPositionWithinPolygon(position: Vector3Mp, polygon: Polygon, dimension: number) {
|
||||
if (dimension && polygon.dimension !== dimension && polygon.dimension !== -1)
|
||||
return false;
|
||||
|
||||
const { vertices } = polygon;
|
||||
|
||||
const polygonPoints2D = [];
|
||||
|
||||
for (let i in vertices) {
|
||||
if (position.z >= vertices[i].z && position.z <= (vertices[i].z + polygon.height) || getAngleSumBetweenPositionAndVertices(position, vertices) >= 5.8)
|
||||
polygonPoints2D.push([vertices[i].x, vertices[i].y]);
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
return isPointInArea2D([position.x, position.y], polygonPoints2D);
|
||||
}
|
||||
}
|
||||
|
||||
type Polygon = {
|
||||
id: number;
|
||||
vertices: Vector3Mp[];
|
||||
height: number;
|
||||
visible: boolean;
|
||||
colliding: boolean;
|
||||
dimension: number;
|
||||
lineColorRGBA: [number, number, number, number];
|
||||
};
|
||||
|
||||
const polygons = new PolygonManager();
|
||||
|
||||
export default polygons;
|
||||
export { Polygon };
|
||||
|
||||
|
||||
29
ReallifeGamemode.Client/polygons/render.ts
Normal file
29
ReallifeGamemode.Client/polygons/render.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import polygons from ".";
|
||||
|
||||
mp.events.add('render', () => {
|
||||
|
||||
polygons.pool.forEach(polygon => {
|
||||
if (!polygon.visible) return;
|
||||
|
||||
const { vertices, height, lineColorRGBA } = polygon;
|
||||
|
||||
vertices.forEach((vertex, index) => {
|
||||
|
||||
const nextVertex = index === (vertices.length - 1) ? vertices[0] : vertices[index + 1];
|
||||
|
||||
// Deepness lower line
|
||||
mp.game.graphics.drawLine(vertex.x, vertex.y, vertex.z, nextVertex.x, nextVertex.y, nextVertex.z, ...lineColorRGBA);
|
||||
|
||||
// Current vertex height line
|
||||
mp.game.graphics.drawLine(vertex.x, vertex.y, vertex.z, vertex.x, vertex.y, vertex.z + height, ...lineColorRGBA);
|
||||
|
||||
// Next vertex height line
|
||||
mp.game.graphics.drawLine(nextVertex.x, nextVertex.y, nextVertex.z, nextVertex.x, nextVertex.y, nextVertex.z + height, ...lineColorRGBA);
|
||||
|
||||
// Deepness higher line
|
||||
mp.game.graphics.drawLine(vertex.x, vertex.y, vertex.z + height, nextVertex.x, nextVertex.y, nextVertex.z + height, ...lineColorRGBA);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
@@ -15,7 +15,7 @@ export default function attachmentManager(game: IGame) {
|
||||
{
|
||||
attachments: {},
|
||||
|
||||
addFor: async function (entity, id) {
|
||||
addFor: function (entity, id) {
|
||||
if (this.attachments.hasOwnProperty(id)) {
|
||||
if (!entity.__attachmentObjects) {
|
||||
entity.__attachmentObjects = {};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as NativeUI from '../libs/NativeUI';
|
||||
import * as NativeUI from '../libs/NativeUI';
|
||||
const Menu = NativeUI.Menu;
|
||||
const UIMenuItem = NativeUI.UIMenuItem;
|
||||
const UIMenuListItem = NativeUI.UIMenuListItem;
|
||||
@@ -25,9 +25,7 @@ export default function planeSchoolHandle(globalData: IGlobalData) {
|
||||
var waitFinished = false;
|
||||
|
||||
mp.events.add('planeSchoolMenu', () => {
|
||||
mp.game.ui.setTextComponentFormat('STRING');
|
||||
mp.game.ui.addTextComponentSubstringPlayerName('Drücke ~INPUT_CONTEXT~, um das Flugschulmenü zu öffnen');
|
||||
mp.game.ui.displayHelpTextFromStringLabel(0, true, true, -1);
|
||||
mp.events.call("renderHelpTextOnScreen", "~s~Drücke ~g~E~s~, um die ~b~Flugprüfung ~s~zu beginnen");
|
||||
mp.keys.bind(0x45, false, keyPressHandler);
|
||||
keyBound = true;
|
||||
});
|
||||
|
||||
@@ -1,4 +1,24 @@
|
||||
export default function weapondamageUtil() {
|
||||
import { isInAnyNoDMPolygon, listNoDMZones } from "../Player/polygons";
|
||||
import polygons from "../polygons";
|
||||
import { getWantedCount } from "../Gui/wanteds";
|
||||
import { spawnschutzEnabled } from "../Player/spawnschutz";
|
||||
|
||||
|
||||
function isTargetInPolygon(pos): boolean {
|
||||
let found = false;
|
||||
|
||||
listNoDMZones.forEach(zone => {
|
||||
if (polygons.isPositionWithinPolygon(pos, zone, zone.dimension)) {
|
||||
found = true;
|
||||
return;
|
||||
}
|
||||
});
|
||||
if (found) return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
export default function weapondamageUtil() {
|
||||
let blockInput = false;
|
||||
|
||||
mp.players.local.setSuffersCriticalHits(false);
|
||||
@@ -7,6 +27,22 @@
|
||||
player.setSuffersCriticalHits(false);
|
||||
});
|
||||
|
||||
mp.events.add(RageEnums.EventKey.INCOMING_DAMAGE, (sourceEntity: EntityMp, sourcePlayer: PlayerMp, targetEntity: EntityMp, weapon: number, boneIndex: number, damage: number) => {
|
||||
if ((isTargetInPolygon(sourceEntity.position) || isInAnyNoDMPolygon) && getWantedCount() === 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (spawnschutzEnabled && getWantedCount() === 0) {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
mp.events.add(RageEnums.EventKey.OUTGOING_DAMAGE, (sourceEntity, targetEntity, sourcePlayer, weapon, boneIndex, damage) => {
|
||||
if (spawnschutzEnabled && getWantedCount() === 0) {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
mp.events.add("render", () => {
|
||||
if (blockInput) {
|
||||
mp.game.controls.disableControlAction(32, 142, true);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//This script will make vehicles have smoother acceleration.
|
||||
//This script will make vehicles have smoother acceleration.
|
||||
//To disable the script call an event and set "GlobalDisable" to true.
|
||||
//To disable individual sections, set "DisableAntiReverse" or "DisableSmoothThrottle" to true.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import game from '../index';
|
||||
import game from '../index';
|
||||
import { IVehicle, EntityType, IEntity, VehicleSeat, DoorState } from '../game';
|
||||
import { parseJson } from '../util';
|
||||
import { VehicleData } from '../game';
|
||||
@@ -10,9 +10,9 @@ game.events.add('SERVER:Vehicle:UpdateData', (vehId, dataStr) => {
|
||||
setVehicleData(vehicle, data);
|
||||
});
|
||||
|
||||
game.events.onPlayerEnterVehicle(async (vehicle, seat) => {
|
||||
game.events.onPlayerEnterVehicle((vehicle, seat) => {
|
||||
while (!game.players.local.inVehicle) {
|
||||
await game.wait(0);
|
||||
game.wait(0);
|
||||
}
|
||||
|
||||
if (vehicle) {
|
||||
@@ -22,11 +22,11 @@ game.events.onPlayerEnterVehicle(async (vehicle, seat) => {
|
||||
}
|
||||
});
|
||||
|
||||
game.events.onPlayerExitVehicle(async () => {
|
||||
game.events.onPlayerExitVehicle(() => {
|
||||
var veh = game.players.local.vehicle;
|
||||
|
||||
while (game.players.local.inVehicle) {
|
||||
await game.wait(0);
|
||||
game.wait(0);
|
||||
}
|
||||
|
||||
if (veh) {
|
||||
@@ -51,7 +51,7 @@ game.events.onEntityStreamIn((entity: IEntity) => {
|
||||
});
|
||||
|
||||
function setVehicleData(veh: IVehicle, data: VehicleData): void {
|
||||
if (!veh) {
|
||||
if (!veh || !game.vehicles.exists(veh)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
10
ReallifeGamemode.Database/Add-Migration.ps1
Normal file
10
ReallifeGamemode.Database/Add-Migration.ps1
Normal file
@@ -0,0 +1,10 @@
|
||||
Param
|
||||
(
|
||||
[Parameter(Mandatory=$true)]
|
||||
[string]$MigrationName
|
||||
)
|
||||
|
||||
$root = $PSScriptRoot
|
||||
|
||||
dotnet tool update dotnet-ef --global
|
||||
dotnet ef migrations add $MigrationName --project "$root\ReallifeGamemode.Database.csproj" --startup-project "$root\..\ReallifeGamemode.Server\ReallifeGamemode.Server.csproj" --configuration "Database"
|
||||
@@ -15,10 +15,13 @@ namespace ReallifeGamemode.Database.Entities
|
||||
{
|
||||
[ForeignKey("User")]
|
||||
public int UserId { get; set; }
|
||||
|
||||
public User User { get; set; }
|
||||
|
||||
public int? Price { get; set; }
|
||||
|
||||
public int? BusinessId { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return "Spieler Fahrzeug | Besitzer: " + GetOwner().Name;
|
||||
|
||||
2177
ReallifeGamemode.Database/Migrations/20210421190610_UserVehicleBusinessId.Designer.cs
generated
Normal file
2177
ReallifeGamemode.Database/Migrations/20210421190610_UserVehicleBusinessId.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,109 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace ReallifeGamemode.Database.Migrations
|
||||
{
|
||||
public partial class UserVehicleBusinessId : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_ChatLogs_Users_UserId",
|
||||
table: "ChatLogs");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_ChatLogs_Factions_FactionId",
|
||||
table: "ChatLogs");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_ChatLogs_Groups_GroupId",
|
||||
table: "ChatLogs");
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "UserVehicle_BusinessId",
|
||||
table: "ServerVehicles",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "UserId",
|
||||
table: "ChatLogs",
|
||||
nullable: false,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "int",
|
||||
oldNullable: true);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_ChatLogs_Users_UserId",
|
||||
table: "ChatLogs",
|
||||
column: "UserId",
|
||||
principalTable: "Users",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_ChatLogs_Factions_FactionId",
|
||||
table: "ChatLogs",
|
||||
column: "FactionId",
|
||||
principalTable: "Factions",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_ChatLogs_Groups_GroupId",
|
||||
table: "ChatLogs",
|
||||
column: "GroupId",
|
||||
principalTable: "Groups",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_ChatLogs_Users_UserId",
|
||||
table: "ChatLogs");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_ChatLogs_Factions_FactionId",
|
||||
table: "ChatLogs");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_ChatLogs_Groups_GroupId",
|
||||
table: "ChatLogs");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "UserVehicle_BusinessId",
|
||||
table: "ServerVehicles");
|
||||
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "UserId",
|
||||
table: "ChatLogs",
|
||||
type: "int",
|
||||
nullable: true,
|
||||
oldClrType: typeof(int));
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_ChatLogs_Users_UserId",
|
||||
table: "ChatLogs",
|
||||
column: "UserId",
|
||||
principalTable: "Users",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_ChatLogs_Factions_FactionId",
|
||||
table: "ChatLogs",
|
||||
column: "FactionId",
|
||||
principalTable: "Factions",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_ChatLogs_Groups_GroupId",
|
||||
table: "ChatLogs",
|
||||
column: "GroupId",
|
||||
principalTable: "Groups",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -814,7 +814,7 @@ namespace ReallifeGamemode.Database.Migrations
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<int?>("UserId")
|
||||
b.Property<int>("UserId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
@@ -1749,7 +1749,7 @@ namespace ReallifeGamemode.Database.Migrations
|
||||
{
|
||||
b.HasBaseType("ReallifeGamemode.Database.Entities.Logs.Chat.ChatLogEntry");
|
||||
|
||||
b.Property<int?>("FactionId")
|
||||
b.Property<int>("FactionId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasIndex("FactionId");
|
||||
@@ -1768,7 +1768,7 @@ namespace ReallifeGamemode.Database.Migrations
|
||||
{
|
||||
b.HasBaseType("ReallifeGamemode.Database.Entities.Logs.Chat.ChatLogEntry");
|
||||
|
||||
b.Property<int?>("GroupId")
|
||||
b.Property<int>("GroupId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasIndex("GroupId");
|
||||
@@ -1891,6 +1891,10 @@ namespace ReallifeGamemode.Database.Migrations
|
||||
{
|
||||
b.HasBaseType("ReallifeGamemode.Database.Entities.ServerVehicle");
|
||||
|
||||
b.Property<int?>("BusinessId")
|
||||
.HasColumnName("UserVehicle_BusinessId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int?>("Price")
|
||||
.HasColumnName("UserVehicle_Price")
|
||||
.HasColumnType("int");
|
||||
@@ -2011,7 +2015,9 @@ namespace ReallifeGamemode.Database.Migrations
|
||||
{
|
||||
b.HasOne("ReallifeGamemode.Database.Entities.User", "User")
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId");
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ReallifeGamemode.Database.Entities.Logs.CommandLogEntry", b =>
|
||||
@@ -2134,14 +2140,18 @@ namespace ReallifeGamemode.Database.Migrations
|
||||
{
|
||||
b.HasOne("ReallifeGamemode.Database.Entities.Faction", "Faction")
|
||||
.WithMany()
|
||||
.HasForeignKey("FactionId");
|
||||
.HasForeignKey("FactionId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ReallifeGamemode.Database.Entities.Logs.Chat.GroupChatLogEntry", b =>
|
||||
{
|
||||
b.HasOne("ReallifeGamemode.Database.Entities.Group", "Group")
|
||||
.WithMany()
|
||||
.HasForeignKey("GroupId");
|
||||
.HasForeignKey("GroupId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ReallifeGamemode.Database.Entities.GroupVehicle", b =>
|
||||
|
||||
4
ReallifeGamemode.Database/Update-Database.ps1
Normal file
4
ReallifeGamemode.Database/Update-Database.ps1
Normal file
@@ -0,0 +1,4 @@
|
||||
$root = $PSScriptRoot
|
||||
|
||||
dotnet tool update dotnet-ef --global
|
||||
dotnet ef database update --project "$root\ReallifeGamemode.Database.csproj" --startup-project "$root\..\ReallifeGamemode.Server\ReallifeGamemode.Server.csproj" --configuration "Database"
|
||||
@@ -150,8 +150,9 @@ namespace ReallifeGamemode.Server.Bank
|
||||
else
|
||||
{
|
||||
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);
|
||||
target.GetUser(dbContext).otheramount = amount;
|
||||
target.GetUser(dbContext).otheramount += amount;
|
||||
dbContext.SaveChanges();
|
||||
}
|
||||
}
|
||||
@@ -203,7 +204,7 @@ namespace ReallifeGamemode.Server.Bank
|
||||
{
|
||||
player.SendNotification($"~w~Du hast {target.Name} $~g~{amount} ~w~Überwiesen.");
|
||||
player.GetUser(dbContext).Faction.BankAccount.Balance -= (int)(amount * 1.05);
|
||||
target.GetUser(dbContext).otheramount = amount;
|
||||
target.GetUser(dbContext).otheramount += amount;
|
||||
dbContext.SaveChanges();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -165,12 +165,6 @@ namespace ReallifeGamemode.Server.Commands
|
||||
[Command("position", "~m~Benutzung: ~s~/position")]
|
||||
public void CmdAdminPosition(Player player)
|
||||
{
|
||||
if (!player.GetUser()?.IsAdmin(AdminLevel.SUPPORTER) ?? true)
|
||||
{
|
||||
ChatService.NotAuthorized(player);
|
||||
return;
|
||||
}
|
||||
|
||||
ChatService.SendMessage(player, "Position: X Y Z: " + player.Position + " Richtung: " + player.Heading);
|
||||
}
|
||||
|
||||
@@ -178,8 +172,8 @@ namespace ReallifeGamemode.Server.Commands
|
||||
|
||||
#region Support
|
||||
|
||||
[Command("tog", "~m~Benutzung: ~s~/tog [Typ = ~g~IP~s~, ~g~deathlogs~s~, ~g~LC~s~, ~g~Connect~s~]", GreedyArg = true)]
|
||||
public void CmdTog(Player player, string typ, string option1 = null, string option2 = null)
|
||||
[Command("tog", "~m~Benutzung: ~s~/tog [Typ = ~g~IP~s~, ~g~deathlogs~s~, ~g~LC~s~, ~g~Connect~s~, ~g~D~s~, ~g~GA~s~, ~g~All~s~]", GreedyArg = true)]
|
||||
public void CmdAdminTog(Player player, string typ, string option1 = null, string option2 = null)
|
||||
{
|
||||
if (!player.GetUser()?.IsAdmin(AdminLevel.SUPPORTER) ?? true)
|
||||
{
|
||||
@@ -264,6 +258,34 @@ namespace ReallifeGamemode.Server.Commands
|
||||
player.SendNotification("~g~[Info]~w~ GA-Chat wird nun angezeigt.");
|
||||
}
|
||||
break;
|
||||
case "all":
|
||||
if(!player.HasData("togall"))
|
||||
{
|
||||
player.SetData("togip", true);
|
||||
player.SetData("togdeath", true);
|
||||
player.SetData("togdeathlogs", true);
|
||||
player.SetData("toglc", true);
|
||||
player.SetData("togconnect", true);
|
||||
player.SetData("togd", true);
|
||||
player.SetData("togga", true);
|
||||
player.SetData("togall", true);
|
||||
|
||||
player.SendNotification("~g~[Info]~s~ Alle Logs wurden eingeschaltet");
|
||||
}
|
||||
else
|
||||
{
|
||||
player.ResetData("togip");
|
||||
player.ResetData("togdeath");
|
||||
player.ResetData("togdeathlogs");
|
||||
player.ResetData("toglc");
|
||||
player.ResetData("togconnect");
|
||||
player.ResetData("togd");
|
||||
player.ResetData("togga");
|
||||
player.ResetData("togall");
|
||||
|
||||
player.SendNotification("~g~[Info]~s~ Alle Logs wurden ausgeschaltet");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -592,7 +614,7 @@ namespace ReallifeGamemode.Server.Commands
|
||||
[Command("mark", "~m~Benutzung: ~s~/mark")]
|
||||
public void CmdAdminMark(Player player)
|
||||
{
|
||||
if (!player.GetUser()?.IsAdmin(AdminLevel.ADMIN) ?? true)
|
||||
if (!player.GetUser()?.IsAdmin(AdminLevel.SUPPORTER) ?? true)
|
||||
{
|
||||
ChatService.NotAuthorized(player);
|
||||
return;
|
||||
@@ -604,7 +626,7 @@ namespace ReallifeGamemode.Server.Commands
|
||||
[Command("gotomark", "~m~Benutzung: ~s~/gotomark")]
|
||||
public void CmdAdminGotoMark(Player player)
|
||||
{
|
||||
if (!player.GetUser()?.IsAdmin(AdminLevel.ADMIN) ?? true)
|
||||
if (!player.GetUser()?.IsAdmin(AdminLevel.SUPPORTER) ?? true)
|
||||
{
|
||||
ChatService.NotAuthorized(player);
|
||||
return;
|
||||
@@ -1300,13 +1322,11 @@ namespace ReallifeGamemode.Server.Commands
|
||||
if (serverVehicle == null)
|
||||
{
|
||||
VehicleManager.DeleteVehicle(v);
|
||||
v.Trailer?.Delete();
|
||||
VehicleManager.DeleteVehicle(v.Trailer);
|
||||
continue;
|
||||
}
|
||||
|
||||
Vehicle newVeh = serverVehicle.Spawn(v);
|
||||
newVeh.Repair();
|
||||
newVeh.Rotation = new Vector3(0, 0, serverVehicle.Heading);
|
||||
|
||||
respawnedVehicleCount++;
|
||||
}
|
||||
@@ -1332,7 +1352,7 @@ namespace ReallifeGamemode.Server.Commands
|
||||
|
||||
if (target.GetData<bool>("isDead") == true)
|
||||
{
|
||||
ChatService.ErrorMessage(player, "Dieser Spieler ist tot. Nutze /arevive.");
|
||||
ChatService.ErrorMessage(player, "Dieser Spieler ist tot. Nutze /arevive");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -154,7 +154,7 @@ namespace ReallifeGamemode.Server.Commands
|
||||
|
||||
User user = player.GetUser(dbContext);
|
||||
Faction f = user?.Faction;
|
||||
if ((f == null || !f.StateOwned) && (!user.IsAdmin(AdminLevel.ADMIN) || !player.HasData("todg")))
|
||||
if ((f == null || !f.StateOwned) && (!user.IsAdmin(AdminLevel.ADMIN) || !player.HasData("togd")))
|
||||
{
|
||||
ChatService.NotAuthorized(player);
|
||||
return;
|
||||
@@ -280,7 +280,7 @@ namespace ReallifeGamemode.Server.Commands
|
||||
using var dbContext = new DatabaseContext();
|
||||
|
||||
User user = player.GetUser(dbContext);
|
||||
if ((user?.FactionId == null || user.FactionLeader == false) && !user.IsAdmin(AdminLevel.ADMIN))
|
||||
if ((user?.FactionId == null || user.FactionLeader == false) && (!user.IsAdmin(AdminLevel.ADMIN) || !player.HasData("toglc")))
|
||||
{
|
||||
ChatService.NotAuthorized(player);
|
||||
return;
|
||||
@@ -402,10 +402,17 @@ namespace ReallifeGamemode.Server.Commands
|
||||
ChatService.ErrorMessage(player, "Der Spieler hat eine Revivesperre");
|
||||
return;
|
||||
}
|
||||
|
||||
using (var dbContext = new DatabaseContext())
|
||||
{
|
||||
var deadPlayerUser = deadPlayer.GetUser(dbContext);
|
||||
|
||||
if (deadPlayerUser.Wanteds > 0)
|
||||
{
|
||||
ChatService.ErrorMessage(player, "Dieser Spieler hat Wanteds");
|
||||
return;
|
||||
}
|
||||
|
||||
if (deadPlayerUser.Handmoney >= 100)
|
||||
{
|
||||
deadPlayerUser.Handmoney -= 100;
|
||||
@@ -426,6 +433,8 @@ namespace ReallifeGamemode.Server.Commands
|
||||
deadPlayer.SetData("isDead", false);
|
||||
deadPlayer.SetData("reviveSperre", 5);
|
||||
|
||||
deadPlayer.TriggerEvent("enableSpawnschutz");
|
||||
|
||||
dbContext.Factions.Include(f => f.BankAccount).Where(f => f.Id == 2).First().BankAccount.Balance += Medic.ReviveIncome;
|
||||
|
||||
User u;
|
||||
|
||||
@@ -17,6 +17,60 @@ namespace ReallifeGamemode.Server.Commands
|
||||
{
|
||||
internal class UserCommands : Script
|
||||
{
|
||||
[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")]
|
||||
public void CmdUserLook(Player player)
|
||||
{
|
||||
@@ -120,7 +174,7 @@ namespace ReallifeGamemode.Server.Commands
|
||||
}
|
||||
|
||||
[Command("help", "~m~Benutzung: ~s~/help")]
|
||||
public void CmdHelp(Player player)
|
||||
public void CmdUserHelp(Player player)
|
||||
{
|
||||
player.SendChatMessage("E - Interagieren (ATM, Türen, Shops, Friseur etc.");
|
||||
player.SendChatMessage("M - Interaktionsmenü öffnen und schließen");
|
||||
@@ -129,13 +183,13 @@ namespace ReallifeGamemode.Server.Commands
|
||||
player.SendChatMessage("O - Onlineliste öffnen / schließen");
|
||||
player.SendChatMessage("I - Inventar öffnen / schließen");
|
||||
player.SendChatMessage("F4 - Mikrofon an/aus schalten");
|
||||
player.SendChatMessage("/skill - Skillpunkte anzeigen");
|
||||
player.SendChatMessage("/report - Support-Anfrage");
|
||||
}
|
||||
|
||||
[Command("hup")]
|
||||
public void CmdAnim(Player player)
|
||||
public void CmdUserHup(Player player)
|
||||
{
|
||||
player.ToggleSurrender();
|
||||
player.CheckToggleSurrender();
|
||||
}
|
||||
|
||||
[Command("event", "~m~Benutzung: ~s~/event [Nachricht]", GreedyArg = true)]
|
||||
|
||||
@@ -77,6 +77,8 @@ 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", 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", 5, "csb_prolsec", 1690.84, 2591.17 , 45.91, -2.66, 0, false, true, 0, "none", true, true, true);//Ped Knast
|
||||
|
||||
TimeSpan currentTime = TimeManager.CurrentTime;
|
||||
bool disableLightMode = currentTime > LightModeTimeFrom && currentTime < LightModeTimeTo;
|
||||
|
||||
|
||||
@@ -27,7 +27,6 @@ namespace ReallifeGamemode.Server.Events
|
||||
{
|
||||
private readonly Dictionary<Player, DateTime> lastPlayerDeathTime = new Dictionary<Player, DateTime>();
|
||||
|
||||
|
||||
[ServerEvent(Event.PlayerDeath)]
|
||||
public void OnPlayerDeath(Player player, Player killer, uint reason)
|
||||
{
|
||||
@@ -49,6 +48,7 @@ namespace ReallifeGamemode.Server.Events
|
||||
User user = player.GetUser(dbContext);
|
||||
|
||||
PositionManager.cuffPoints.Remove(player);
|
||||
player.TriggerEvent("abortSpawnschutz");
|
||||
|
||||
//TODO: Zum Full Release entfernen
|
||||
if (player.HasData("togdeath"))
|
||||
@@ -114,14 +114,41 @@ namespace ReallifeGamemode.Server.Events
|
||||
};
|
||||
dbContext.DeathLogs.Add(dead);
|
||||
|
||||
bool copNearby = NAPI.Pools.GetAllPlayers().Any(u => u.IsDuty() && u.IsAlive() && u.Position.DistanceToSquared(player.Position) <= 200 * 200);
|
||||
player.ClearAnimation();
|
||||
player.ClearAttachments();
|
||||
List<UserItem> fItem = dbContext.UserItems.Where(u => u.UserId == user.Id).ToList();
|
||||
foreach (var item in fItem)
|
||||
{
|
||||
IItem iItem = InventoryManager.GetItemById(item.ItemId);
|
||||
if (iItem is IWeaponDealItem obj)
|
||||
{
|
||||
int amount = item.Amount;
|
||||
|
||||
if (user.Wanteds > 0)
|
||||
Vector3 dropPosition = PlayerExtension.GetPositionFromPlayer(player, 0.6f, 0);
|
||||
//new Vector3(player.Position.X, player.Position.Y, player.Position.Z - 0.8f);
|
||||
Random r = new Random();
|
||||
GTANetworkAPI.Object grndObject;
|
||||
Vector3 textPos = dropPosition;
|
||||
|
||||
dropPosition.Z -= 1.05f;
|
||||
grndObject = NAPI.Object.CreateObject(3666746839, dropPosition, new Vector3(0, 0, r.Next(0, 360)), 255, 0);
|
||||
|
||||
GroundItem grndItem = new GroundItem { ItemId = iItem.Id, Amount = amount, Position = dropPosition };
|
||||
TextLabel grndTxtLbl = NAPI.TextLabel.CreateTextLabel(iItem.Name + " ~s~(~y~" + amount + "~s~)", textPos, 5, 0.5f, 4, new Color(255, 255, 255), false, 0);
|
||||
GroundItem.AddGroundItem(grndItem, grndObject, grndTxtLbl);
|
||||
|
||||
dbContext.Remove(item);
|
||||
}
|
||||
}
|
||||
|
||||
bool copNearby = NAPI.Pools.GetAllPlayers().Any(u => u.IsDuty() && u.IsAlive() && u.Position.DistanceToSquared(player.Position) <= 100 * 100);
|
||||
|
||||
if (user.Wanteds > 0 && (!player.HasData("GotInsideOfTurf") || !player.GetData<bool>("GotInsideOfTurf")))
|
||||
{
|
||||
if (copNearby)
|
||||
{
|
||||
user.SetJailTime(true);
|
||||
Jail.Check_PutBehindBars(user);
|
||||
user.SetJailTime(true, dbContext);
|
||||
Jail.Check_PutBehindBars(user, "cell");
|
||||
ChatService.HQMessage(user.Name + " wurde ins Gefängnis eingeliefert.");
|
||||
}
|
||||
else
|
||||
@@ -136,7 +163,7 @@ namespace ReallifeGamemode.Server.Events
|
||||
{
|
||||
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
|
||||
MedicTask reviveTask = new MedicTask()
|
||||
@@ -166,83 +193,32 @@ namespace ReallifeGamemode.Server.Events
|
||||
}
|
||||
|
||||
//TODO PICTURE NOTIFICATION + SOUND für Medics
|
||||
|
||||
player.ClearAttachments();
|
||||
List<UserItem> fItem = dbContext.UserItems.Where(u => u.UserId == user.Id).ToList();
|
||||
foreach (var item in fItem)
|
||||
{
|
||||
IItem iItem = InventoryManager.GetItemById(item.ItemId);
|
||||
if (iItem is IWeaponDealItem obj)
|
||||
{
|
||||
int amount = item.Amount;
|
||||
|
||||
Vector3 dropPosition = PlayerExtension.GetPositionFromPlayer(player, 0.6f, 0);
|
||||
//new Vector3(player.Position.X, player.Position.Y, player.Position.Z - 0.8f);
|
||||
Random r = new Random();
|
||||
GTANetworkAPI.Object grndObject;
|
||||
Vector3 textPos = dropPosition;
|
||||
|
||||
dropPosition.Z -= 1.05f;
|
||||
grndObject = NAPI.Object.CreateObject(3666746839, dropPosition, new Vector3(0, 0, r.Next(0, 360)), 255, 0);
|
||||
|
||||
GroundItem grndItem = new GroundItem { ItemId = iItem.Id, Amount = amount, Position = dropPosition };
|
||||
TextLabel grndTxtLbl = NAPI.TextLabel.CreateTextLabel(iItem.Name + " ~s~(~y~" + amount + "~s~)", textPos, 5, 0.5f, 4, new Color(255, 255, 255), false, 0);
|
||||
GroundItem.AddGroundItem(grndItem, grndObject, grndTxtLbl);
|
||||
|
||||
player.ClearAnimation();
|
||||
|
||||
dbContext.Remove(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
Job.JobBase job = Managers.JobManager.GetJob(player.GetUser().JobId ?? -1);
|
||||
if (job != null)
|
||||
{
|
||||
//ChatService.SendMessage(player, "Debug1");
|
||||
if (job.GetUsersInJob().Contains(player))
|
||||
{
|
||||
//ChatService.SendMessage(player, "Debug2");
|
||||
if (player.Vehicle != null)
|
||||
{
|
||||
//ChatService.SendMessage(player, "Debug3");
|
||||
/*if (player.Vehicle.GetData<bool>("timerJobVehicleRespawn") == true)
|
||||
{*/
|
||||
if (player.Vehicle.GetServerVehicle() is JobVehicle vehJ)
|
||||
{
|
||||
//ChatService.SendMessage(player, "Debug4");
|
||||
player.Vehicle.ResetData("timerJobVehicleRespawn");
|
||||
ServerVehicle sVeh = Managers.VehicleManager.GetServerVehicleFromVehicle(player.Vehicle);
|
||||
ServerVehicleExtensions.Spawn(sVeh, player.Vehicle);
|
||||
}
|
||||
else
|
||||
{
|
||||
//ChatService.SendMessage(player, "Debug5");
|
||||
}
|
||||
//}
|
||||
}
|
||||
if (Managers.JobManager.playerTimersJobVehicleRespawn.ContainsKey(player))
|
||||
{
|
||||
//ChatService.SendMessage(player, "Debug6");
|
||||
Managers.JobManager.playerTimersJobVehicleRespawn[player].Stop();
|
||||
}
|
||||
//ChatService.SendMessage(player, "Debug7");
|
||||
player.ResetData("PilotenBase");
|
||||
job.StopJob(player);
|
||||
ChatService.SendMessage(player, $"~y~[JOB]~s~ Du hast deinen Job ~o~{job.Name}~s~ beendet.");
|
||||
if (player.GetData<bool>("HatRoute") == true)
|
||||
{
|
||||
//ChatService.SendMessage(player, "Debug8");
|
||||
CheckPointHandle.DeleteCheckpoints(player);
|
||||
player.ResetData("HatRoute");
|
||||
}
|
||||
else
|
||||
{
|
||||
//ChatService.SendMessage(player, "Debug9");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//ChatService.SendMessage(player, "Debug10");
|
||||
}
|
||||
}
|
||||
dbContext.SaveChanges();
|
||||
@@ -269,6 +245,8 @@ namespace ReallifeGamemode.Server.Events
|
||||
}
|
||||
|
||||
player.SafeTeleport(new Vector3(-495.45, -336.33, 34.5), 0, true);
|
||||
|
||||
player.TriggerEvent("enableSpawnschutz");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -308,6 +308,7 @@ namespace ReallifeGamemode.Server.Events
|
||||
user.SetData("duty", true);
|
||||
player.SendNotification("Du bist nun ~g~im Dienst.");
|
||||
player.TriggerEvent("toggleDutyMode", true);
|
||||
player.TriggerEvent("abortSpawnschutz");
|
||||
if (player.GetUser().FactionId == 2) //Fire Department
|
||||
{
|
||||
Medic.UpdateDutyMedics();
|
||||
@@ -627,10 +628,9 @@ namespace ReallifeGamemode.Server.Events
|
||||
|
||||
if(player.GetData<bool>("SellVehicleDecision") == true && player.HasData("VehicleToSell"))
|
||||
{
|
||||
InteractionManager.SellPlayerVehicle(player, player.GetData<int>("VehicleToSell"));
|
||||
InteractionManager.SellServerVehicle(player, player.GetData<int>("VehicleToSell"));
|
||||
player.ResetData("SellVehicleDecision");
|
||||
player.ResetData("VehicleToSell");
|
||||
player.SendNotification("~g~Du hast dein Fahrzeug verkauft");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -904,7 +904,7 @@ namespace ReallifeGamemode.Server.Events
|
||||
[RemoteEvent("keyPress:ControllH")]
|
||||
public void KeyPressControllH(Player player)
|
||||
{
|
||||
player.ToggleSurrender();
|
||||
player.CheckToggleSurrender();
|
||||
}
|
||||
|
||||
#endregion User Key
|
||||
|
||||
@@ -100,7 +100,12 @@ namespace ReallifeGamemode.Server.Events
|
||||
|
||||
if (user.Wanteds > 0)
|
||||
{
|
||||
ChatService.HQMessage("Der Straftäter" + user.Name + " hat sich mit " + user.Wanteds + " Wanteds eingeloggt.");
|
||||
ChatService.HQMessage("Der Straftäter " + user.Name + " hat sich mit " + user.Wanteds + " Wanteds eingeloggt.");
|
||||
}
|
||||
|
||||
if (user.Wanteds == 0)
|
||||
{
|
||||
player.TriggerEvent("enableSpawnschutz");
|
||||
}
|
||||
|
||||
if (user.Group != null)
|
||||
@@ -159,7 +164,7 @@ namespace ReallifeGamemode.Server.Events
|
||||
}
|
||||
else
|
||||
{
|
||||
Jail.Check_PutBehindBars(user);
|
||||
Jail.Check_PutBehindBars(user, "cell");
|
||||
}
|
||||
|
||||
player.Dimension = 0;
|
||||
|
||||
@@ -3,11 +3,16 @@ using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using GTANetworkAPI;
|
||||
using ReallifeGamemode.Server.Extensions;
|
||||
using ReallifeGamemode.Server.Services;
|
||||
|
||||
namespace ReallifeGamemode.Server.Events
|
||||
{
|
||||
internal class PlayerEvent : Script
|
||||
{
|
||||
[ServerEvent(Event.PlayerDamage)]
|
||||
public void OnPlayerDamage(Player player, float healthLoss, float armorLoss){
|
||||
}
|
||||
|
||||
[RemoteEvent("CLIENT:SET_InFrontOfPos")]
|
||||
public void SetFrontOfPos(Player player, Vector3 pos)
|
||||
{
|
||||
@@ -23,5 +28,11 @@ namespace ReallifeGamemode.Server.Events
|
||||
player.SendNotification("Du wurdest ~b~AFK~s~ gesetzt", true);
|
||||
}
|
||||
}
|
||||
|
||||
[RemoteEvent("CLIENT:Handsup_TogglePlayerHup")]
|
||||
public void PlayerToggleHandsupEvent(Player player)
|
||||
{
|
||||
player.ToggleSurrender();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,9 +29,9 @@ namespace ReallifeGamemode.Server.Events
|
||||
player.TriggerEvent("SERVER:Login_Error", "Das Passwort muss aus mindestens 6 Zeichen bestehen.");
|
||||
return;
|
||||
}
|
||||
if (dbContext.Users.Where(u => u.SocialClubName == player.SocialClubName).Count() >= 3)
|
||||
if (dbContext.Users.Where(u => u.SocialClubName == player.SocialClubName).Count()!= 0)
|
||||
{
|
||||
player.TriggerEvent("SERVER:Login_Error", "Es sind schon 3 Konten mit dieser Socialclub-ID registriert.");
|
||||
player.TriggerEvent("SERVER:Login_Error", "Es ist schon ein Konto mit dieser Socialclub-ID registriert.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ namespace ReallifeGamemode.Server.Extensions
|
||||
player.Armor = armor;
|
||||
}
|
||||
|
||||
public static void SetJailTime(this User user, bool killed)
|
||||
public static void SetJailTime(this User user, bool killed, DatabaseContext dbContext)
|
||||
{
|
||||
if (user == null)
|
||||
{
|
||||
@@ -101,6 +101,13 @@ namespace ReallifeGamemode.Server.Extensions
|
||||
time *= 2;
|
||||
}
|
||||
|
||||
int factionMoney = user.Wanteds * 6;
|
||||
var executiveFactions = dbContext.Factions.Include(f => f.BankAccount).Where(f => f.Id == 1 || f.Id == 3);
|
||||
foreach(var faction in executiveFactions)
|
||||
{
|
||||
faction.BankAccount.Balance += factionMoney;
|
||||
}
|
||||
|
||||
user.Wanteds = 0;
|
||||
user.JailTime = time;
|
||||
}
|
||||
@@ -138,7 +145,7 @@ namespace ReallifeGamemode.Server.Extensions
|
||||
|
||||
public static bool IsAfk(this Player player)
|
||||
{
|
||||
if(!player.HasSharedData("isAfk"))
|
||||
if (!player.HasSharedData("isAfk"))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -339,7 +346,7 @@ namespace ReallifeGamemode.Server.Extensions
|
||||
int nameTagColor = 0;
|
||||
|
||||
Player player = user.Player;
|
||||
if(player == null || !player.IsLoggedIn())
|
||||
if (player == null || !player.IsLoggedIn())
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -347,7 +354,7 @@ namespace ReallifeGamemode.Server.Extensions
|
||||
bool duty = user.GetData<bool>("duty");
|
||||
bool adminUnshow = user.GetData<bool>("adminUnshow");
|
||||
|
||||
if(adminUnshow)
|
||||
if (adminUnshow)
|
||||
{
|
||||
blipColor = -1;
|
||||
nameTagColor = -3;
|
||||
@@ -437,6 +444,11 @@ namespace ReallifeGamemode.Server.Extensions
|
||||
}
|
||||
}
|
||||
|
||||
public static void CheckToggleSurrender(this Player player)
|
||||
{
|
||||
player.TriggerEvent("SERVER:Handsup_CheckIfPlayerCanHandsup");
|
||||
}
|
||||
|
||||
public static void ToggleSurrender(this Player player)
|
||||
{
|
||||
if (player.HasAnimation("hup"))
|
||||
|
||||
@@ -15,19 +15,32 @@ namespace ReallifeGamemode.Server.Extensions
|
||||
|
||||
public static Vehicle GetVehicle(this ServerVehicle veh) => VehicleManager.GetVehicleFromServerVehicle(veh);
|
||||
|
||||
public static Vehicle Spawn(this ServerVehicle veh, Vehicle currentVeh = null)
|
||||
public static Vehicle Spawn(this ServerVehicle veh, Vehicle currentVeh)
|
||||
{
|
||||
if (currentVeh != null) VehicleManager.DeleteVehicle(currentVeh);
|
||||
if (currentVeh == null)
|
||||
{
|
||||
currentVeh = VehicleManager.GetVehicleFromServerVehicle(veh);
|
||||
}
|
||||
|
||||
if(currentVeh != null)
|
||||
{
|
||||
VehicleManager.DeleteVehicle(currentVeh);
|
||||
}
|
||||
|
||||
Vector3 position = veh.Position;
|
||||
uint model = (uint)veh.Model;
|
||||
float heading = veh.Heading;
|
||||
int c1 = veh.PrimaryColor;
|
||||
int c2 = veh.SecondaryColor;
|
||||
|
||||
Vehicle newVeh = NAPI.Vehicle.CreateVehicle(model, position, heading, c1, c2, "", 255, false, false);
|
||||
|
||||
veh.Livery = veh.Livery;
|
||||
VehicleStreaming.SetEngineState(newVeh, false);
|
||||
VehicleStreaming.SetLockStatus(newVeh, veh.Locked);
|
||||
|
||||
VehicleManager.AddVehicle(veh, newVeh);
|
||||
|
||||
newVeh.Rotation = new Vector3(0, 0, heading);
|
||||
|
||||
newVeh.SetSharedData("drivenDistance", veh.DistanceDriven);
|
||||
@@ -71,6 +84,7 @@ namespace ReallifeGamemode.Server.Extensions
|
||||
{
|
||||
numberplate = "NV" + numberplate;
|
||||
}
|
||||
|
||||
NAPI.Vehicle.SetVehicleNumberPlate(newVeh, numberplate);
|
||||
veh.NumberPlate = numberplate;
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace ReallifeGamemode.Server.WeaponDeal
|
||||
}
|
||||
else if (factionID == 5)
|
||||
{
|
||||
client.TriggerEvent("SERVER:Util_setWaypoint", 1157.56, -1518.56); // Terror
|
||||
client.TriggerEvent("SERVER:Util_setWaypoint", -1082.29, -1655.07); // Terror
|
||||
}
|
||||
else if (factionID == 6)
|
||||
{
|
||||
|
||||
@@ -195,6 +195,21 @@ namespace ReallifeGamemode.Server.Factions.Medic
|
||||
}
|
||||
}
|
||||
|
||||
public static void RemoveOldHealTask()
|
||||
{
|
||||
if (HealTasks.Count != 0)
|
||||
{
|
||||
foreach (var task in HealTasks.ToList())
|
||||
{
|
||||
var taskActive = DateTime.Now - task.Time;
|
||||
if (taskActive > TimeSpan.FromMinutes(10) && task.MedicName == "none")
|
||||
{
|
||||
delHealTask(PlayerService.GetPlayerByNameOrId(task.Victim));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[RemoteEvent("loadMedicTasks")]
|
||||
public void LoadMedicTasks(Player player, int type)
|
||||
{
|
||||
|
||||
@@ -44,11 +44,31 @@ namespace ReallifeGamemode.Server.Finance
|
||||
foreach (UserVehicle uVeh in dbContext.UserVehicles.Where(u => u.UserId == user.Id))
|
||||
{
|
||||
if (uVeh.Price == null)
|
||||
{
|
||||
vehicleTaxation += 400;
|
||||
continue;
|
||||
}
|
||||
vehicleTaxation += (int)(uVeh.Price * 0.005f);
|
||||
else
|
||||
vehicleTaxation += (int)(uVeh.Price * 0.0015f);
|
||||
|
||||
int taxation = uVeh.BusinessId switch
|
||||
{
|
||||
3 => 75, ///<see cref="Business.VapidCarDealerBusiness"/>
|
||||
4 => 200, ///<see cref="Business.PremiumDeluxeMotorsportCarDealerBusiness"/>
|
||||
5 => 150, ///<see cref="Business.BoatDealerBusiness"/>
|
||||
6 => 150, ///<see cref="Business.HelicopterDealerBusiness"/>
|
||||
7 => 150, ///<see cref="Business.AirplaneDealerBusiness"/>
|
||||
8 => 50, ///<see cref="Business.BikeDealerBusiness"/>
|
||||
9 => 20, ///<see cref="Business.BeachDealerBusiness"/>
|
||||
10 => 50, ///<see cref="Business.LastTrainDealerBusiness"/>
|
||||
11 => 100, ///<see cref="Business.SUVDealerBusiness"/>
|
||||
12 => 50, ///<see cref="Business.AdminDealerBusiness"/>
|
||||
13 => 100, ///<see cref="Business.ClassicAndLuxuryCarshop"/>
|
||||
14 => 200, ///<see cref="Business.OldschoolCarshop"/>
|
||||
_ => 0,
|
||||
};
|
||||
|
||||
if (taxation is 0)
|
||||
Console.WriteLine($"[FINANCE] USER: {user.Name} ({user.Id}) has no BusinessId on UserVehicle ({uVeh.Id})");
|
||||
|
||||
vehicleTaxation += taxation;
|
||||
}
|
||||
}
|
||||
return vehicleTaxation;
|
||||
@@ -180,7 +200,7 @@ namespace ReallifeGamemode.Server.Finance
|
||||
|
||||
if (putInJail != 0 && minusJail)
|
||||
{
|
||||
Jail.Check_PutBehindBars(u);
|
||||
Jail.Check_PutBehindBars(u, "cell");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -189,13 +209,13 @@ namespace ReallifeGamemode.Server.Finance
|
||||
using var dbContext = new DatabaseContext();
|
||||
foreach (var player in NAPI.Pools.GetAllPlayers().Where(p => p.IsLoggedIn()))
|
||||
{
|
||||
if(player.IsAfk())
|
||||
if (player.IsAfk())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
User user = player.GetUser(dbContext);
|
||||
if(user == null)
|
||||
if (user == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using GTANetworkAPI;
|
||||
using Newtonsoft.Json;
|
||||
@@ -145,7 +145,7 @@ namespace ReallifeGamemode.Server.Gangwar
|
||||
int id = JsonConvert.DeserializeObject<int>(jsonId);
|
||||
if (id == -1)
|
||||
{
|
||||
ChatService.ErrorMessage(client, "Du befindest dich in keinem Gebiet!");
|
||||
ChatService.ErrorMessage(client, "Du befindest dich in keinem Gebiet");
|
||||
return;
|
||||
}
|
||||
using (var dbContext = new DatabaseContext())
|
||||
|
||||
@@ -217,8 +217,8 @@ namespace ReallifeGamemode.Server.Gangwar
|
||||
{
|
||||
using (var dbContext = new DatabaseContext())
|
||||
{
|
||||
ChatService.BroadcastFaction("~y~[GANGWAR] ~r~" + client.Name + "~w~ ist nicht im Gangwar beteiligt !", dbContext.Factions.Where(f => f.Name == getOwner()).FirstOrDefault());
|
||||
ChatService.BroadcastFaction("~y~[GANGWAR] ~r~" + client.Name + "~w~ ist nicht im Gangwar beteiligt !", dbContext.Factions.Where(f => f.Name == getAttacker()).FirstOrDefault());
|
||||
ChatService.BroadcastFaction("~y~[GANGWAR] ~r~" + client.Name + "~w~ ist nicht im Gangwar beteiligt!", dbContext.Factions.Where(f => f.Name == getOwner()).FirstOrDefault());
|
||||
ChatService.BroadcastFaction("~y~[GANGWAR] ~r~" + client.Name + "~w~ ist nicht im Gangwar beteiligt!", dbContext.Factions.Where(f => f.Name == getAttacker()).FirstOrDefault());
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -259,10 +259,13 @@ namespace ReallifeGamemode.Server.Gangwar
|
||||
return;
|
||||
}
|
||||
|
||||
string takeOverMessage = string.Empty;
|
||||
|
||||
if (getOwner() == FactionName)
|
||||
{
|
||||
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);
|
||||
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 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)
|
||||
{
|
||||
@@ -276,8 +279,9 @@ namespace ReallifeGamemode.Server.Gangwar
|
||||
}
|
||||
else if (getOwner() != FactionName)
|
||||
{
|
||||
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);
|
||||
takeOverMessage = $"~y~[GANGWAR] ~w~Die {getAttacker()} konnten das Gebiet ~g~{getName()} ~w~ der {getAttacker()} erfolgreich erobern.";
|
||||
//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)
|
||||
{
|
||||
if (o != null)
|
||||
@@ -294,6 +298,7 @@ namespace ReallifeGamemode.Server.Gangwar
|
||||
turf.Owner = this.Owner;
|
||||
turf.FactionId = attackerFaction.Id;
|
||||
}
|
||||
ChatService.Broadcast(takeOverMessage);
|
||||
dbContext.SaveChanges();
|
||||
}
|
||||
this.Attacker = null;
|
||||
@@ -332,7 +337,7 @@ namespace ReallifeGamemode.Server.Gangwar
|
||||
List<Player> leaders = context.Users.Include(u => u.Faction).Where(u => onlinePlayers.Contains(u.Name) && u.Faction.Name == attacker && u.FactionLeader).Select(u => u.Player).ToList();
|
||||
foreach (var l in leaders)
|
||||
{
|
||||
ChatService.ErrorMessage(l, "Gangwarstart ist nicht möglich, da die beteiligten Fraktionen nicht genügend Mitglieder aufweisen.");
|
||||
ChatService.ErrorMessage(l, "Du kannst keinen Gangwar starten, weil in der gegnerischen Fraktion zu wenig Spieler online sind");
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -358,9 +363,11 @@ namespace ReallifeGamemode.Server.Gangwar
|
||||
u.TriggerEvent("CLIENT:setAttackBlip", true, TurfID);
|
||||
u.TriggerEvent("GangwarScore", this.Attacker, this.Owner, this.Att_Score, this.Def_Score);
|
||||
u.SetData("inGangWar", getId());
|
||||
ChatService.SendMessage(u, "~y~[GANGWAR]~w~ Die " + getAttacker() + " haben das Gebiet ~y~" + TurfName + "~w~ der " + getOwner() + " angegriffen.");
|
||||
clientsInGangwar.Add(u);
|
||||
}
|
||||
|
||||
ChatService.Broadcast("~y~[GANGWAR]~w~ Die " + getAttacker() + " haben das Gebiet ~y~" + TurfName + "~w~ der " + getOwner() + " angegriffen.");
|
||||
|
||||
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));
|
||||
this.TurfTick();
|
||||
|
||||
@@ -28,33 +28,35 @@ namespace ReallifeGamemode.Server.Inventory.Items
|
||||
if (user.Player == null || !user.Player.IsLoggedIn())
|
||||
return false;
|
||||
|
||||
if (InventoryManager.itemCooldown.ContainsKey(user.Player))
|
||||
if (!HasCooldownElapsed(user))
|
||||
{
|
||||
PlayerTimer timer = InventoryManager.itemCooldown[user.Player];
|
||||
int timeToNextUse = (int)(timer.startTime - DateTime.Now).TotalSeconds;
|
||||
uItem.GetUser().Player.TriggerEvent("Error", $"Versuche es nach {timeToNextUse} Sekunden erneut.");
|
||||
DateTime time = InventoryManager.itemCooldown[user.Id];
|
||||
int timeUntillNextUse = (int)(time - DateTime.Now).TotalSeconds;
|
||||
uItem.GetUser().Player.TriggerEvent("Error", $"Versuche es nach {timeUntillNextUse} Sekunden erneut.");
|
||||
return false;
|
||||
}
|
||||
PlayerTimer playerTimer = new PlayerTimer(user.Player, this, Cooldown);
|
||||
playerTimer.Elapsed += _CooldownElapse;
|
||||
InventoryManager.itemCooldown.Add(user.Player, playerTimer);
|
||||
|
||||
DateTime cooldown = DateTime.Now.AddMilliseconds(Cooldown);
|
||||
InventoryManager.itemCooldown.Add(user.Id, cooldown);
|
||||
|
||||
Consume(uItem);
|
||||
return true;
|
||||
}
|
||||
|
||||
private void _CooldownElapse(Player player, dynamic usableItem)
|
||||
private bool HasCooldownElapsed(User user)
|
||||
{
|
||||
NAPI.Task.Run(() =>
|
||||
{
|
||||
if (player == null || !player.IsLoggedIn())
|
||||
return;
|
||||
if (user.Player == null || !user.Player.IsLoggedIn())
|
||||
return false;
|
||||
|
||||
if (!InventoryManager.itemCooldown.ContainsKey(player))
|
||||
return;
|
||||
if (!InventoryManager.itemCooldown.ContainsKey(user.Id))
|
||||
return true;
|
||||
|
||||
InventoryManager.itemCooldown[player].Stop();
|
||||
InventoryManager.itemCooldown.Remove(player);
|
||||
});
|
||||
int timeRemaining = (int)(InventoryManager.itemCooldown[user.Id] - DateTime.Now).TotalSeconds;
|
||||
|
||||
if (timeRemaining <= 0)
|
||||
InventoryManager.itemCooldown.Remove(user.Id);
|
||||
|
||||
return timeRemaining <= 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace ReallifeGamemode.Server.Job
|
||||
|
||||
public const int WAGE_BEGINNER = 400;
|
||||
public const int WAGE_INTERMEDIATE = 600;
|
||||
public const int WAGE_PROFESSIOAL = 900;
|
||||
public const int WAGE_PROFESSIOAL = 650;
|
||||
|
||||
public const string BEGINNER = "Anfänger";
|
||||
public const string INTERMEDIATE = "Fortgeschrittener";
|
||||
@@ -424,13 +424,13 @@ namespace ReallifeGamemode.Server.Job
|
||||
player.TriggerEvent("CLIENT:PlaySound", "jobs/busfahrer/FahrplanAbfahrt", "wav", 15);
|
||||
player.StartCheckPointRoute(selectedRoute, MARKER_DELAY, MARKER_ID, MARKER_SIZE, MARKER_DIST, true, MARKER_EVENT);
|
||||
if (index != -1)
|
||||
player.SendChatMessage($"~y~[JOB]: ~w~Dir wurde ~g~ Route {index + 1}~w~ zugeteilt.");
|
||||
player.SendChatMessage($"~y~[JOB] ~w~Dir wurde ~g~ Route {index + 1}~w~ zugeteilt.");
|
||||
}
|
||||
|
||||
public override void LastCheckpoint(Player player)
|
||||
{
|
||||
Vehicle v = player.Vehicle;
|
||||
player.SendChatMessage("~y~[JOB]: ~w~Die neue Route lädt. Bitte warten...");
|
||||
player.SendChatMessage("~y~[JOB] ~w~Die neue Route lädt. Bitte warten...");
|
||||
string type = getPlayerRouteType(player);
|
||||
|
||||
if (type == BEGINNER)
|
||||
@@ -617,11 +617,18 @@ namespace ReallifeGamemode.Server.Job
|
||||
return;
|
||||
|
||||
if (BusDriverJob.playerVehiclePair[player].Model is BusDriverJob.VEHICLE_BEGINNER)
|
||||
{
|
||||
payWage(player, BusDriverJob.WAGE_BEGINNER / BusDriverJob.playerRouteCurrent[player.Name].Count);
|
||||
}
|
||||
else if (BusDriverJob.playerVehiclePair[player].Model is BusDriverJob.VEHICLE_INTERMEDIATE)
|
||||
{
|
||||
payWage(player, BusDriverJob.WAGE_INTERMEDIATE / BusDriverJob.playerRouteCurrent[player.Name].Count);
|
||||
payWage(player, 0);
|
||||
}
|
||||
else if (BusDriverJob.playerVehiclePair[player].Model is BusDriverJob.VEHICLE_PROFESSIONAL)
|
||||
{
|
||||
payWage(player, BusDriverJob.WAGE_PROFESSIOAL / BusDriverJob.playerRouteCurrent[player.Name].Count);
|
||||
}
|
||||
}
|
||||
|
||||
public static void payWage(Player player, int wage)
|
||||
@@ -635,13 +642,13 @@ namespace ReallifeGamemode.Server.Job
|
||||
user.BusSkill++;
|
||||
if (user.BusSkill == BusDriverJob.SKILL_INTERMEDIATE)
|
||||
{
|
||||
player.SendChatMessage($"~y~[JOB]: ~w~Du hast nun die Route ~g~{BusDriverJob.INTERMEDIATE} ~w~freigeschaltet!");
|
||||
player.SendChatMessage($"~y~[JOB]: ~w~Du kannst jetzt auch mit dem Coach fahren!");
|
||||
player.SendChatMessage($"~y~[JOB] ~w~Du hast nun die Route ~g~{BusDriverJob.INTERMEDIATE} ~w~freigeschaltet!");
|
||||
player.SendChatMessage($"~y~[JOB] ~w~Du kannst jetzt auch mit dem Coach fahren!");
|
||||
}
|
||||
if (user.BusSkill == BusDriverJob.SKILL_PROFESSIONAL)
|
||||
{
|
||||
player.SendChatMessage($"~y~[JOB]: ~w~Du hast nun die Route ~g~{BusDriverJob.PROFESSIONAL} ~w~freigeschaltet!");
|
||||
player.SendChatMessage($"~y~[JOB]: ~w~Du kannst jetzt auch mit dem Tourbus fahren!");
|
||||
player.SendChatMessage($"~y~[JOB] ~w~Du hast nun die Route ~g~{BusDriverJob.PROFESSIONAL} ~w~freigeschaltet!");
|
||||
player.SendChatMessage($"~y~[JOB] ~w~Du kannst jetzt auch mit dem Tourbus fahren!");
|
||||
}
|
||||
|
||||
dbContext.SaveChanges();
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace ReallifeGamemode.Server.Job
|
||||
_inJob.Add(player);
|
||||
jobPlayer.Add(player);
|
||||
|
||||
ChatService.SendMessage(player, $"~y~[Job]~s~ Du hast deinen Job ~o~{this.Name}~s~ gestartet.");
|
||||
ChatService.SendMessage(player, $"~y~[JOB]~s~ Du hast deinen Job ~o~{this.Name}~s~ gestartet.");
|
||||
|
||||
JobStart?.Invoke(player);
|
||||
}
|
||||
@@ -58,7 +58,7 @@ namespace ReallifeGamemode.Server.Job
|
||||
|
||||
if (quit)
|
||||
{
|
||||
ChatService.SendMessage(player, $"~y~[Job]~s~ Du hast deinen Job ~o~{this.Name}~s~ beendet.");
|
||||
ChatService.SendMessage(player, $"~y~[JOB]~s~ Du hast deinen Job ~o~{this.Name}~s~ beendet.");
|
||||
player.SafeTeleport(JobManager.playerJobStartPosition[player]);
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace ReallifeGamemode.Server.Job
|
||||
public const string PROFESSIONAL = "Profi";
|
||||
|
||||
public const int WAGE_BEGINNER = 300;
|
||||
public const int WAGE_INTERMEDIATE = 750;
|
||||
public const int WAGE_INTERMEDIATE = 900;
|
||||
|
||||
public const uint VEHICLE_BEGINNER = (uint)VehicleHash.Cuban800;
|
||||
public const uint VEHICLE_INTERMEDIATE = (uint)VehicleHash.Velum2;
|
||||
@@ -345,7 +345,7 @@ namespace ReallifeGamemode.Server.Job
|
||||
payWage(player, PilotJob.WAGE_INTERMEDIATE / PilotJob.playerRouteCurrent[player.Name].Count);
|
||||
}
|
||||
|
||||
private void payWage(Player player, int wage)
|
||||
public void payWage(Player player, int wage)
|
||||
{
|
||||
using var dbContext = new DatabaseContext();
|
||||
User user = player.GetUser(dbContext);
|
||||
@@ -356,8 +356,8 @@ namespace ReallifeGamemode.Server.Job
|
||||
user.PilotSkill++;
|
||||
if (user.PilotSkill == BusDriverJob.SKILL_INTERMEDIATE)
|
||||
{
|
||||
player.SendChatMessage($"~y~[JOB]: ~w~Du hast nun die Route ~g~{BusDriverJob.INTERMEDIATE} ~w~freigeschaltet!");
|
||||
player.SendChatMessage($"~y~[JOB]: ~w~Du kannst jetzt auch mit dem Velum fliegen!");
|
||||
player.SendChatMessage($"~y~[JOB] ~w~Du hast nun die Route ~g~{BusDriverJob.INTERMEDIATE} ~w~freigeschaltet!");
|
||||
player.SendChatMessage($"~y~[JOB] ~w~Du kannst jetzt auch mit dem Velum fliegen!");
|
||||
}
|
||||
|
||||
dbContext.SaveChanges();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using GTANetworkAPI;
|
||||
@@ -21,6 +21,8 @@ namespace ReallifeGamemode.Server.Job
|
||||
public override bool NeedVehicleToStart => false;
|
||||
|
||||
private const int MAX_BAG = 40;
|
||||
private const int WAGE = 80;
|
||||
private const int BONUS = 10;
|
||||
|
||||
public RefuseCollectorJob()
|
||||
{
|
||||
@@ -205,7 +207,7 @@ namespace ReallifeGamemode.Server.Job
|
||||
player.AddAttachment("binbag", true);
|
||||
}
|
||||
|
||||
ChatService.SendMessage(data.getPartnerClient(player), $"~y~[Job] ~s~Dein Partner hat den Job beendet.");
|
||||
ChatService.SendMessage(data.getPartnerClient(player), $"~y~[JOB] ~s~Dein Partner hat den Job beendet.");
|
||||
|
||||
data.removeClientFromData(player);
|
||||
return;
|
||||
@@ -254,10 +256,10 @@ namespace ReallifeGamemode.Server.Job
|
||||
|
||||
if (data.getTrashCount() == MAX_BAG)
|
||||
{
|
||||
ChatService.SendMessage((Player)player, "~y~[Job] ~s~Der Müllwagen ist voll. Fahre nun zurück zur Recyclinganlage!");
|
||||
ChatService.SendMessage((Player)player, "~y~[JOB] ~s~Der Müllwagen ist voll. Fahre nun zurück zur Recyclinganlage!");
|
||||
if (target != null)
|
||||
{
|
||||
ChatService.SendMessage((Player)target, "~y~[Job] ~s~Der Müllwagen ist voll! Er muss entleert werden.");
|
||||
ChatService.SendMessage((Player)target, "~y~[JOB] ~s~Der Müllwagen ist voll! Er muss entleert werden.");
|
||||
target.TriggerEvent("SERVER:MuellmannZuBase");
|
||||
}
|
||||
player.TriggerEvent("SERVER:MuellmannZuBase");
|
||||
@@ -265,18 +267,18 @@ namespace ReallifeGamemode.Server.Job
|
||||
else if (data.getTrashCount() > MAX_BAG)
|
||||
{
|
||||
data.setTrashCount(MAX_BAG);
|
||||
ChatService.ErrorMessage((Player)player, "Der Müllwagen ist schon voll.");
|
||||
ChatService.ErrorMessage((Player)player, "Der Müllwagen ist schon voll");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (target != null)
|
||||
{
|
||||
user1.Wage += 25;
|
||||
user2.Wage += 25;
|
||||
user1.Wage += WAGE / 2;
|
||||
user2.Wage += WAGE / 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
user1.Wage += 50;
|
||||
user1.Wage += WAGE;
|
||||
}
|
||||
dbContext.SaveChanges();
|
||||
}
|
||||
@@ -294,15 +296,15 @@ namespace ReallifeGamemode.Server.Job
|
||||
if (data.getDataFromClient(player) == null) continue;
|
||||
|
||||
Player target = data.getPartnerClient(player);
|
||||
if (target != null) ChatService.SendMessage((Player)target, $"~y~[Job] ~s~Fahrzeug wurde entleert. Säcke: {data.getTrashCount()}");
|
||||
ChatService.SendMessage((Player)player, $"~y~[Job] ~s~Fahrzeug wurde entleert. Säcke: {data.getTrashCount()}");
|
||||
if (target != null) ChatService.SendMessage((Player)target, $"~y~[JOB] ~s~Fahrzeug wurde entleert. Säcke: {data.getTrashCount()}");
|
||||
ChatService.SendMessage((Player)player, $"~y~[JOB] ~s~Fahrzeug wurde entleert. Säcke: {data.getTrashCount()}");
|
||||
//bonus pro sack
|
||||
using (var dbContext = new DatabaseContext())
|
||||
{
|
||||
User user1 = player.GetUser(dbContext);
|
||||
User user2 = target.GetUser(dbContext);
|
||||
|
||||
int bonus = 5 * data.getTrashCount();
|
||||
int bonus = BONUS * data.getTrashCount();
|
||||
|
||||
if (target != null)
|
||||
{
|
||||
@@ -384,8 +386,8 @@ namespace ReallifeGamemode.Server.Job
|
||||
if (target == null)
|
||||
return;
|
||||
|
||||
ChatService.SendMessage((Player)player, $"~y~[Job] ~s~Dein Partner ist {target.Name}!");
|
||||
ChatService.SendMessage((Player)target, $"~y~[Job] ~s~Dein Partner ist {player.Name}!");
|
||||
ChatService.SendMessage((Player)player, $"~y~[JOB] ~s~Dein Partner ist {target.Name}!");
|
||||
ChatService.SendMessage((Player)target, $"~y~[JOB] ~s~Dein Partner ist {player.Name}!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -401,8 +403,8 @@ namespace ReallifeGamemode.Server.Job
|
||||
if (target == null)
|
||||
return;
|
||||
|
||||
ChatService.SendMessage((Player)player, $"~y~[Job] ~s~Dein Partner ist {target.Name}!");
|
||||
ChatService.SendMessage((Player)target, $"~y~[Job] ~s~Dein Partner ist {player.Name}!");
|
||||
ChatService.SendMessage((Player)player, $"~y~[JOB] ~s~Dein Partner ist {target.Name}!");
|
||||
ChatService.SendMessage((Player)target, $"~y~[JOB] ~s~Dein Partner ist {player.Name}!");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -168,13 +168,13 @@ namespace ReallifeGamemode.Server.Managers
|
||||
|
||||
player.TriggerEvent("SERVER:Util_setWaypoint", spawnPos.X, spawnPos.Y);
|
||||
|
||||
User u = player.GetUser(dbContext);
|
||||
User user = player.GetUser(dbContext);
|
||||
|
||||
ServerVehicle newVeh = null;
|
||||
|
||||
if (target == "Spieler")
|
||||
{
|
||||
TransactionResult result = BankManager.TransferMoney(u, business, price, "Auto gekauft", dbContext);
|
||||
TransactionResult result = BankManager.TransferMoney(user, business, price, "Auto gekauft", dbContext);
|
||||
if (result == TransactionResult.SENDER_NOT_ENOUGH_MONEY)
|
||||
{
|
||||
player.SendNotification("~r~Du hast nicht genug Geld: " + price.ToMoneyString());
|
||||
@@ -190,17 +190,18 @@ namespace ReallifeGamemode.Server.Managers
|
||||
PositionY = spawnPos.Y,
|
||||
PositionZ = spawnPos.Z,
|
||||
Locked = false,
|
||||
UserId = player.GetUser().Id,
|
||||
UserId = user.Id,
|
||||
Model = shopVehicle.Model,
|
||||
PrimaryColor = 111,
|
||||
SecondaryColor = 111,
|
||||
Active = true,
|
||||
Price = price,
|
||||
BusinessId = business.Id
|
||||
};
|
||||
}
|
||||
else if (target == "Fraktion")
|
||||
{
|
||||
var faction = dbContext.Factions.Include(f => f.BankAccount).Where(f => f.Id == u.FactionId).First();
|
||||
var faction = dbContext.Factions.Include(f => f.BankAccount).Where(f => f.Id == user.FactionId).First();
|
||||
TransactionResult result = BankManager.TransferMoney(faction, business, (int)(price * FACTION_CAR_MULTIPLIER), "Auto gekauft", dbContext);
|
||||
if (result == TransactionResult.SENDER_NOT_ENOUGH_MONEY)
|
||||
{
|
||||
@@ -216,7 +217,7 @@ namespace ReallifeGamemode.Server.Managers
|
||||
PositionY = spawnPos.Y,
|
||||
PositionZ = spawnPos.Z,
|
||||
Locked = false,
|
||||
Owners = JsonConvert.SerializeObject(new int[] { player.GetUser(dbContext).FactionId.Value }),
|
||||
Owners = JsonConvert.SerializeObject(new int[] { user.FactionId.Value }),
|
||||
Model = shopVehicle.Model,
|
||||
PrimaryColor = 111,
|
||||
SecondaryColor = 111,
|
||||
@@ -243,7 +244,7 @@ namespace ReallifeGamemode.Server.Managers
|
||||
dbContext.ServerVehicles.Add(newVeh);
|
||||
dbContext.SaveChanges();
|
||||
|
||||
newVeh.Spawn();
|
||||
newVeh.Spawn(null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using GTANetworkAPI;
|
||||
using Newtonsoft.Json;
|
||||
@@ -475,26 +475,44 @@ namespace ReallifeGamemode.Server.Managers
|
||||
var backPrice = (int)(vehPrice * 0.4);
|
||||
player.SetData<bool>("SellVehicleDecision", true);
|
||||
player.SetData<int>("VehicleToSell", id);
|
||||
ChatService.SendMessage(player,"~s~Möchtes du das Fahrzeug ~y~" + veh.DisplayName + " ~s~wirklich für ~g~$" + backPrice + " ~s~verkaufen? Drücke ~g~J~s~ zum Bestätigen oder ~r~N ~s~zum Abbrechen");
|
||||
ChatService.SendMessage(player, "~s~Möchtes du das Fahrzeug ~y~" + veh.DisplayName + " ~s~wirklich für ~g~$" + backPrice + " ~s~verkaufen? Drücke ~g~J~s~ zum Bestätigen oder ~r~N ~s~zum Abbrechen");
|
||||
}
|
||||
}
|
||||
|
||||
public static void SellPlayerVehicle(Player player, int id)
|
||||
public static void SellServerVehicle(Player player, int id)
|
||||
{
|
||||
using var dbContext = new DatabaseContext();
|
||||
var user = player.GetUser(dbContext);
|
||||
var userVehicle = dbContext.UserVehicles.Where(v => v.Id == id && v.UserId == user.Id).FirstOrDefault();
|
||||
var vehPrice = userVehicle.Price;
|
||||
var backPrice = (int)(vehPrice * 0.4);
|
||||
GTANetworkAPI.Vehicle veh = VehicleManager.GetVehicleFromServerVehicle(userVehicle);
|
||||
user.BankAccount.Balance += backPrice;
|
||||
ServerVehicle serverVehicle = dbContext.ServerVehicles.FirstOrDefault(v => v.Id == id);
|
||||
|
||||
ChatService.SendMessage(player, $"~b~[INFO]~s~ Du hast durch den Autoverkauf ~g~{backPrice.ToMoneyString()}~s~ erhalten.");
|
||||
if(serverVehicle is UserVehicle)
|
||||
{
|
||||
UserVehicle userVehicle = dbContext.UserVehicles.Where(v => v.Id == id && v.UserId == user.Id).FirstOrDefault();
|
||||
var vehPrice = userVehicle.Price;
|
||||
var backPrice = (int)(vehPrice * 0.4);
|
||||
GTANetworkAPI.Vehicle veh = VehicleManager.GetVehicleFromServerVehicle(userVehicle);
|
||||
user.BankAccount.Balance += backPrice;
|
||||
|
||||
dbContext.UserVehicles.Remove(userVehicle);
|
||||
ChatService.SendMessage(player, $"~b~[INFO]~s~ Du hast durch den Autoverkauf ~g~{backPrice.ToMoneyString()}~s~ erhalten.");
|
||||
|
||||
VehicleManager.DeleteVehicle(veh);
|
||||
dbContext.UserVehicles.Remove(userVehicle);
|
||||
player.SendNotification("~g~Du hast dein Fahrzeug verkauft");
|
||||
}
|
||||
else if(serverVehicle is FactionVehicle)
|
||||
{
|
||||
FactionVehicle factionVehicle = dbContext.FactionVehicles.FirstOrDefault(v => v.Id == id);
|
||||
var backPrice = (int)(factionVehicle.BuyPrice * 1.5 * 0.4);
|
||||
user.Faction.BankAccount.Balance += backPrice;
|
||||
|
||||
ChatService.SendMessage(player, $"~b~[INFO]~s~ Die Fraktionskasse hat ~g~{backPrice.ToMoneyString()}~s~ erhalten.");
|
||||
|
||||
VehicleManager.DeleteVehicle(VehicleManager.GetVehicleFromServerVehicle(factionVehicle));
|
||||
|
||||
dbContext.FactionVehicles.Remove(factionVehicle);
|
||||
player.SendNotification("~g~Du hast dein Fraktionsfahrzeug verkauft");
|
||||
}
|
||||
dbContext.SaveChanges();
|
||||
|
||||
veh?.Delete();
|
||||
}
|
||||
|
||||
[RemoteEvent("CLIENT:InteractionMenu_FactionVehicleInteraction")]
|
||||
@@ -533,10 +551,10 @@ namespace ReallifeGamemode.Server.Managers
|
||||
return;
|
||||
}
|
||||
|
||||
var factionVehicleCount = dbContext.FactionVehicles.ToList().Where(v => v.Id == id && v.GetOwners().Contains(user.FactionId.Value)).Count();
|
||||
var factionVehicleCount = dbContext.FactionVehicles.ToList().Where(v => v.GetOwners().Contains(user.FactionId.Value)).Count();
|
||||
if (factionVehicleCount <= 6)
|
||||
{
|
||||
ChatService.ErrorMessage(player, "Die Fraktion braucht mindestens 6 Fahrzeuge");
|
||||
ChatService.ErrorMessage(player, "Die Fraktion braucht mindestens sechs Fahrzeuge");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -546,16 +564,13 @@ namespace ReallifeGamemode.Server.Managers
|
||||
ChatService.ErrorMessage(player, "Das Fahrzeug konnte nicht verkauft werden. Bitte melde dich bei der Leaderverwaltung");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
var backPrice = (int)(price.Price * 1.5 * 0.4);
|
||||
|
||||
user.Faction.BankAccount.Balance += backPrice;
|
||||
|
||||
ChatService.SendMessage(player, $"~b~[INFO]~s~ Die Fraktionskasse ~g~{backPrice.ToMoneyString()}~s~ erhalten.");
|
||||
|
||||
dbContext.FactionVehicles.Remove(factionVehicle);
|
||||
dbContext.SaveChanges();
|
||||
|
||||
veh?.Delete();
|
||||
player.SetData<bool>("SellVehicleDecision", true);
|
||||
player.SetData<int>("VehicleToSell", id);
|
||||
ChatService.SendMessage(player, "~s~Möchtes du das Fahrzeug ~y~" + veh.DisplayName + " ~s~wirklich für ~g~$" + backPrice + " ~s~verkaufen? Drücke ~g~J~s~ zum Bestätigen oder ~r~N ~s~zum Abbrechen");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -588,16 +603,16 @@ namespace ReallifeGamemode.Server.Managers
|
||||
{
|
||||
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~.");
|
||||
target.SendNotification($"~b~{player.GetUser().FactionRank.RankName} | {playername} ~w~hat dir ein Ticket in Höhe von ~y~{amount}$ ~w~gestellt.", true);
|
||||
target.SendNotification($"~w~Grund: ~g~{reason}~w~. ~x~Strafticket im Interaktionsmenü annehmen.", true);
|
||||
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~ausgestellt.", true);
|
||||
target.SendNotification($"~w~Grund: ~g~{reason}~w~. ~x~Das Ticket kann im Interaktionsmenü angenommen werden.", true);
|
||||
target.SetData("ticket_boolean", true);
|
||||
target.SetData<int>("ticket_amount", amount);
|
||||
target.SetData<Player>("ticket_player", player);
|
||||
}
|
||||
else
|
||||
{
|
||||
player.SendNotification("~r~Du kannst nur zwischen 1$ und 10000$ angeben!");
|
||||
player.SendNotification("~r~Du kannst nur zwischen $1 und $10.000 angeben!");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -632,7 +647,7 @@ namespace ReallifeGamemode.Server.Managers
|
||||
using var dbContext = new DatabaseContext();
|
||||
User targetUser = target.GetUser(dbContext);
|
||||
|
||||
if(targetUser == null)
|
||||
if (targetUser == null)
|
||||
{
|
||||
ChatService.PlayerNotFound(player);
|
||||
return;
|
||||
@@ -653,8 +668,8 @@ namespace ReallifeGamemode.Server.Managers
|
||||
targetUser.Points += amount;
|
||||
|
||||
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);
|
||||
ChatService.HQMessage(targetname + " hat von " + playername + " " + amount + " Strafpunkt(e) erhalten. Gesamt: " + targetUser.Points);
|
||||
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 (Grund: " + reason + "). Gesamt: " + targetUser.Points);
|
||||
|
||||
if (targetUser.Points < 0)
|
||||
{
|
||||
@@ -662,9 +677,7 @@ namespace ReallifeGamemode.Server.Managers
|
||||
}
|
||||
else if (targetUser.Points >= 12)
|
||||
{
|
||||
target.SendNotification($"~w~Grund: ~g~{reason}~w~. ~x~Du hast nun ~r~12/12 ~x~Strafpunkten.", true);
|
||||
target.SendNotification($"~w~Dir wird ~r~Auto- ~w~und ~r~Motorradführerschein ~w~entzogen.", true); //FlashNotif
|
||||
|
||||
target.SendNotification($"~x~Du hast nun ~r~12/12 ~x~Strafpunkte. ~w~Dir wurde dein ~r~Auto- und dein Motorradführerschein ~w~entzogen.", true);
|
||||
ChatService.HQMessage(targetname + " besitzt nun keinen Führerschein mehr.");
|
||||
|
||||
targetUser.Points = 0;
|
||||
@@ -673,7 +686,7 @@ namespace ReallifeGamemode.Server.Managers
|
||||
}
|
||||
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();
|
||||
@@ -703,16 +716,22 @@ namespace ReallifeGamemode.Server.Managers
|
||||
player.SendNotification($"~y~{targetname} ~g~hat das Ticket über ~b~{ticket_amount}$ ~g~angenommen und bezahlt.", true);
|
||||
using (var dbContext = new DatabaseContext())
|
||||
{
|
||||
target.GetUser(dbContext).BankAccount.Balance -= ticket_amount;
|
||||
if (player.GetUser().FactionId == 1)
|
||||
User user = player.GetUser(dbContext);
|
||||
User targetUser = target.GetUser(dbContext);
|
||||
targetUser.BankAccount.Balance -= ticket_amount;
|
||||
|
||||
FactionBankAccount lspdBankAccount = dbContext.Factions.Include(f => f.BankAccount).Where(f => f.Id == 1).First().BankAccount;
|
||||
FactionBankAccount fibBankAccount = dbContext.Factions.Include(f => f.BankAccount).Where(f => f.Id == 3).First().BankAccount;
|
||||
|
||||
if (user.FactionId == 1)
|
||||
{
|
||||
dbContext.Factions.Include(f => f.BankAccount).Where(f => f.Id == 1).First().BankAccount.Balance += (int)(ticket_amount / 100 * 70);
|
||||
dbContext.Factions.Include(f => f.BankAccount).Where(f => f.Id == 3).First().BankAccount.Balance += (int)(ticket_amount / 100 * 30);
|
||||
lspdBankAccount.Balance += (int)(ticket_amount / 100 * 60);
|
||||
fibBankAccount.Balance += (int)(ticket_amount / 100 * 40);
|
||||
}
|
||||
if (player.GetUser().FactionId == 1)
|
||||
else if (user.FactionId == 3)
|
||||
{
|
||||
dbContext.Factions.Include(f => f.BankAccount).Where(f => f.Id == 3).First().BankAccount.Balance += (int)(ticket_amount / 100 * 70);
|
||||
dbContext.Factions.Include(f => f.BankAccount).Where(f => f.Id == 1).First().BankAccount.Balance += (int)(ticket_amount / 100 * 30);
|
||||
fibBankAccount.Balance += (int)(ticket_amount / 100 * 60);
|
||||
lspdBankAccount.Balance += (int)(ticket_amount / 100 * 40);
|
||||
}
|
||||
dbContext.SaveChanges();
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace ReallifeGamemode.Server.Managers
|
||||
public static Dictionary<Player, List<InventoryItem>> backpackItems { get; set; } = new Dictionary<Player, List<InventoryItem>>();
|
||||
public static Dictionary<Player, List<InventoryItem>> vehicleItems { get; set; } = new Dictionary<Player, List<InventoryItem>>();
|
||||
|
||||
public static Dictionary<Player, PlayerTimer> itemCooldown = new Dictionary<Player, PlayerTimer>();
|
||||
public static Dictionary<int, DateTime> itemCooldown = new Dictionary<int, DateTime>();
|
||||
|
||||
public class InventoryItem
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
@@ -66,7 +66,7 @@ namespace ReallifeGamemode.Server.Managers
|
||||
|
||||
if (u.JobId == null)
|
||||
{
|
||||
ChatService.ErrorMessage(player, "Du hast momentan keinen Job, den du kündigen könntest.");
|
||||
ChatService.ErrorMessage(player, "Du bist bereits arbeitslos");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -89,20 +89,20 @@ namespace ReallifeGamemode.Server.Managers
|
||||
|
||||
if (u.JobId != null)
|
||||
{
|
||||
ChatService.ErrorMessage(player, "Du musst deinen alten Job kündigen, bevor du einen neuen ausüben kannst.");
|
||||
ChatService.ErrorMessage(player, "Du musst deinen alten Job kündigen, bevor du einen Neuen ausüben kannst");
|
||||
return;
|
||||
}
|
||||
|
||||
//Pilotjob
|
||||
if (jobId == 3 && u.FlyingLicensePlane == false)
|
||||
{
|
||||
ChatService.ErrorMessage(player, "Um diesen Job annehmen zu können, musst du einen Flugschein besitzen.");
|
||||
ChatService.ErrorMessage(player, "Um diesen Job annehmen zu können, musst du einen Flugschein besitzen");
|
||||
return;
|
||||
}
|
||||
|
||||
if (u.DriverLicenseVehicle == false)
|
||||
{
|
||||
ChatService.ErrorMessage(player, "Um diesen Job annehmen zu können, musst du einen Führerschein besitzen.");
|
||||
ChatService.ErrorMessage(player, "Um diesen Job annehmen zu können, musst du einen Führerschein besitzen");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -202,13 +202,22 @@ namespace ReallifeGamemode.Server.Managers
|
||||
{
|
||||
JobBase job = GetJob(player.GetUser().JobId ?? -1);
|
||||
|
||||
if (job != null && job.GetUsersInJob().Contains(player) && job.CheckVehicle(player, veh) && seat == 0)
|
||||
if (job != null && job.GetUsersInJob().Contains(player))
|
||||
{
|
||||
if (!playerTimersJobVehicleRespawn.ContainsKey(player))
|
||||
return;
|
||||
if(job.CheckVehicle(player, veh) && seat == 0)
|
||||
{
|
||||
if (!playerTimersJobVehicleRespawn.ContainsKey(player))
|
||||
return;
|
||||
|
||||
playerTimersJobVehicleRespawn[player].Stop();
|
||||
playerTimersJobVehicleRespawn.Remove(player);
|
||||
playerTimersJobVehicleRespawn[player].Stop();
|
||||
playerTimersJobVehicleRespawn.Remove(player);
|
||||
}
|
||||
else
|
||||
{
|
||||
player.StopAnimation();
|
||||
player.WarpOutOfVehicle();
|
||||
player.Position = player.Position.Add(new Vector3(0, 0, 2.0f));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -29,10 +29,12 @@ namespace ReallifeGamemode.Server.Managers
|
||||
|
||||
foreach (ServerVehicle veh in dbContext.ServerVehicles)
|
||||
{
|
||||
if (!veh.Active) continue;
|
||||
if (!veh.Active)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
Vehicle current = veh.Spawn();
|
||||
TuningManager.ApplyTuningToServerVehicle(veh);
|
||||
veh.Spawn(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,6 +32,9 @@ namespace ReallifeGamemode.Server.Managers
|
||||
|
||||
public static List<AmmunationPoint> AmmunationPoints = new List<AmmunationPoint>();
|
||||
|
||||
public static Vector3 eventportPosition;
|
||||
public static bool eventportActive = false;
|
||||
|
||||
public static void LoadPositionManager()
|
||||
{
|
||||
#region DutyPoints
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
using GTANetworkAPI;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Newtonsoft.Json;
|
||||
using ReallifeGamemode.Database.Entities;
|
||||
using ReallifeGamemode.Database.Models;
|
||||
using ReallifeGamemode.Server.Extensions;
|
||||
using ReallifeGamemode.Server.Log;
|
||||
using ReallifeGamemode.Server.Util;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -772,11 +774,13 @@ namespace ReallifeGamemode.Server.Managers
|
||||
|
||||
};
|
||||
|
||||
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 DateTime lastSave = DateTime.UtcNow;
|
||||
|
||||
private static ILogger<VehicleManager> logger = LogManager.GetLogger<VehicleManager>();
|
||||
|
||||
public static void CheckEnabledMods()
|
||||
{
|
||||
foreach (var name in _enabledMods)
|
||||
@@ -851,15 +855,23 @@ namespace ReallifeGamemode.Server.Managers
|
||||
{
|
||||
if (_serverVehicles.ContainsKey(serverVehicle.Id))
|
||||
{
|
||||
return;
|
||||
var spawnedHandle = _serverVehicles.Where(s => s.Key == serverVehicle.Id).First().Value;
|
||||
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))
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
_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)
|
||||
@@ -867,15 +879,18 @@ namespace ReallifeGamemode.Server.Managers
|
||||
ServerVehicle sVeh;
|
||||
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);
|
||||
}
|
||||
|
||||
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)
|
||||
@@ -911,9 +926,9 @@ namespace ReallifeGamemode.Server.Managers
|
||||
|
||||
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);
|
||||
}
|
||||
@@ -941,20 +956,15 @@ namespace ReallifeGamemode.Server.Managers
|
||||
public static void VehicleManagerVehicleDeath(Vehicle vehicle)
|
||||
{
|
||||
ServerVehicle serverVehicle = GetServerVehicleFromVehicle(vehicle);
|
||||
NAPI.Util.ConsoleOutput("VehicleDeat: Debug 1");
|
||||
|
||||
if (serverVehicle == null)
|
||||
{
|
||||
NAPI.Util.ConsoleOutput("VehicleDeath: Debug 2");
|
||||
vehicle.Delete();
|
||||
return;
|
||||
}
|
||||
InventoryManager.RemoveAllItemsfromVehicleInventory(vehicle);
|
||||
|
||||
NAPI.Util.ConsoleOutput("VehicleDeath: Debug 3");
|
||||
Vehicle newVeh = serverVehicle.Spawn(vehicle);
|
||||
newVeh.Repair();
|
||||
newVeh.Rotation = new Vector3(0, 0, serverVehicle.Heading);
|
||||
serverVehicle.Spawn(vehicle);
|
||||
}
|
||||
|
||||
[RemoteEvent("CLIENT:setMarkerBehindVehicle")]
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
<HintPath>..\Import\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition="'$(ConfigurationName)' != 'ServerBuild' AND '$(OS)' == 'Windows_NT'">
|
||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition="'$(ConfigurationName)' != 'ServerBuild' AND '$(OS)' == 'Windows_NT' AND '$(ConfigurationName)' != 'Database'">
|
||||
<Exec Command="powershell -NonInteractive -ExecutionPolicy ByPass -File ..\postbuild.ps1 -buildDirectory $(OutDir) -buildFilename $(TargetFileName)" LogStandardErrorAsError="True" />
|
||||
</Target>
|
||||
</Project>
|
||||
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using GTANetworkAPI;
|
||||
using Newtonsoft.Json;
|
||||
@@ -35,7 +35,7 @@ namespace ReallifeGamemode.Server.Report
|
||||
|
||||
if (listReports.FindAll(e => (e.isAssigned() == false)).Count == 0)
|
||||
{
|
||||
ChatService.ErrorMessage(client, "Im Moment gibt es keine Tickets.");
|
||||
ChatService.ErrorMessage(client, "Aktuell gibt es keine Tickets");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -92,7 +92,8 @@ namespace ReallifeGamemode.Server.Report
|
||||
}
|
||||
}
|
||||
|
||||
ChatService.SendMessage(player, "!{#008fff}[REPORT]!{#FFFFFF} Admin " + admin.Name + " hat dein Ticket angenommen! (Benutze /rc zum Schreiben)");
|
||||
ChatService.SendMessage(player, "!{#008fff}[REPORT]!{#FFFFFF} Admin " + admin.Name + " hat dein Ticket angenommen! Über /rc [Text] kannst du mit dem Admin schreiben.");
|
||||
ChatService.SendMessage(admin, "!{#008fff}[REPORT]!{#FFFFFF} Du hast das Ticket von " + player.Name + " angenommen! Über /rc [Text] kannst du mit dem User schreiben.");
|
||||
ChatService.BroadcastDutyAdmin("!{#008fff}[REPORT]!{#FFFFFF} " + admin.Name + " hat das Ticket von " + player.Name + " angenommen");
|
||||
}
|
||||
|
||||
|
||||
@@ -11,9 +11,7 @@ namespace ReallifeGamemode.Server.Util
|
||||
{
|
||||
private readonly Player player;
|
||||
private readonly Vehicle veh;
|
||||
private readonly IUsableItem usableItem;
|
||||
private readonly Timer timer;
|
||||
public readonly DateTime startTime;
|
||||
|
||||
public delegate void PlayerTimerElapsed(Player player, dynamic dynamic);
|
||||
|
||||
@@ -29,23 +27,10 @@ namespace ReallifeGamemode.Server.Util
|
||||
this.timer.Start();
|
||||
}
|
||||
|
||||
public PlayerTimer(Player player, IUsableItem usableItem, float milliseconds = 1000)
|
||||
{
|
||||
this.player = player;
|
||||
this.usableItem = usableItem;
|
||||
this.startTime = DateTime.Now.AddMilliseconds(milliseconds);
|
||||
|
||||
this.timer = new Timer(milliseconds);
|
||||
this.timer.Elapsed += Timer_Elapsed;
|
||||
this.timer.Start();
|
||||
}
|
||||
|
||||
private void Timer_Elapsed(object sender, ElapsedEventArgs e)
|
||||
{
|
||||
if (veh != null)
|
||||
Elapsed?.Invoke(player, veh);
|
||||
else
|
||||
Elapsed?.Invoke(player, usableItem);
|
||||
}
|
||||
|
||||
public void Stop()
|
||||
|
||||
@@ -32,9 +32,6 @@ namespace ReallifeGamemode.Server.Util
|
||||
timer5000.Start();
|
||||
timer5000.Elapsed += Timer5000_Elapsed;
|
||||
|
||||
timer10000.Start();
|
||||
timer10000.Elapsed += Timer10000_Elapsed;
|
||||
|
||||
timer60000.Start();
|
||||
timer60000.Elapsed += Timer60000_Elapsed;
|
||||
}
|
||||
@@ -74,14 +71,7 @@ namespace ReallifeGamemode.Server.Util
|
||||
Economy.Timer_Elapsed();
|
||||
WeaponDealManager.Timer_Elapsed();
|
||||
Medic.UpdateReviveSperre();
|
||||
});
|
||||
}
|
||||
|
||||
private static void Timer10000_Elapsed(object sender, ElapsedEventArgs e)
|
||||
{
|
||||
NAPI.Task.Run(() =>
|
||||
{
|
||||
Jail.BrakeOut_Elapsed();
|
||||
Medic.RemoveOldHealTask();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user