Merge branch 'develop'
This commit is contained in:
@@ -22,7 +22,6 @@ export default function ahelp(globalData: IGlobalData): void {
|
||||
ahelpBrowser = mp.browsers.new('package://assets/html/helpcommand/ahelp.html');
|
||||
mp.gui.chat.activate(false);
|
||||
mp.gui.cursor.show(true, true);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
@@ -37,7 +36,6 @@ export default function ahelp(globalData: IGlobalData): void {
|
||||
globalData.InInput = false;
|
||||
mp.gui.cursor.show(false, false);
|
||||
mp.gui.chat.activate(true);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -23,9 +23,7 @@ export default function playerBlips() {
|
||||
mp.gui.chat.push(parseInt(entity.blip) == 0 ? "Blip was not created" : "Blip was created");
|
||||
|
||||
mp.gui.chat.push("entity.blip is actually " + entity.blip);
|
||||
var blip = mp.blips.at(entity.blip);
|
||||
|
||||
blip.dimension = entityMp.dimension;
|
||||
var blip = entity.blip;
|
||||
|
||||
mp.gui.chat.push("1 -" + blip.getAlpha() + " 2- " + blip.doesExist() + " 3-" + blip.dimension + " 4-" + entityMp.dimension);
|
||||
|
||||
@@ -34,7 +32,7 @@ export default function playerBlips() {
|
||||
mp.game.invoke(Natives.SET_BLIP_CATEGORY, entity.blip, 7);
|
||||
mp.game.invoke(Natives.SHOW_HEADING_INDICATOR_ON_BLIP, entity.blip, true);
|
||||
mp.game.invoke(Natives.SET_BLIP_AS_SHORT_RANGE, entity.blip, true);
|
||||
//mp.game.invoke(Natives.SET_BLIP_DISPLAY, entity.blip, 8);
|
||||
mp.game.invoke(Natives.SET_BLIP_DISPLAY, entity.blip, 8);
|
||||
|
||||
}
|
||||
});
|
||||
@@ -44,10 +42,10 @@ export default function playerBlips() {
|
||||
|
||||
mp.events.addDataHandler("blipColor", (entity, value) => {
|
||||
if (entity.type === "player") {
|
||||
mp.gui.chat.push("Setting Blip color...");
|
||||
//mp.gui.chat.push("Setting Blip color...");
|
||||
let color = parseInt(value);
|
||||
entity.setBlipColor(isNaN(color) ? 0 : color);
|
||||
mp.gui.chat.push("Player blip color was set.");
|
||||
// mp.gui.chat.push("Player blip color was set.");
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -18,7 +18,7 @@ export default function deathScreen() {
|
||||
var fade;
|
||||
var deathDate: Date;
|
||||
var taskTimeout = false;
|
||||
const maxDeathTime = 30;
|
||||
const maxDeathTime = 120;
|
||||
const medicJobTime = maxDeathTime * -1;
|
||||
|
||||
mp.game.gameplay.setFadeOutAfterDeath(false);
|
||||
|
||||
@@ -12,6 +12,7 @@ const Point = NativeUI.Point;
|
||||
const Color = NativeUI.Color;
|
||||
let screenRes = mp.game.graphics.getScreenResolution(0, 0);
|
||||
import vehicleColors from './colors';
|
||||
import moneyformat from '../moneyformat';
|
||||
|
||||
export default function tuning(globalData: IGlobalData) {
|
||||
var keyBound = false;
|
||||
@@ -24,36 +25,40 @@ export default function tuning(globalData: IGlobalData) {
|
||||
const carModTypes = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 18, 22, -1, 25, 27, 28, 33, 34, 35, 38, 39, 40, 41, 42, 43, 44, 46, 48, 69];
|
||||
|
||||
const carModSlotName = [
|
||||
{ Slot: 0, Name: "Spoiler", Price: 2000 },
|
||||
{ Slot: 1, Name: "Frontstoßstange", Price: 2000},
|
||||
{ Slot: 2, Name: "Heckstoßstange", Price: 2000 },
|
||||
{ Slot: 3, Name: "Seitenschweller", Price: 2000 },
|
||||
{ Slot: 4, Name: "Auspuff", Price: 2000 },
|
||||
{ Slot: 5, Name: "Rahmen", Price: 2000 },
|
||||
{ Slot: 6, Name: "Kühlergrill", Price: 2000 },
|
||||
{ Slot: 0, Name: "Spoiler", Price: 1000 },
|
||||
{ Slot: 1, Name: "Frontstoßstange", Price: 1500},
|
||||
{ Slot: 2, Name: "Heckstoßstange", Price: 1500 },
|
||||
{ Slot: 3, Name: "Seitenschweller", Price: 1500 },
|
||||
{ Slot: 4, Name: "Auspuff", Price: 500 },
|
||||
{ Slot: 5, Name: "Rahmen", Price: 1000 },
|
||||
{ Slot: 6, Name: "Kühlergrill", Price: 1000 },
|
||||
{ Slot: 7, Name: "Motorhaube", Price: 2000 },
|
||||
{ Slot: 8, Name: "Extra 1", Price: 2000 },
|
||||
{ Slot: 9, Name: "Extra 2", Price: 2000 },
|
||||
{ Slot: 10, Name: "Dach", Price: 2000 },
|
||||
{ Slot: 11, Name: "Motor", Price: 2000 },
|
||||
{ Slot: 12, Name: "Bremsen", Price: 2000 },
|
||||
{ Slot: 13, Name: "Getriebe", Price: 2000 },
|
||||
{ Slot: 14, Name: "Hupe", Price: 2000 },
|
||||
{ Slot: 10, Name: "Dach", Price: 1500 },
|
||||
{ Slot: 11, Name: "Motor", Price: 50000 },
|
||||
{ Slot: 12, Name: "Bremsen", Price: 30000 },
|
||||
{ Slot: 13, Name: "Getriebe", Price: 15000 },
|
||||
{ Slot: 14, Name: "Hupe", Price: 500 },
|
||||
{ Slot: 15, Name: "Federung", Price: 2000 },
|
||||
{ Slot: 18, Name: "Turbo", Price: 2000 },
|
||||
{ Slot: 22, Name: "Licht", Price: 2000 },
|
||||
{ Slot: 23, Name: "Reifen", Price: 2000 },
|
||||
{ Slot: -1, Name: "Lackierung", Price: 2000 },
|
||||
{ Slot: 25, Name: "Nummernschildhalter", Price: 2000 },
|
||||
{ Slot: 27, Name: "Innenausstatung", Price: 2000 },
|
||||
{ Slot: 28, Name: "Wackelkopf", Price: 2000 },
|
||||
{ Slot: 33, Name: "Lenkrad", Price: 2000 },
|
||||
{ Slot: 34, Name: "Schalthebel", Price: 2000 },
|
||||
{ Slot: 35, Name: "Schild", Price: 2000 },
|
||||
{ Slot: 18, Name: "Turbo", Price: 40000 },
|
||||
{ Slot: 22, Name: "Licht", Price: 500 },
|
||||
{ Slot: 23, Name: "Reifen", Price: 1000 },
|
||||
{ Slot: -1, Name: "Lackierung", Price: 1000 },
|
||||
{ Slot: 25, Name: "Nummernschildhalter", Price: 500 },
|
||||
{ Slot: 27, Name: "Innenausstatung", Price: 500 },
|
||||
{ Slot: 28, Name: "Wackelkopf", Price: 200 },
|
||||
{ Slot: 33, Name: "Lenkrad", Price: 300 },
|
||||
{ Slot: 34, Name: "Schalthebel", Price: 200 },
|
||||
{ Slot: 35, Name: "Schild", Price: 200 },
|
||||
{ Slot: 38, Name: "Hydraulik", Price: 2000 },
|
||||
{ Slot: 39, Name: "Motorabdeckung", Price: 2000 },
|
||||
{ Slot: 40, Name: "Luftfilter", Price: 2000 },
|
||||
{ Slot: 46, Name: "Fenster", Price: 2000 },
|
||||
{ Slot: 40, Name: "Luftfilter", Price: 1000 },
|
||||
{ Slot: 41, Name: "Domstrebe", Price: 1000 },
|
||||
{ Slot: 42, Name: "Scheinwerferabdeckung", Price: 500 },
|
||||
{ Slot: 43, Name: "Nebelscheinwerfer", Price: 1000 },
|
||||
{ Slot: 44, Name: "Dach-Extra", Price: 1000 },
|
||||
{ Slot: 46, Name: "Fenster", Price: 1000 },
|
||||
{ Slot: 48, Name: "Design", Price: 2000 }
|
||||
];
|
||||
|
||||
@@ -156,7 +161,11 @@ export default function tuning(globalData: IGlobalData) {
|
||||
}
|
||||
});
|
||||
|
||||
mp.events.add("showTuningMenu", () => {
|
||||
var currentMod = new Array<number>();
|
||||
var currentActiveModItem = new Array<NativeUI.UIMenuItem>();
|
||||
var currentSelectedItem: VehicleModMenuItem = null;
|
||||
|
||||
mp.events.add("showTuningMenu", (noMoney) => {
|
||||
mp.events.call("hideTuningInfo", false);
|
||||
mp.gui.chat.show(false);
|
||||
|
||||
@@ -178,12 +187,8 @@ export default function tuning(globalData: IGlobalData) {
|
||||
repairItem.BackColor = new Color(94, 94, 94);
|
||||
repairItem.HighlightedBackColor = new Color(105, 105, 105);
|
||||
|
||||
var currentMod = new Array<number>();
|
||||
var currentActiveModItem = new Array<NativeUI.UIMenuItem>();
|
||||
|
||||
carModTypes.forEach((modType) => {
|
||||
|
||||
var mod = null;
|
||||
var mod: number = null;
|
||||
|
||||
if (modType === 22) { // Lichter
|
||||
var hlColor = localVehicle.getVariable("headlightColor");
|
||||
@@ -221,6 +226,9 @@ export default function tuning(globalData: IGlobalData) {
|
||||
}
|
||||
}
|
||||
|
||||
var price = noMoney? 0 : getModSlotPrice(modType);
|
||||
|
||||
|
||||
if (mod === null) {
|
||||
mod = localVehicle.getMod(modType);
|
||||
}
|
||||
@@ -247,7 +255,8 @@ export default function tuning(globalData: IGlobalData) {
|
||||
modText = mp.game.ui.getLabelText(localVehicle.getModTextLabel(modType, x));
|
||||
if (modText === "NULL") modText = getModName(localVehicle, modType, x);
|
||||
}
|
||||
var item = new UIMenuItem(modText);
|
||||
var item = new VehicleModMenuItem(modText);
|
||||
item.price = price;
|
||||
modMenu.AddItem(item);
|
||||
|
||||
if (x === mod) {
|
||||
@@ -255,6 +264,9 @@ export default function tuning(globalData: IGlobalData) {
|
||||
currentActiveModItem[modType] = item;
|
||||
modMenu.CurrentSelection = x;
|
||||
}
|
||||
else {
|
||||
item.SetRightLabel("$"+ moneyformat(price));
|
||||
}
|
||||
}
|
||||
|
||||
modMenu.IndexChange.on((index: number) => {
|
||||
@@ -272,13 +284,13 @@ export default function tuning(globalData: IGlobalData) {
|
||||
}
|
||||
});
|
||||
|
||||
modMenu.ItemSelect.on((item: NativeUI.UIMenuItem, index: number) => {
|
||||
currentMod[modType] = index - 1;
|
||||
currentActiveModItem[modType].SetRightBadge(BadgeStyle.None);
|
||||
item.SetRightBadge(BadgeStyle.Car);
|
||||
currentActiveModItem[modType] = item;
|
||||
modMenu.ItemSelect.on((item: VehicleModMenuItem, index: number) => {
|
||||
if (currentMod[modType] == index - 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
mp.events.callRemote("setVehicleMod", modType, index);
|
||||
currentSelectedItem = item;
|
||||
mp.events.callRemote("setVehicleMod", modType, index, price);
|
||||
});
|
||||
|
||||
modMenu.MenuClose.on(() => {
|
||||
@@ -311,6 +323,15 @@ export default function tuning(globalData: IGlobalData) {
|
||||
|
||||
});
|
||||
|
||||
mp.events.add("SERVER:Tuning_ModSucessfull", (modType: number, index: number) => {
|
||||
currentMod[modType] = index - 1;
|
||||
currentActiveModItem[modType].SetRightLabel("$" + moneyformat(currentSelectedItem.price));
|
||||
currentActiveModItem[modType].SetRightBadge(NativeUI.BadgeStyle.None);
|
||||
currentSelectedItem.SetRightBadge(BadgeStyle.Car);
|
||||
currentSelectedItem.SetRightLabel("");
|
||||
currentActiveModItem[modType] = currentSelectedItem;
|
||||
});
|
||||
|
||||
mp.events.add("playerLeaveVehicle", () => {
|
||||
if (keyBound) {
|
||||
mp.events.call("hideTuningInfo", true);
|
||||
@@ -435,6 +456,10 @@ export default function tuning(globalData: IGlobalData) {
|
||||
return realModName;
|
||||
}
|
||||
|
||||
function getModSlotPrice(modType: number): number {
|
||||
return carModSlotName.filter(x => x.Slot == modType)[0].Price;
|
||||
}
|
||||
|
||||
function setHeadlightsColor(vehicle, index) {
|
||||
|
||||
if (!vehicle) {
|
||||
@@ -552,4 +577,8 @@ export default function tuning(globalData: IGlobalData) {
|
||||
|
||||
mp.events.callRemote("CLIENT:TuningManager_SetVehicleColor", false, color);
|
||||
}
|
||||
|
||||
class VehicleModMenuItem extends UIMenuItem {
|
||||
public price: number;
|
||||
}
|
||||
}
|
||||
@@ -62,7 +62,7 @@ export default function voice(globalData: IGlobalData) {
|
||||
listeners.splice(idx, 1);
|
||||
}
|
||||
|
||||
mp.events.callRemote("CLIENT:RemoveVoiceListener");
|
||||
mp.events.callRemote("CLIENT:RemoveVoiceListener", target);
|
||||
}
|
||||
|
||||
setInterval(() => {
|
||||
@@ -83,7 +83,7 @@ export default function voice(globalData: IGlobalData) {
|
||||
});
|
||||
|
||||
listeners.forEach((player: PlayerMp) => {
|
||||
if (player) {
|
||||
if (player && mp.players.exists(player)) {
|
||||
if (player.handle !== 0) {
|
||||
const playerPos = player.position;
|
||||
let dist = mp.game.system.vdist(playerPos.x, playerPos.y, playerPos.z, localPos.x, localPos.y, localPos.z);
|
||||
@@ -98,6 +98,9 @@ export default function voice(globalData: IGlobalData) {
|
||||
removeListener(player);
|
||||
}
|
||||
}
|
||||
else {
|
||||
removeListener(player);
|
||||
}
|
||||
})
|
||||
}, 500)
|
||||
}
|
||||
|
||||
@@ -18,7 +18,12 @@
|
||||
<h1>Willkommen auf Life of German</h1>
|
||||
</div>
|
||||
<div id="content" class="form" role="form">
|
||||
In dieser Info findest du alles wichtige zum Thema Steuerung und Funktionen.<br /> <br />
|
||||
Was sind die ersten Schritte wirst du dich jetzt bestimmt fragen. Hier ein kleiner Guide.<br /> <br />
|
||||
1. Wenn du zum ersten mal Connectest würden wir dich bitten das Spiel nochmal neu zu Starten damit alle Daten auch zu 100% richtig geladen sind. Danke <br />
|
||||
2. Mach deine Scheine (Führerschein, Flugschein, Waffenschein) <br />
|
||||
3. Nimm einen Job in der Stadthalle an und verdien dir dein erstes Geld. <br />
|
||||
4. Kauf dir ein eigenes Auto. <br />
|
||||
5. Tritt einer Fraktion bei <br /> <br />
|
||||
|
||||
Steuerung: <br />
|
||||
T - Chat öffnen <br />
|
||||
@@ -27,6 +32,8 @@
|
||||
N - Fahrzeugmotor Starten <br />
|
||||
O - Onlineliste öffnen/schließen <br />
|
||||
I - Inventar öffnen/schließen <br />
|
||||
F4 - Mikrofon an und aus stellen <br /> <br />
|
||||
Mit /help kannst du dir jederzeit die Steuerung angucken. Und nun viel Spaß auf unseren Server.
|
||||
</div>
|
||||
|
||||
<a target="_blank" id="close"></a>
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
<div class="titletext">Rucksack</div>
|
||||
</div>
|
||||
<div class="items">
|
||||
<ul id="List0"></ul>
|
||||
<div id="List0"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -74,7 +74,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="items">
|
||||
<ul id="List4"></ul>
|
||||
<div id="List4"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -483,7 +483,7 @@
|
||||
row = 6;
|
||||
}
|
||||
|
||||
var Litem = document.createElement("li");
|
||||
var Litem = document.createElement("div");
|
||||
Litem.setAttribute("class", "item" + row);
|
||||
Litem.setAttribute("id", i);
|
||||
Litem.setAttribute("name", "List" + item.Category);
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import { IEntity, IPlayer, IEntityAttachments, IEntityAttachmentPool, IPlayerPool, IVehicle, IVehiclePool, VehicleSeat, EntityType } from "../../game";
|
||||
import { IEntity, IPlayer, IEntityAttachments, IEntityAttachmentPool, IPlayerPool, IVehicle, IVehiclePool, VehicleSeat, EntityType, IObjectPool, IObject } from "../../game";
|
||||
import { parseJson } from "../../util";
|
||||
import game from "../..";
|
||||
|
||||
class RageEntity implements IEntity {
|
||||
private entity: EntityMp;
|
||||
public __attachments: any[];
|
||||
public __attachmentObjects: any[];
|
||||
|
||||
get id(): number {
|
||||
if (!this.entity) {
|
||||
@@ -57,8 +59,6 @@ class RageEntity implements IEntity {
|
||||
|
||||
class RagePlayer extends RageEntity implements IPlayer {
|
||||
private player: PlayerMp;
|
||||
public __attachments: any[];
|
||||
public __attachmentObjects: any[];
|
||||
|
||||
get name(): string {
|
||||
return this.player.name;
|
||||
@@ -176,6 +176,20 @@ class RagePlayerPool implements IPlayerPool {
|
||||
}
|
||||
}
|
||||
|
||||
class RageObject extends RageEntity implements IObject {
|
||||
public object: ObjectMp;
|
||||
public __attachmentData: object;
|
||||
|
||||
constructor(object: ObjectMp, attachmentData: object) {
|
||||
if (!object) {
|
||||
throw "Object is undefined"
|
||||
}
|
||||
super(object);
|
||||
this.object = object;
|
||||
this.__attachmentData = attachmentData;
|
||||
}
|
||||
}
|
||||
|
||||
class RageVehicle extends RageEntity implements IVehicle {
|
||||
private vehicle: VehicleMp;
|
||||
|
||||
@@ -212,6 +226,38 @@ class RageVehicle extends RageEntity implements IVehicle {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class RageObjectPool implements IObjectPool {
|
||||
public attachmentDataMap: Map<ObjectMp, object>;
|
||||
|
||||
|
||||
setData(entity: ObjectMp, attachmentData: object): void {
|
||||
if (!this.attachmentDataMap)
|
||||
this.attachmentDataMap = new Map<ObjectMp, object>();
|
||||
|
||||
this.attachmentDataMap.set(entity, attachmentData);
|
||||
}
|
||||
|
||||
at(id: number): IObject {
|
||||
var object = mp.objects.atRemoteId(Number(id));
|
||||
|
||||
if (!object)
|
||||
return null;
|
||||
|
||||
return new RageObject(object, this.attachmentDataMap.get(object));
|
||||
}
|
||||
|
||||
forEach(fn: (entity: IObject) => void): void {
|
||||
mp.objects.forEach(e => {
|
||||
if (!e) {
|
||||
game.ui.sendChatMessage("forEach - e is null");
|
||||
return;
|
||||
}
|
||||
fn(new RageObject(e, this.attachmentDataMap.get(e)));
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
class RageVehiclePool implements IVehiclePool {
|
||||
at(id: number): IVehicle {
|
||||
var veh = mp.vehicles.atRemoteId(Number(id));
|
||||
@@ -242,4 +288,6 @@ export {
|
||||
RageEntityAttachmentPool,
|
||||
RageVehicle,
|
||||
RageVehiclePool,
|
||||
RageObject,
|
||||
RageObjectPool,
|
||||
}
|
||||
@@ -1,12 +1,13 @@
|
||||
import { IGame, IUi, IEvents, IPlayerPool, IVehiclePool, IEntityAttachmentPool } from "../../game";
|
||||
import { IGame, IUi, IEvents, IPlayerPool, IVehiclePool, IEntityAttachmentPool, IObjectPool } from "../../game";
|
||||
import RageEvents from "./events";
|
||||
import RageUi from "./ui";
|
||||
import { RagePlayerPool, RageVehiclePool, RageEntityAttachmentPool } from "./entities";
|
||||
import { RagePlayerPool, RageVehiclePool, RageEntityAttachmentPool, RageObjectPool } from "./entities";
|
||||
|
||||
export default class RageGame implements IGame {
|
||||
players: IPlayerPool = new RagePlayerPool();
|
||||
vehicles: IVehiclePool = new RageVehiclePool();
|
||||
attachments: IEntityAttachmentPool = new RageEntityAttachmentPool();
|
||||
objects: IObjectPool = new RageObjectPool();
|
||||
events: IEvents = new RageEvents;
|
||||
ui: IUi = new RageUi;
|
||||
|
||||
|
||||
3
ReallifeGamemode.Client/dlcpacks/Fahrstuhl/dlc.rpf
Normal file
3
ReallifeGamemode.Client/dlcpacks/Fahrstuhl/dlc.rpf
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:6f1478ada7534b954caaec991bb2a3a24767b978de82533965e0c21c3d02831f
|
||||
size 8491
|
||||
@@ -6,6 +6,7 @@
|
||||
players: IPlayerPool;
|
||||
vehicles: IVehiclePool;
|
||||
attachments: IEntityAttachmentPool;
|
||||
objects: IObjectPool;
|
||||
|
||||
disableDefaultEngineBehaviour(): void;
|
||||
}
|
||||
@@ -54,6 +55,10 @@ interface IPlayer extends IEntity {
|
||||
vehicle: IVehicle;
|
||||
}
|
||||
|
||||
interface IObject extends IEntity {
|
||||
__attachmentData: object;
|
||||
}
|
||||
|
||||
interface IEntityAttachments {
|
||||
remoteId: any;
|
||||
__attachments: any[];
|
||||
@@ -74,6 +79,10 @@ interface IEntityPool<TEntity> {
|
||||
forEach(fn: (entity: TEntity) => void): void;
|
||||
}
|
||||
|
||||
interface IObjectPool extends IEntityPool<IObject> {
|
||||
setData(entity: ObjectMp, attachmentData: object): void;
|
||||
}
|
||||
|
||||
interface IPlayerPool extends IEntityPool<IPlayer> {
|
||||
local: IPlayer;
|
||||
}
|
||||
@@ -149,6 +158,7 @@ export {
|
||||
IBrowser,
|
||||
|
||||
IPlayer,
|
||||
IObject,
|
||||
IEntityAttachments,
|
||||
IEntityAttachmentPool,
|
||||
IVehicle,
|
||||
@@ -156,6 +166,7 @@ export {
|
||||
IEntityPool,
|
||||
IPlayerPool,
|
||||
IVehiclePool,
|
||||
IObjectPool,
|
||||
|
||||
EventName,
|
||||
Key,
|
||||
|
||||
@@ -57,6 +57,7 @@ cityHall(globalData);
|
||||
|
||||
import adminSpeed from './admin/aspeed';
|
||||
adminSpeed();
|
||||
|
||||
import voice from './Voice/main';
|
||||
voice(globalData);
|
||||
|
||||
@@ -233,12 +234,14 @@ import bankMenuHandle from './Interaction/bankmenu';
|
||||
import InputHelper from './inputhelper';
|
||||
bankMenuHandle(globalData);
|
||||
|
||||
import Introduction from './Gui/introduction';
|
||||
Introduction(globalData);
|
||||
|
||||
import ahelp from './Gui/ahelp';
|
||||
ahelp(globalData);
|
||||
|
||||
import Introduction from './Gui/introduction';
|
||||
Introduction(globalData);
|
||||
|
||||
|
||||
import userhelp from './Gui/userhelp';
|
||||
userhelp(globalData);
|
||||
|
||||
|
||||
@@ -263,9 +263,9 @@
|
||||
self.attacker = null;
|
||||
//self.blip.setFlashes(false);
|
||||
mp.game.invoke(Natives.SET_BLIP_FLASHES, self.blip, false);
|
||||
self.blip.destroy();
|
||||
//self.blip.destroy();
|
||||
self.setColor(self.owner);
|
||||
self.blip.setColour(self.color);
|
||||
//self.blip.setColour(self.color);
|
||||
mp.game.invoke(Natives.SET_BLIP_COLOUR, self.blip, self.color);
|
||||
self.setLeaderColShape();
|
||||
return;
|
||||
@@ -499,9 +499,6 @@
|
||||
z++
|
||||
|
||||
}
|
||||
mp.gui.chat.push("DEBUG: Turf blips not removed: " + x + " / " + n);
|
||||
mp.gui.chat.push("DEBUG: Attack blips not removed: " + y);
|
||||
mp.gui.chat.push("DEBUG: LeaderBlips blips not removed: " + z);
|
||||
}
|
||||
|
||||
mp.events.add('GangAreas:Create', (turfsJSON) => {
|
||||
|
||||
@@ -23,40 +23,62 @@ export default function attachmentManager(game: IGame) {
|
||||
return;
|
||||
}
|
||||
|
||||
++attachId;
|
||||
|
||||
let entity: IEntity;
|
||||
if (entityRage.type === "player") {
|
||||
var player = game.players.at(entityRage.remoteId);
|
||||
entity = player;
|
||||
mp.gui.chat.push(`ATTACH: ${attachId} - Player: ${player.name}`);
|
||||
|
||||
} else if (entityRage.type === "vehicle") {
|
||||
var vehicle = game.vehicles.at(entityRage.remoteId);
|
||||
entity = vehicle;
|
||||
var realName = mp.game.ui.getLabelText(mp.game.vehicle.getDisplayNameFromVehicleModel(entityRage.model));
|
||||
mp.gui.chat.push(`ATTACH: ${attachId} - Vehicle: ${vehicle.remoteId}, ${realName}`);
|
||||
} else if (entityRage.type === "object") {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
let e = game.attachments.get(entity);
|
||||
|
||||
if (this.attachments.hasOwnProperty(id)) {
|
||||
if (e.__attachmentObjects == undefined) { e.__attachmentObjects = []; }
|
||||
|
||||
|
||||
if (!e.__attachmentObjects) { e.__attachmentObjects = []; }
|
||||
|
||||
|
||||
if (!e.__attachmentObjects.hasOwnProperty(id)) {
|
||||
|
||||
|
||||
let attInfo = this.attachments[id];
|
||||
let object = mp.objects.new(attInfo.model, entityRage.position);
|
||||
let rageObject = mp.objects.new(attInfo.model, entityRage.position);
|
||||
|
||||
|
||||
var bone = (typeof (attInfo.boneName) === 'string') ? entityRage.getBoneIndexByName(attInfo.boneName) : entityRage.getBoneIndex(attInfo.boneName)
|
||||
|
||||
let attachmentData = {
|
||||
targetEntity: entity.id,
|
||||
bone: bone,
|
||||
offset: attInfo.offset,
|
||||
rotation: attInfo.rotation
|
||||
};
|
||||
|
||||
game.objects.setData(rageObject, attachmentData); // hier hakt es mein freund
|
||||
|
||||
let object = game.objects.at(rageObject.remoteId);
|
||||
|
||||
//DEBUG MSG
|
||||
mp.gui.chat.push(`ATTACH: ${attachId} - bone = ${bone}`)
|
||||
|
||||
object.attachTo(entity.id,
|
||||
bone,
|
||||
attInfo.offset.x, attInfo.offset.y, attInfo.offset.z,
|
||||
attInfo.rotation.x, attInfo.rotation.y, attInfo.rotation.z,
|
||||
false, false, false, false, 2, true);
|
||||
rageObject.notifyStreaming = true;
|
||||
mp.gui.chat.push("Notified Stream.");
|
||||
game.wait(200);
|
||||
|
||||
//DEBUG MSG
|
||||
mp.gui.chat.push(`ATTACH: ${attachId} - Attaching ${JSON.stringify(attInfo)}`);
|
||||
e.__attachmentObjects[id] = object;
|
||||
e.__attachmentObjects[id] = rageObject;;
|
||||
}
|
||||
}
|
||||
/* else {
|
||||
@@ -187,15 +209,46 @@ export default function attachmentManager(game: IGame) {
|
||||
mp.events.add("entityStreamIn", (entityRage) => {
|
||||
if (entityRage.type === "player" || entityRage.type === "vehicle") {
|
||||
let entity;
|
||||
|
||||
if (entityRage.type === "player") {
|
||||
entity = game.players.at(entityRage.remoteId);
|
||||
} else if (entityRage.type === "vehicle") {
|
||||
entity = game.vehicles.at(entityRage.remoteId);
|
||||
}
|
||||
let e = game.attachments.get(entity);
|
||||
|
||||
if (entityRage.tye === "object") { //if is object
|
||||
game.wait(200);
|
||||
|
||||
mp.gui.chat.push("object streamed");
|
||||
entity = game.objects.at(entityRage.remoteId);
|
||||
|
||||
game.wait(200);
|
||||
mp.gui.chat.push("object try get data");
|
||||
game.wait(200);
|
||||
|
||||
|
||||
const { targetEntity, bone, offset, rotation } = entity.__attachmentData;
|
||||
game.wait(200);
|
||||
|
||||
+
|
||||
mp.gui.chat.push(targetEntity + "," + bone + "," + offset + "," + rotation);
|
||||
game.wait(200);
|
||||
|
||||
|
||||
entity.attachTo(
|
||||
targetEntity, bone,
|
||||
offset.x, offset.y, offset.z,
|
||||
rotation.x, rotation.y, rotation.z,
|
||||
false, false, false, false, 2, true
|
||||
);
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
let e = game.attachments.get(entity); //if player or vehicle
|
||||
if (e != null) {
|
||||
if (e.__attachments) {
|
||||
game.wait(5000);
|
||||
attachmentMngr.initFor(entityRage);
|
||||
}
|
||||
}
|
||||
@@ -282,7 +335,7 @@ export default function attachmentManager(game: IGame) {
|
||||
e.__attachmentObjects = [];
|
||||
}
|
||||
});
|
||||
|
||||
/*
|
||||
game.vehicles.forEach(_veh => {
|
||||
let vehicle = mp.vehicles.at(_veh.remoteId);
|
||||
|
||||
@@ -304,7 +357,9 @@ export default function attachmentManager(game: IGame) {
|
||||
e.__attachmentObjects = [];
|
||||
}
|
||||
});
|
||||
*/
|
||||
}
|
||||
|
||||
mp.events.add("playerReady", () => { //player finished doenloading assets from server.
|
||||
InitAttachmentsOnJoin();
|
||||
});
|
||||
}
|
||||
@@ -1,4 +1,11 @@
|
||||
export default function weapondamageUtil() {
|
||||
|
||||
mp.players.local.setSuffersCriticalHits(false);
|
||||
|
||||
mp.players.forEachInStreamRange((player) => {
|
||||
player.setSuffersCriticalHits(false);
|
||||
});
|
||||
|
||||
mp.events.add('SERVER:WeaponModifier', (player) => {
|
||||
//mp.gui.chat.push("Modifier steht jetzt auf" + modifier);
|
||||
//mp.players.local.setWeaponDamageModifier(modifier);
|
||||
@@ -37,7 +44,7 @@
|
||||
break;
|
||||
case 0x624FE830: //Compactrifle
|
||||
modifier = 0.2;
|
||||
meelemodifier = 1;
|
||||
meelemodifier = 0.1;
|
||||
break;
|
||||
case 0x05FC3C11: //Sniperrifle
|
||||
modifier = 0.5;
|
||||
@@ -81,6 +88,14 @@
|
||||
mp.game.invoke("0x4A3DC7ECCC321032", player, meelemodifier);
|
||||
//mp.gui.chat.push("Modifier: " + modifier + "MeeleModifier: " + meelemodifier);
|
||||
});
|
||||
|
||||
mp.events.add("entityStreamIn", (entity) => {
|
||||
if (entity.type === "player") {
|
||||
entity.setSuffersCriticalHits(false);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
/*mp.events.add('playerWeaponShot', (targetPosition, targetEntity) => {
|
||||
for (var x in this.weaponAmmo) {
|
||||
if (this.weaponAmmo[x].id != this.currentWeapon) {
|
||||
|
||||
18
ReallifeGamemode.Database/Entities/ServerVariable.cs
Normal file
18
ReallifeGamemode.Database/Entities/ServerVariable.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using GTANetworkAPI;
|
||||
|
||||
namespace ReallifeGamemode.Database.Entities
|
||||
{
|
||||
public partial class ServerVariable
|
||||
{
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int Id { get; set; }
|
||||
|
||||
public string Variable { get; set; }
|
||||
|
||||
public int Value { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
1882
ReallifeGamemode.Database/Migrations/20210331203931_SVars.Designer.cs
generated
Normal file
1882
ReallifeGamemode.Database/Migrations/20210331203931_SVars.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
51
ReallifeGamemode.Database/Migrations/20210331203931_SVars.cs
Normal file
51
ReallifeGamemode.Database/Migrations/20210331203931_SVars.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace ReallifeGamemode.Database.Migrations
|
||||
{
|
||||
public partial class SVars : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "failpoints",
|
||||
table: "Users",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "warn",
|
||||
table: "Users",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ServerVariables",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(nullable: false)
|
||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||
Variable = table.Column<string>(nullable: true),
|
||||
Value = table.Column<int>(nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ServerVariables", x => x.Id);
|
||||
});
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "ServerVariables");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "failpoints",
|
||||
table: "Users");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "warn",
|
||||
table: "Users");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1121,6 +1121,23 @@ namespace ReallifeGamemode.Database.Migrations
|
||||
b.ToTable("TextLabels");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ReallifeGamemode.Database.Entities.ServerVariable", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("Value")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Variable")
|
||||
.HasColumnType("longtext CHARACTER SET utf8mb4");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("ServerVariables");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ReallifeGamemode.Database.Entities.ServerVehicle", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
@@ -1415,12 +1432,18 @@ namespace ReallifeGamemode.Database.Migrations
|
||||
b.Property<bool>("WeaponLicense")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
b.Property<int>("failpoints")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("otheramount")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("trashcount")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("warn")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("BanId");
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace ReallifeGamemode.Database.Models
|
||||
optionsBuilder.UseLoggerFactory(LoggerFactory);
|
||||
}
|
||||
optionsBuilder.EnableSensitiveDataLogging();
|
||||
optionsBuilder.UseMySql("Host=localhost;Port=3306;Database=gtav-devdb;Username=gtav-dev;Password=Test123");
|
||||
optionsBuilder.UseMySql("Host=localhost;Port=3306;Database=gta-livedb;Username=gtav-live;Password=u8vbCADW--TY6iTsDycB88i&WsITj&o2");
|
||||
}
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
@@ -152,6 +152,9 @@ namespace ReallifeGamemode.Database.Models
|
||||
|
||||
//ItemShop
|
||||
public DbSet<Entities.ShopItem> ShopItems { get; set; }
|
||||
|
||||
//Server Variablen
|
||||
public DbSet<Entities.ServerVariable> ServerVariables { get; set; }
|
||||
}
|
||||
|
||||
public class DesignTimeDbContextFactory : IDesignTimeDbContextFactory<DatabaseContext>
|
||||
|
||||
23
ReallifeGamemode.Server/Business/AdminDealerBusiness.cs
Normal file
23
ReallifeGamemode.Server/Business/AdminDealerBusiness.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using GTANetworkAPI;
|
||||
|
||||
namespace ReallifeGamemode.Server.Business
|
||||
{
|
||||
internal class AdminDealerBusiness : CarDealerBusinessBase
|
||||
{
|
||||
public override int Id => 12;
|
||||
|
||||
public override string Name => "Admin Carshop";
|
||||
|
||||
public override Vector3 Position => new Vector3(1295.3, 264.76,-49.05);
|
||||
|
||||
public override Vector3 CarSpawnPositon => new Vector3(1266.38, 230.3, -48.67);
|
||||
|
||||
public override float CarSpawnHeading => 176.6f;
|
||||
|
||||
public override int? BlipSprite => null;
|
||||
|
||||
public override void Load()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -144,7 +144,7 @@ namespace ReallifeGamemode.Server.Commands
|
||||
|
||||
#region ahelp
|
||||
|
||||
[Command("ahelp", "~m~Benutzung: ~s~/ahelp")]
|
||||
/* [Command("ahelp", "~m~Benutzung: ~s~/ahelp")]
|
||||
public void CmdAdminHelp(Player player)
|
||||
{
|
||||
if (!player.GetUser()?.IsAdmin(AdminLevel.MAPPING) ?? true)
|
||||
@@ -170,7 +170,7 @@ namespace ReallifeGamemode.Server.Commands
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
#endregion ahelp
|
||||
|
||||
#region Mapping / Entwicklung
|
||||
@@ -222,7 +222,7 @@ namespace ReallifeGamemode.Server.Commands
|
||||
|
||||
#region Support
|
||||
|
||||
[Command("tog", "~m~Benutzung: ~s~/tog [Typ = ~g~ip~s~, ~g~deathlogs~s~, ~g~lc~s~", GreedyArg = true)]
|
||||
[Command("tog", "~m~Benutzung: ~s~/tog [Typ = ~g~IP~s~, ~g~deathlogs~s~, ~g~LC~s~]", GreedyArg = true)]
|
||||
public void CmdTog(Player player, string typ, string option1 = null, string option2 = null)
|
||||
{
|
||||
if (!player.GetUser()?.IsAdmin(AdminLevel.SUPPORTER) ?? true)
|
||||
@@ -1727,6 +1727,17 @@ namespace ReallifeGamemode.Server.Commands
|
||||
|
||||
#region ALevel1337
|
||||
|
||||
[Command("setsvar", "~m~Benutzung:~s~ /setsvar [ID] [WERT]")]
|
||||
public void CmdAdmSetSvar(Player player, int varId, int varValue)
|
||||
{
|
||||
if (!player.GetUser()?.IsAdmin(AdminLevel.PROJEKTLEITUNG) ?? true)
|
||||
{
|
||||
ChatService.NotAuthorized(player);
|
||||
return;
|
||||
}
|
||||
Managers.SVarManager.ChangeSVarValue(player, varId, varValue);
|
||||
}
|
||||
|
||||
[Command("createturf", "~m~Benutzung:~s~ /createturf [radius]")]
|
||||
public void CmdAdmCreateTurf(Player player, float option)
|
||||
{
|
||||
@@ -1984,22 +1995,6 @@ namespace ReallifeGamemode.Server.Commands
|
||||
return;
|
||||
}
|
||||
|
||||
bool found = false;
|
||||
foreach (string w in Enum.GetNames(typeof(Weather)))
|
||||
{
|
||||
if (w.ToLower() == weather)
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!found)
|
||||
{
|
||||
ChatService.ErrorMessage(player, "Dieses Wetter existiert nicht");
|
||||
return;
|
||||
}
|
||||
|
||||
Weather weatherBefore = NAPI.World.GetWeather();
|
||||
NAPI.World.SetWeather(weather);
|
||||
Weather weatherAfter = NAPI.World.GetWeather();
|
||||
@@ -2059,7 +2054,7 @@ namespace ReallifeGamemode.Server.Commands
|
||||
}
|
||||
else
|
||||
{
|
||||
player.TriggerEvent("showTuningMenu");
|
||||
player.TriggerEvent("showTuningMenu", true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -79,7 +79,12 @@ namespace ReallifeGamemode.Server.Commands
|
||||
[Command("help", "~m~Benutzung: ~s~/help")]
|
||||
public void CmdHelp(Player player)
|
||||
{
|
||||
player.TriggerEvent("showUserhelp");
|
||||
player.SendChatMessage("M - Interaktionsmenü öffnen und schließen");
|
||||
player.SendChatMessage("X - Fahrzeug auf -/ abschließen sowie im Fahrzeuginteraktionsmenü öffnen");
|
||||
player.SendChatMessage("N - Fahrzeugmotor Starten");
|
||||
player.SendChatMessage("O - Onlineliste öffnen / schließen");
|
||||
player.SendChatMessage("I - Inventar öffnen / schließen");
|
||||
player.SendChatMessage("F4 - Mikrofon an/aus schalten");
|
||||
}
|
||||
|
||||
[Command("hup")]
|
||||
|
||||
@@ -190,7 +190,7 @@ namespace ReallifeGamemode.Server.DrivingSchool
|
||||
veh.Position = sVeh.Position;
|
||||
veh.Rotation = new Vector3(0, 0, sVeh.Heading);
|
||||
|
||||
user.Position = new Vector3(-813.17, -1354.5, 4.14);
|
||||
user.Position = new Vector3(-814.39, -1336.76, 5.15);
|
||||
}
|
||||
|
||||
[RemoteEvent("drivingSchoolEvent")]
|
||||
@@ -304,7 +304,7 @@ namespace ReallifeGamemode.Server.DrivingSchool
|
||||
veh.Position = sVeh.Position;
|
||||
veh.Rotation = new Vector3(0, 0, sVeh.Heading);
|
||||
|
||||
user.Position = new Vector3(-813.17, -1354.5, 4.14);
|
||||
user.Position = new Vector3(-814.39, -1336.76, 5.15);
|
||||
}
|
||||
|
||||
[RemoteEvent("bikeSchoolEvent")]
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using System.Linq;
|
||||
using GTANetworkAPI;
|
||||
using ReallifeGamemode.Database.Models;
|
||||
using ReallifeGamemode.Server.Extensions;
|
||||
using ReallifeGamemode.Server.Managers;
|
||||
using ReallifeGamemode.Server.Services;
|
||||
using ReallifeGamemode.Server.Types;
|
||||
@@ -29,22 +30,40 @@ namespace ReallifeGamemode.Server.Events
|
||||
|
||||
bool registered = false;
|
||||
|
||||
var whitelistStatus = Managers.SVarManager.SVars.FirstOrDefault(v => v.Variable == "WhitelistStatus")?.Value ?? 0;
|
||||
|
||||
using (var dbContext = new DatabaseContext())
|
||||
{
|
||||
registered = dbContext.Users.Where(u => u.Name == player.Name).Any();
|
||||
switch (whitelistStatus)
|
||||
{
|
||||
case 0: //Whitelist aus
|
||||
break;
|
||||
|
||||
case 1: //Whitelist aktiv (Main-Server)
|
||||
if (dbContext.Users.FirstOrDefault(u => u.SocialClubName == player.SocialClubName).AdminLevel < AdminLevel.MAPPING)
|
||||
{
|
||||
NAPI.Util.ConsoleOutput(player.Name + " versucht sich einzuloggen während die Whitelist an ist. [STATUS 1]");
|
||||
player.Kick();
|
||||
return;
|
||||
}
|
||||
break;
|
||||
|
||||
case 2: //Whitelist aktiv (Test-Server)
|
||||
if (!dbContext.WhitelistEntries.Any(w => w.SocialClubName == player.SocialClubName))
|
||||
{
|
||||
string msg2 = "~m~*** " + player.Name + "[" + player.SocialClubName + "] (" + player.Address + ") hat versucht, sich einzuloggen, steht aber nicht auf der Whitelist.";
|
||||
ChatService.BroadcastAdmin(msg2, AdminLevel.ADMIN);
|
||||
|
||||
NAPI.Util.ConsoleOutput(player.Name + " tried to join without whitelist entry");
|
||||
NAPI.Util.ConsoleOutput(player.Name + " tried to join without whitelist entry [STATUS 2]");
|
||||
|
||||
ChatService.SendMessage(player, "~m~Du stehst nicht auf der Whitelist");
|
||||
|
||||
player.Kick();
|
||||
return;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (IsPlayerBanned(player)) return;
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace ReallifeGamemode.Server.Events
|
||||
{
|
||||
ChatService.BroadcastAdmin("!{#FFFF00}*** " + player.Name + " hat den Server verlassen", AdminLevel.MAPPING);
|
||||
}
|
||||
|
||||
/*
|
||||
TaxiDriverJob taxiJob = JobManager.GetJob<TaxiDriverJob>();
|
||||
TaxiContract taxiContract = taxiJob.TaxiContracts.Where(t => t.Name == player.Name).FirstOrDefault();
|
||||
|
||||
@@ -64,6 +64,7 @@ namespace ReallifeGamemode.Server.Events
|
||||
taxiJob.TaxiContracts.Remove(taxiContract);
|
||||
}
|
||||
}
|
||||
*/
|
||||
var listReports = Report.Report.listReports;
|
||||
ReportManage temp;
|
||||
for (int a = 0; a < listReports.Count; a++)
|
||||
|
||||
@@ -358,12 +358,13 @@ namespace ReallifeGamemode.Server.Events
|
||||
|
||||
using (var context = new DatabaseContext())
|
||||
{
|
||||
/*
|
||||
if (player.HasAttachment("ammobox"))
|
||||
{
|
||||
player.AddAttachment("ammobox", true);
|
||||
player.StopAnimation();
|
||||
}
|
||||
|
||||
*/
|
||||
bool unloadedWeaponPackage = false;
|
||||
|
||||
List<UserItem> fItem = context.UserItems.Where(u => u.UserId == user.Id).ToList();
|
||||
@@ -546,13 +547,7 @@ namespace ReallifeGamemode.Server.Events
|
||||
player.TriggerEvent("renderTextOnScreen", "Steige nun in eines der Fahrzeuge und starte den Motor mit der Taste 'N'.");
|
||||
return;
|
||||
}
|
||||
}else
|
||||
{
|
||||
player.SendNotification("~r~[Fehler] ~w~ Du hast diesen Job nicht angenommen.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (nearestJobPoint.jobId == 3 && player.GetUser().JobId == 3)
|
||||
} else if (nearestJobPoint.jobId == 3 && player.GetUser().JobId == 3)
|
||||
{
|
||||
if (nearestJobPoint.Skill < 300 && player.GetUser().PilotSkill >= 0)
|
||||
{
|
||||
@@ -569,12 +564,12 @@ namespace ReallifeGamemode.Server.Events
|
||||
player.TriggerEvent("renderTextOnScreen", "Steige nun in eines der Flugzeuge und starte den Motor mit der Taste 'N'.");
|
||||
return;
|
||||
}
|
||||
}else
|
||||
}
|
||||
else
|
||||
{
|
||||
player.SendNotification("~r~[Fehler] ~w~ Du hast diesen Job nicht angenommen.");
|
||||
player.SendChatMessage("~y~[JOB] ~r~Dein Skilllevel ist noch zu niedrig.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (nearestJobPoint.Skill >= 300 && player.GetUser().PilotSkill >= 300)
|
||||
{
|
||||
if (job.GetUsersInJob().Contains(player))
|
||||
@@ -596,7 +591,8 @@ namespace ReallifeGamemode.Server.Events
|
||||
player.SendChatMessage("~y~[JOB] ~r~Dein Skilllevel ist noch zu niedrig.");
|
||||
return;
|
||||
}
|
||||
}else
|
||||
}
|
||||
else
|
||||
{
|
||||
player.SendNotification("~r~[Fehler] ~w~ Du hast diesen Job nicht angenommen.");
|
||||
return;
|
||||
@@ -616,14 +612,15 @@ namespace ReallifeGamemode.Server.Events
|
||||
public void KeyPressO(Player player)
|
||||
{
|
||||
if (!player.IsLoggedIn()) return;
|
||||
List<Player> players = NAPI.Pools.GetAllPlayers();
|
||||
List<Player> players = NAPI.Pools.GetAllPlayers().Where(p => p.IsLoggedIn() == true).ToList();
|
||||
|
||||
var listPlayers = players.Select(p => new
|
||||
{
|
||||
Id = p.Handle.Value,
|
||||
p.Name,
|
||||
p.Ping,
|
||||
FactionName = p.GetUser().Faction?.Name ?? "Zivilist",
|
||||
}) ;
|
||||
});
|
||||
player.TriggerEvent("showPlayerlist", JsonConvert.SerializeObject(listPlayers));
|
||||
}
|
||||
|
||||
|
||||
@@ -63,6 +63,7 @@ namespace ReallifeGamemode.Server.Events
|
||||
player.SetData("duty", false);
|
||||
player.SetData("Adminduty", false);
|
||||
player.TriggerEvent("SERVER:SET_HANDMONEY", user.Handmoney, 0);
|
||||
player.TriggerEvent("headshotoff");
|
||||
Gangwar.Gangwar.loadPlayer(player);
|
||||
if (user.FactionLeader)
|
||||
{
|
||||
|
||||
@@ -118,11 +118,9 @@ namespace ReallifeGamemode.Server.Gangwar
|
||||
{
|
||||
var t = Task.Factory.StartNew(() =>
|
||||
{
|
||||
ChatService.Broadcast("DEBUG: reloadGangTurfs(...)");
|
||||
Task.Delay(10000).Wait();
|
||||
Gangwar.loadTurfs();
|
||||
Gangwar.loadTurfs_ToAllPlayers();
|
||||
ChatService.Broadcast("DEBUG: reloadGangTurfs()...10 Sekunden um");
|
||||
});
|
||||
t.Wait();
|
||||
|
||||
@@ -167,7 +165,7 @@ namespace ReallifeGamemode.Server.Gangwar
|
||||
|
||||
foreach (Player gangwarPlayer in this.playerInGangwar)
|
||||
{
|
||||
gangwarPlayer.TriggerEvent("GangwarScore", this.Attacker, this.Owner, this.Att_Score, this.Def_Score, 40 - timerCount);
|
||||
gangwarPlayer.TriggerEvent("GangwarScore", this.Attacker, this.Owner, this.Att_Score, this.Def_Score, 900 - timerCount);
|
||||
}
|
||||
/*if (this.Att_Score >= 200)
|
||||
{
|
||||
@@ -178,7 +176,7 @@ namespace ReallifeGamemode.Server.Gangwar
|
||||
this.takeOver(this.Owner);
|
||||
}*/
|
||||
timerCount += 1;
|
||||
if (timerCount >= 40) //change to 900 (seconds) before release for testing reasons change to whatever you like
|
||||
if (timerCount >= 900) //change to 900 (seconds) before release for testing reasons change to whatever you like
|
||||
{
|
||||
if (this.Att_Score > this.Def_Score)
|
||||
{
|
||||
@@ -268,6 +266,7 @@ namespace ReallifeGamemode.Server.Gangwar
|
||||
}
|
||||
ChatService.BroadcastFaction("~y~[GANGWAR] ~w~Deine Fraktion hat erfolgreich das Gebiet ~g~" + getName() + "~w~ verteidigt.", dbContext.Factions.Where(f => f.Name == getOwner()).FirstOrDefault());
|
||||
ChatService.BroadcastFaction("~y~[GANGWAR] ~w~Deine Fraktion hat den Angrif auf das Gebiet ~r~" + getName() + "~w~ verloren.", dbContext.Factions.Where(f => f.Name == getAttacker()).FirstOrDefault());
|
||||
dbContext.Factions.Include(f => f.BankAccount).Where(f => f.Name == getOwner()).First().BankAccount.Balance += 15000;
|
||||
}
|
||||
else if (getOwner() != FactionName)
|
||||
{
|
||||
@@ -284,11 +283,12 @@ namespace ReallifeGamemode.Server.Gangwar
|
||||
}
|
||||
this.Owner = FactionName;
|
||||
ChatService.BroadcastFaction("~y~[GANGWAR] ~w~Deine Fraktion konnte erfolgreich das Gebiet ~g~" + getName() + "~w~ erobern.", dbContext.Factions.Where(f => f.Name == getOwner()).FirstOrDefault());
|
||||
dbContext.Factions.Include(f => f.BankAccount).Where(f => f.Name == getOwner()).First().BankAccount.Balance += 10000;
|
||||
Turfs turf = dbContext.Turfs.Where(t => t.Id == getId()).FirstOrDefault();
|
||||
turf.Owner = this.Owner;
|
||||
turf.FactionId = dbContext.Factions.Where(f => f.Name == this.Owner).FirstOrDefault().Id;
|
||||
dbContext.SaveChanges();
|
||||
}
|
||||
dbContext.SaveChanges();
|
||||
}
|
||||
this.Attacker = null;
|
||||
foreach (var c in playerInGangwar)
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace ReallifeGamemode.Server.Inventory
|
||||
var invWeight = InventoryManager.GetUserInventoryWeight(player);
|
||||
var itemsToAdd = 0;
|
||||
GTANetworkAPI.Object nearestObject = GroundObjects.FirstOrDefault(d => d.Position == nearest.Position);
|
||||
TextLabel nearestTextLabel = GroundTextLabels.FirstOrDefault(d => d.Position == new Vector3(nearest.Position.X, nearest.Position.Y, nearest.Position.Z + 1.05) || d.Position == new Vector3(nearest.Position.X, nearest.Position.Y, nearest.Position.Z + 0.8));
|
||||
TextLabel nearestTextLabel = GroundTextLabels.FirstOrDefault(d => d.Position == new Vector3(nearest.Position.X, nearest.Position.Y, nearest.Position.Z + 1.05) || d.Position == new Vector3(nearest.Position.X, nearest.Position.Y, nearest.Position.Z + 0.8) || d.Position == nearest.Position);
|
||||
IItem nearestItem = InventoryManager.GetItemById(nearest.ItemId);
|
||||
UserItem existingItem = InventoryManager.UserHasThisItem(player, nearest.ItemId);
|
||||
var user = player.GetUser();
|
||||
@@ -102,7 +102,7 @@ namespace ReallifeGamemode.Server.Inventory
|
||||
if (!player.HasAttachment("ammobox"))
|
||||
{
|
||||
player.PlayAnimation("anim@heists@box_carry@", "idle", 49);
|
||||
player.AddAttachment("ammobox", false);
|
||||
//player.AddAttachment("ammobox", false);
|
||||
NAPI.Player.SetPlayerCurrentWeapon(player, WeaponHash.Unarmed);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,6 +28,8 @@ namespace ReallifeGamemode.Server.Job
|
||||
|
||||
public abstract bool NeedVehicleToStart { get; }
|
||||
|
||||
public virtual bool Deactivated => false;
|
||||
|
||||
public void StartJob(Player player)
|
||||
{
|
||||
if (_inJob.Contains(player)) return;
|
||||
|
||||
@@ -208,7 +208,7 @@ namespace ReallifeGamemode.Server.Job
|
||||
Player target = data.getPartnerClient(player);
|
||||
if (target != null) target.TriggerEvent("MuellmannUpdateColshape", colshapeIndex);
|
||||
player.TriggerEvent("renderTextOnScreen", "Wirf den Müllsack in den Müllwagen.");
|
||||
player.AddAttachment("binbag", false);
|
||||
//player.AddAttachment("binbag", false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -220,18 +220,18 @@ namespace ReallifeGamemode.Server.Job
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
using (var dbContext = new DatabaseContext())
|
||||
{
|
||||
foreach (var data in muellmanData)
|
||||
{
|
||||
if (data.getDataFromClient(player) == null) continue;
|
||||
Player target = data.getPartnerClient(player);
|
||||
User user1 = player.GetUser();
|
||||
User user2 = target.GetUser();
|
||||
using (var dbContext = new DatabaseContext())
|
||||
{
|
||||
user1 = player.GetUser(dbContext);
|
||||
user2 = target.GetUser(dbContext);
|
||||
user1.trashcount += 1;
|
||||
User user1 = player.GetUser(dbContext);
|
||||
User user2 = target.GetUser(dbContext);
|
||||
|
||||
//user1 = player.GetUser(dbContext);
|
||||
//user2 = target.GetUser(dbContext);
|
||||
/*user1.trashcount += 1;
|
||||
|
||||
if (user1.trashcount == 20)
|
||||
{
|
||||
@@ -249,11 +249,12 @@ namespace ReallifeGamemode.Server.Job
|
||||
target.SendChatMessage("~y~Dies ist dein 20ter Müllsack.");
|
||||
}
|
||||
}
|
||||
|
||||
dbContext.SaveChanges();
|
||||
}
|
||||
player.AddAttachment("binbag", true);
|
||||
if (target != null)
|
||||
if (player.GetUser().trashcount >= 20)
|
||||
*/
|
||||
|
||||
if (player.GetUser(dbContext).trashcount >= 20)
|
||||
{
|
||||
ChatService.SendMessage((Player)player, "~y~Job: ~s~Der Müllwagen ist voll. Fahre nun zurück zur Recyclinganlage!");
|
||||
if (target != null)
|
||||
@@ -265,10 +266,8 @@ namespace ReallifeGamemode.Server.Job
|
||||
}
|
||||
else
|
||||
{
|
||||
using (var dbContext = new DatabaseContext())
|
||||
{
|
||||
user1 = player.GetUser(dbContext);
|
||||
user2 = target.GetUser(dbContext);
|
||||
//user1 = player.GetUser(dbContext);
|
||||
//user2 = target.GetUser(dbContext);
|
||||
user1.trashcount += 1;
|
||||
player.SendNotification("Müllsack: " + user1.trashcount + " von 20.");
|
||||
if (target != null)
|
||||
@@ -278,10 +277,9 @@ namespace ReallifeGamemode.Server.Job
|
||||
}
|
||||
dbContext.SaveChanges();
|
||||
}
|
||||
}
|
||||
player.AddAttachment("binbag", true);
|
||||
if (target != null)
|
||||
if (player.GetUser().trashcount >= 20)
|
||||
// player.AddAttachment("binbag", true);
|
||||
|
||||
if (player.GetUser(dbContext).trashcount >= 20)
|
||||
{
|
||||
ChatService.SendMessage((Player)player, "~y~Job: ~s~Der Müllwagen ist voll. Fahre nun zurück zur Recyclinganlage!");
|
||||
if (target != null)
|
||||
@@ -293,15 +291,20 @@ namespace ReallifeGamemode.Server.Job
|
||||
}
|
||||
else
|
||||
{
|
||||
//user1 = player.GetUser(dbContext);
|
||||
//user2 = target.GetUser(dbContext);
|
||||
|
||||
if (target != null)
|
||||
{
|
||||
player.GetUser().Wage += 10;
|
||||
target.GetUser().Wage += 10;
|
||||
user1.Wage += 10;
|
||||
user2.Wage += 10;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
player.GetUser().Wage += 20;
|
||||
user1.Wage += 20;
|
||||
}
|
||||
dbContext.SaveChanges();
|
||||
}
|
||||
}
|
||||
return;
|
||||
@@ -321,25 +324,24 @@ namespace ReallifeGamemode.Server.Job
|
||||
if (target != null) ChatService.SendMessage((Player)target, $"~y~Job: ~s~Fahrzeug wurde entleert. Säcke: {target.GetUser().trashcount}");
|
||||
ChatService.SendMessage((Player)player, $"~y~Job: ~s~Fahrzeug wurde entleert. Säcke: {player.GetUser().trashcount}");
|
||||
//bonus pro sack
|
||||
using (var dbContext = new DatabaseContext())
|
||||
{
|
||||
User user1 = player.GetUser(dbContext);
|
||||
User user2 = target.GetUser(dbContext);
|
||||
|
||||
if (target != null)
|
||||
{
|
||||
player.GetUser().Wage += 100;
|
||||
target.GetUser().Wage += 100;
|
||||
user1.Wage += 100;
|
||||
user2.Wage += 100;
|
||||
}
|
||||
else
|
||||
{
|
||||
player.GetUser().Wage += 200;
|
||||
user1.Wage += 200;
|
||||
}
|
||||
User user1 = player.GetUser();
|
||||
User user2 = target.GetUser();
|
||||
using (var dbContext = new DatabaseContext())
|
||||
{
|
||||
user1 = player.GetUser(dbContext);
|
||||
user2 = target.GetUser(dbContext);
|
||||
|
||||
user1.trashcount -= user1.trashcount;
|
||||
if (target != null)
|
||||
user2.trashcount -= user2.trashcount;
|
||||
if (target != null) user2.trashcount -= user2.trashcount;
|
||||
|
||||
dbContext.SaveChanges();
|
||||
}
|
||||
Console.WriteLine($"[DATA DEBUG] vehicle: {data.vehicle.DisplayName} | Players: {data.getClientsFromData().Count} | Säcke: {data.getTrashCount()}");
|
||||
|
||||
@@ -25,6 +25,8 @@ namespace ReallifeGamemode.Server.Job
|
||||
|
||||
public override bool NeedVehicleToStart => true;
|
||||
|
||||
public override bool Deactivated => true;
|
||||
|
||||
private static TaxiDriverJob _Instance;
|
||||
|
||||
public TaxiDriverJob()
|
||||
|
||||
@@ -153,6 +153,8 @@ namespace ReallifeGamemode.Server
|
||||
|
||||
ThreadTimers.StartAllTimers();
|
||||
|
||||
Managers.SVarManager.LoadSVars();
|
||||
|
||||
UserBankAccount.BalanceChanged += (account) =>
|
||||
{
|
||||
using (var dbContext = new DatabaseContext())
|
||||
@@ -167,6 +169,9 @@ namespace ReallifeGamemode.Server
|
||||
{
|
||||
user.Player.TriggerEvent("SERVER:SET_HANDMONEY", user.Handmoney);
|
||||
};
|
||||
|
||||
//IPLS
|
||||
NAPI.World.RequestIpl("vw_casino_garage");
|
||||
}
|
||||
|
||||
[RemoteEvent("CLIENT:Event")]
|
||||
|
||||
@@ -34,6 +34,12 @@ namespace ReallifeGamemode.Server.Managers
|
||||
{
|
||||
throw new InvalidOperationException($"Double Job ID found: {instance.Id} | {instance.Name}");
|
||||
}
|
||||
|
||||
if (instance.Deactivated)
|
||||
{
|
||||
NAPI.Util.ConsoleOutput("Job {0} is deactivated", instance.Name);
|
||||
continue;
|
||||
}
|
||||
_jobs.Add(instance);
|
||||
NAPI.Util.ConsoleOutput($"Loading job {instance.Name}");
|
||||
}
|
||||
|
||||
@@ -349,7 +349,7 @@ public class BehindVehiclePoint
|
||||
if (!player.HasAttachment("ammobox"))
|
||||
{
|
||||
player.PlayAnimation("anim@heists@box_carry@", "idle", 49);
|
||||
player.AddAttachment("ammobox", false);
|
||||
//player.AddAttachment("ammobox", false);
|
||||
NAPI.Player.SetPlayerCurrentWeapon(player, WeaponHash.Unarmed);
|
||||
}
|
||||
}
|
||||
|
||||
45
ReallifeGamemode.Server/Managers/SVarManager.cs
Normal file
45
ReallifeGamemode.Server/Managers/SVarManager.cs
Normal file
@@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Linq;
|
||||
using GTANetworkAPI;
|
||||
using ReallifeGamemode.Database.Entities;
|
||||
using ReallifeGamemode.Database.Models;
|
||||
using ReallifeGamemode.Server.Services;
|
||||
|
||||
namespace ReallifeGamemode.Server.Managers
|
||||
{
|
||||
|
||||
public class SVarManager : Script
|
||||
{
|
||||
public static List<ServerVariable> SVars = new List<ServerVariable>();
|
||||
|
||||
public static void LoadSVars()
|
||||
{
|
||||
using (var dbContext = new DatabaseContext())
|
||||
{
|
||||
SVars = dbContext.ServerVariables.Select(row => row).ToList();
|
||||
foreach(var svar in SVars)
|
||||
{
|
||||
System.Console.WriteLine("[SVAR][" + svar.Id + "] " + svar.Variable + " = " + svar.Value);
|
||||
}
|
||||
System.Console.WriteLine("Geladene Server Variablen [" + SVars.Count() + "]");
|
||||
}
|
||||
}
|
||||
|
||||
public static void ChangeSVarValue(Player player, int varId, int varValue)
|
||||
{
|
||||
using (var dbContext = new DatabaseContext())
|
||||
{
|
||||
var changeValue = dbContext.ServerVariables.FirstOrDefault(v => v.Id == varId);
|
||||
var oldValue = changeValue.Value;
|
||||
SVars.FirstOrDefault(v => v.Id == varId).Value = varValue;
|
||||
changeValue.Value = varValue;
|
||||
dbContext.SaveChanges();
|
||||
|
||||
ChatService.SendMessage(player, "~r~Wert von Server Variable ~o~" + changeValue.Variable + "~r~ in ~g~ " + varValue + "~r~geändert. Alter Wert: ~y~" + oldValue);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -92,8 +92,22 @@ namespace ReallifeGamemode.Server.Managers
|
||||
}
|
||||
|
||||
[RemoteEvent("setVehicleMod")]
|
||||
public void SetVehicleMod(Player player, int slot, int index)
|
||||
public void SetVehicleMod(Player player, int slot, int index, int price)
|
||||
{
|
||||
using var dbContext = new DatabaseContext();
|
||||
User user = player.GetUser(dbContext);
|
||||
if (user.BankAccount.Balance < price)
|
||||
{
|
||||
player.SendNotification("Du hast nicht genug Geld für dieses Tuningteil!");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
user.BankAccount.Balance -= price;
|
||||
}
|
||||
|
||||
player.TriggerEvent("SERVER:Tuning_ModSucessfull", slot, index);
|
||||
|
||||
Vehicle pV = player.Vehicle;
|
||||
if (index == 0) index--;
|
||||
|
||||
@@ -118,11 +132,11 @@ namespace ReallifeGamemode.Server.Managers
|
||||
NAPI.ClientEvent.TriggerClientEventForAll("vehicleToggleMod", pV, slot, newVal);
|
||||
}
|
||||
|
||||
ServerVehicle sV = player.Vehicle.GetServerVehicle();
|
||||
dbContext.SaveChanges();
|
||||
|
||||
ServerVehicle sV = player.Vehicle.GetServerVehicle(dbContext);
|
||||
if (sV == null) return;
|
||||
|
||||
using (var dbContext = new DatabaseContext())
|
||||
{
|
||||
VehicleMod vMod = dbContext.VehicleMods.FirstOrDefault(m => m.ServerVehicleId == sV.Id && m.Slot == slot);
|
||||
if (vMod == null && index != -1)
|
||||
{
|
||||
@@ -153,7 +167,6 @@ namespace ReallifeGamemode.Server.Managers
|
||||
}
|
||||
dbContext.SaveChanges();
|
||||
}
|
||||
}
|
||||
|
||||
[RemoteEvent("CLIENT:TuningManager_SetVehicleColor")]
|
||||
public void TuningManagerSetVehicleColor(Player player, bool primarySecondary, int color)
|
||||
|
||||
@@ -137,7 +137,7 @@ public class AttachmentSyncExample : Script
|
||||
player.AddAttachment(Base36Extensions.FromBase36(hash), true);
|
||||
}
|
||||
|
||||
[Command("xdd")]
|
||||
//[Command("xdd")]
|
||||
public void attachment(Player player)
|
||||
{
|
||||
Vehicle veh = player.Vehicle;
|
||||
@@ -153,5 +153,6 @@ public class AttachmentSyncExample : Script
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user