Add changes
This commit is contained in:
@@ -161,8 +161,7 @@ sirenSilence();
|
||||
import waypointUtil from './util/waypoint';
|
||||
waypointUtil();
|
||||
|
||||
import vehicleSync from './vehiclesync/vehiclesync';
|
||||
vehicleSync();
|
||||
require('./vehiclesync/vehiclesync');
|
||||
|
||||
import smoothThrottle from './vehiclesync/smoothtrottle';
|
||||
smoothThrottle();
|
||||
@@ -202,3 +201,12 @@ itemShopList(globalData);
|
||||
|
||||
import taximeterInput from './Gui/taximeter';
|
||||
taximeterInput(globalData);
|
||||
|
||||
interface VehicleData {
|
||||
EngineState: boolean;
|
||||
Locked: boolean;
|
||||
}
|
||||
|
||||
export {
|
||||
VehicleData
|
||||
}
|
||||
@@ -1,560 +1,75 @@
|
||||
//Disapproved by the entire planet
|
||||
//You don't need to worry about anything here
|
||||
export default function vehicleSync() {
|
||||
mp.events.add("VehStream_SetEngineStatus", (veh, status) => {
|
||||
if (veh === undefined || veh === null || !veh.isAVehicle()) return;
|
||||
if (veh !== undefined) {
|
||||
if (veh.isSeatFree(-1)) //Turns engine on instantly if no driver, otherwise it will not turn on
|
||||
{
|
||||
veh.setEngineOn(status, true, false);
|
||||
veh.setUndriveable(true);
|
||||
}
|
||||
else {
|
||||
veh.setEngineOn(status, false, true);
|
||||
veh.setUndriveable(!status);
|
||||
}
|
||||
}
|
||||
});
|
||||
import game, { VehicleData } from '../index';
|
||||
import { IVehicle, EntityType, IEntity, VehicleSeat } from '../game';
|
||||
import { parseJson } from '../util';
|
||||
|
||||
mp.events.add("VehStream_SetLockStatus", (veh, status) => {
|
||||
if (veh === undefined || veh === null || !veh.isAVehicle()) return;
|
||||
if (veh !== undefined) {
|
||||
if (status)
|
||||
veh.setDoorsLocked(2);
|
||||
else
|
||||
veh.setDoorsLocked(1);
|
||||
}
|
||||
});
|
||||
game.events.add('SERVER:Vehicle:UpdateData', (vehId, dataStr) => {
|
||||
var data: VehicleData = parseJson(dataStr);
|
||||
var vehicle: IVehicle = game.vehicles.at(vehId);
|
||||
|
||||
mp.events.add("VehStream_PlayerEnterVehicleAttempt", (entity, seat) => {
|
||||
entity = mp.vehicles.atRemoteId(entity);
|
||||
if (entity === undefined || entity === null || !entity.isAVehicle()) return;
|
||||
if (typeof entity.getVariable("VehicleSyncData") !== 'undefined') {
|
||||
var toggle = entity.getVariable("VehicleSyncData");
|
||||
entity.setEngineOn(toggle.Engine, false, true);
|
||||
entity.setUndriveable(!toggle.Engine);
|
||||
entity.setInvincible(false);
|
||||
}
|
||||
});
|
||||
setVehicleData(vehicle, data);
|
||||
});
|
||||
|
||||
mp.events.add("VehStream_PlayerExitVehicleAttempt", (entity) => {
|
||||
if (entity === undefined || entity === null || !entity.isAVehicle()) return;
|
||||
if (entity !== undefined) {
|
||||
if (typeof entity.getVariable("VehicleSyncData") !== 'undefined') {
|
||||
var toggle = entity.getVariable("VehicleSyncData");
|
||||
entity.setEngineOn(toggle.Engine, true, false);
|
||||
entity.setUndriveable(!toggle.Engine);
|
||||
}
|
||||
var level = entity.getDirtLevel();
|
||||
mp.events.callRemote("VehStream_SetDirtLevel", entity, level);
|
||||
}
|
||||
});
|
||||
game.events.onPlayerEnterVehicle((vehicle, seat) => {
|
||||
while (!game.players.local.inVehicle) {
|
||||
game.wait(0);
|
||||
}
|
||||
|
||||
mp.events.add("VehStream_PlayerExitVehicle", (entity) => {
|
||||
entity = mp.vehicles.atRemoteId(entity);
|
||||
if (entity === undefined || entity === null || !entity.isAVehicle()) {
|
||||
return;
|
||||
}
|
||||
setTimeout(() => {
|
||||
var Status = [];
|
||||
let y = 0;
|
||||
for (y = 0; y < 8; y++) {
|
||||
if (entity.isDoorDamaged(y)) {
|
||||
Status.push(2);
|
||||
}
|
||||
else if (entity.getDoorAngleRatio(y) > 0.15) {
|
||||
Status.push(1);
|
||||
}
|
||||
else {
|
||||
Status.push(0);
|
||||
}
|
||||
}
|
||||
mp.events.callRemote("VehStream_SetDoorData", entity, Status[0], Status[1], Status[2], Status[3], Status[4], Status[5], Status[6], Status[7]);
|
||||
if (vehicle) {
|
||||
var data: VehicleData = vehicle.getSharedData("VehicleData");
|
||||
|
||||
Status = [];
|
||||
if (entity.isWindowIntact(0)) {
|
||||
if (entity.getBoneIndexByName("window_rf") === -1) {
|
||||
Status.push(1);
|
||||
}
|
||||
else {
|
||||
Status.push(0);
|
||||
}
|
||||
}
|
||||
else {
|
||||
Status.push(2);
|
||||
}
|
||||
if (entity.isWindowIntact(1)) {
|
||||
if (entity.getBoneIndexByName("window_lf") === -1) {
|
||||
Status.push(1);
|
||||
}
|
||||
else {
|
||||
Status.push(0);
|
||||
}
|
||||
}
|
||||
else {
|
||||
Status.push(2);
|
||||
}
|
||||
if (entity.isWindowIntact(2)) {
|
||||
if (entity.getBoneIndexByName("window_rr") === -1) {
|
||||
Status.push(1);
|
||||
}
|
||||
else {
|
||||
Status.push(0);
|
||||
}
|
||||
}
|
||||
else {
|
||||
Status.push(2);
|
||||
}
|
||||
if (entity.isWindowIntact(3)) {
|
||||
if (entity.getBoneIndexByName("window_lr") === -1) {
|
||||
Status.push(1);
|
||||
}
|
||||
else {
|
||||
Status.push(0);
|
||||
}
|
||||
}
|
||||
else {
|
||||
Status.push(2);
|
||||
}
|
||||
mp.events.callRemote("VehStream_SetWindowData", entity, Status[0], Status[1], Status[2], Status[3]);
|
||||
setVehicleData(vehicle, data);
|
||||
}
|
||||
});
|
||||
|
||||
Status = [];
|
||||
if (!entity.isTyreBurst(0, false)) {
|
||||
Status.push(0);
|
||||
}
|
||||
else if (entity.isTyreBurst(0, false)) {
|
||||
Status.push(1);
|
||||
}
|
||||
else {
|
||||
Status.push(2);
|
||||
}
|
||||
game.events.onPlayerExitVehicle(() => {
|
||||
var veh = game.players.local.vehicle;
|
||||
while (game.players.local.inVehicle) {
|
||||
game.wait(0);
|
||||
}
|
||||
|
||||
if (!entity.isTyreBurst(1, false)) {
|
||||
Status.push(0);
|
||||
}
|
||||
else if (entity.isTyreBurst(1, false)) {
|
||||
Status.push(1);
|
||||
}
|
||||
else {
|
||||
Status.push(2);
|
||||
}
|
||||
if (veh) {
|
||||
var data: VehicleData = veh.getSharedData("VehicleData");
|
||||
|
||||
if (!entity.isTyreBurst(2, false)) {
|
||||
Status.push(0);
|
||||
}
|
||||
else if (entity.isTyreBurst(2, false)) {
|
||||
Status.push(1);
|
||||
}
|
||||
else {
|
||||
Status.push(2);
|
||||
}
|
||||
setVehicleData(veh, data);
|
||||
}
|
||||
});
|
||||
|
||||
if (!entity.isTyreBurst(3, false)) {
|
||||
Status.push(0);
|
||||
}
|
||||
else if (entity.isTyreBurst(3, false)) {
|
||||
Status.push(1);
|
||||
}
|
||||
else {
|
||||
Status.push(2);
|
||||
}
|
||||
game.events.onEntityStreamIn((entity: IEntity) => {
|
||||
if (entity && entity.type === EntityType.Vehicle) {
|
||||
var data: VehicleData = entity.getSharedData("VehicleData");
|
||||
|
||||
if (!entity.isTyreBurst(4, false)) {
|
||||
Status.push(0);
|
||||
}
|
||||
else if (entity.isTyreBurst(4, false)) {
|
||||
Status.push(1);
|
||||
}
|
||||
else {
|
||||
Status.push(2);
|
||||
}
|
||||
var vehicle = <IVehicle>entity;
|
||||
setVehicleData(vehicle, data);
|
||||
}
|
||||
});
|
||||
|
||||
if (!entity.isTyreBurst(5, false)) {
|
||||
Status.push(0);
|
||||
}
|
||||
else if (entity.isTyreBurst(5, false)) {
|
||||
Status.push(1);
|
||||
}
|
||||
else {
|
||||
Status.push(2);
|
||||
}
|
||||
function setVehicleData(veh: IVehicle, data: VehicleData): void {
|
||||
game.ui.sendChatMessage("setVehicleData");
|
||||
if (!veh) {
|
||||
game.ui.sendChatMessage("veh is null");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!entity.isTyreBurst(6, false)) {
|
||||
Status.push(0);
|
||||
}
|
||||
else if (entity.isTyreBurst(6, false)) {
|
||||
Status.push(1);
|
||||
}
|
||||
else {
|
||||
Status.push(2);
|
||||
}
|
||||
game.ui.sendChatMessage("veh is not null");
|
||||
if (data === null) {
|
||||
game.ui.sendChatMessage("data is null");
|
||||
data = {
|
||||
EngineState: false,
|
||||
Locked: false
|
||||
};
|
||||
}
|
||||
|
||||
if (!entity.isTyreBurst(7, false)) {
|
||||
Status.push(0);
|
||||
}
|
||||
else if (entity.isTyreBurst(7, false)) {
|
||||
Status.push(1);
|
||||
}
|
||||
else {
|
||||
Status.push(2);
|
||||
}
|
||||
game.ui.sendChatMessage(`engine: ${data.EngineState}, locked: ${data.Locked}`);
|
||||
|
||||
if (!entity.isTyreBurst(45, false)) {
|
||||
Status.push(0);
|
||||
}
|
||||
else if (entity.isTyreBurst(45, false)) {
|
||||
Status.push(1);
|
||||
}
|
||||
else {
|
||||
Status.push(2);
|
||||
}
|
||||
var engineState = data.EngineState;
|
||||
if (veh.isSeatFree(VehicleSeat.Driver)) {
|
||||
veh.setEngineStatus(engineState, true, false);
|
||||
veh.setUndriveable(true);
|
||||
} else {
|
||||
veh.setEngineStatus(engineState, false, true);
|
||||
veh.setUndriveable(!engineState);
|
||||
}
|
||||
|
||||
if (!entity.isTyreBurst(47, false)) {
|
||||
Status.push(0);
|
||||
}
|
||||
else if (entity.isTyreBurst(47, false)) {
|
||||
Status.push(1);
|
||||
}
|
||||
else {
|
||||
Status.push(2);
|
||||
}
|
||||
|
||||
mp.events.callRemote("VehStream_SetWheelData", entity, Status[0], Status[1], Status[2], Status[3], Status[4], Status[5], Status[6], Status[7], Status[8], Status[9]);
|
||||
}, 2500);
|
||||
});
|
||||
|
||||
mp.events.add("VehStream_PlayerEnterVehicleAttempt", (entity, seat) => {
|
||||
entity = mp.vehicles.atRemoteId(entity);
|
||||
if (entity === undefined || entity === null || !entity.isAVehicle()) return;
|
||||
setTimeout(() => {
|
||||
var Status = [];
|
||||
let y = 0;
|
||||
for (y = 0; y < 8; y++) {
|
||||
if (entity.isDoorDamaged(y)) {
|
||||
Status.push(2);
|
||||
}
|
||||
else if (entity.getDoorAngleRatio(y) > 0.15) {
|
||||
Status.push(1);
|
||||
}
|
||||
else {
|
||||
Status.push(0);
|
||||
}
|
||||
}
|
||||
//mp.events.callRemote("VehStream_SetDoorData", entity, Status[0], Status[1], Status[2], Status[3], Status[4], Status[5], Status[6], Status[7]);
|
||||
|
||||
Status = [];
|
||||
if (entity.isWindowIntact(0)) {
|
||||
if (entity.getBoneIndexByName("window_rf") === -1) {
|
||||
Status.push(1);
|
||||
}
|
||||
else {
|
||||
Status.push(0);
|
||||
}
|
||||
}
|
||||
else {
|
||||
Status.push(2);
|
||||
}
|
||||
if (entity.isWindowIntact(1)) {
|
||||
if (entity.getBoneIndexByName("window_lf") === -1) {
|
||||
Status.push(1);
|
||||
}
|
||||
else {
|
||||
Status.push(0);
|
||||
}
|
||||
}
|
||||
else {
|
||||
Status.push(2);
|
||||
}
|
||||
if (entity.isWindowIntact(2)) {
|
||||
if (entity.getBoneIndexByName("window_rr") === -1) {
|
||||
Status.push(1);
|
||||
}
|
||||
else {
|
||||
Status.push(0);
|
||||
}
|
||||
}
|
||||
else {
|
||||
Status.push(2);
|
||||
}
|
||||
if (entity.isWindowIntact(3)) {
|
||||
if (entity.getBoneIndexByName("window_lr") === -1) {
|
||||
Status.push(1);
|
||||
}
|
||||
else {
|
||||
Status.push(0);
|
||||
}
|
||||
}
|
||||
else {
|
||||
Status.push(2);
|
||||
}
|
||||
mp.events.callRemote("VehStream_SetWindowData", entity, Status[0], Status[1], Status[2], Status[3]);
|
||||
}, 3000);
|
||||
});
|
||||
|
||||
mp.events.add("VehStream_SetVehicleDirtLevel", (entity, dirt) => {
|
||||
if (entity === undefined || entity === null || !entity.isAVehicle()) return;
|
||||
if (entity !== undefined) {
|
||||
entity.setDirtLevel(dirt);
|
||||
}
|
||||
});
|
||||
|
||||
mp.events.add("VehStream_SetVehicleDoorStatus_Single", (veh, door, state) => {
|
||||
if (veh === undefined || veh === null || !veh.isAVehicle()) return;
|
||||
if (veh !== undefined) {
|
||||
if (state === 0) {
|
||||
veh.setDoorShut(door, false);
|
||||
}
|
||||
else if (state === 1) {
|
||||
veh.setDoorOpen(door, false, false);
|
||||
}
|
||||
else {
|
||||
veh.setDoorBroken(door, true);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
mp.events.add("VehStream_SetVehicleDoorStatus", (...args) => {
|
||||
if (args[0] !== undefined && args[0] !== null || !args[0].isAVehicle()) {
|
||||
let y = 0;
|
||||
for (y = 1; y < args.length; y++) {
|
||||
if (args[y] === 0) {
|
||||
args[0].setDoorShut(y - 1, false);
|
||||
}
|
||||
else if (args[y] === 1) {
|
||||
args[0].setDoorOpen(y - 1, false, false);
|
||||
}
|
||||
else {
|
||||
args[0].setDoorBroken(y - 1, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
mp.events.add("VehStream_SetVehicleWindowStatus_Single", (veh, windw, state) => {
|
||||
if (veh === undefined || veh === null || !veh.isAVehicle()) return;
|
||||
if (veh !== undefined) {
|
||||
if (state === 1) {
|
||||
veh.rollDownWindow(windw);
|
||||
}
|
||||
else if (state === 0) {
|
||||
veh.fixWindow(windw);
|
||||
veh.rollUpWindow(windw);
|
||||
}
|
||||
else {
|
||||
veh.smashWindow(windw);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
mp.events.add("VehStream_SetVehicleWindowStatus", (...args) => {
|
||||
if (args[0] !== undefined && args[0] !== null || !args[0].isAVehicle()) {
|
||||
let y = 0;
|
||||
for (y = 1; y < 4; y++) {
|
||||
if (args[y] === 1) {
|
||||
args[0].rollDownWindow(y - 1);
|
||||
}
|
||||
else if (args[y] === 0) {
|
||||
args[0].fixWindow(y - 1);
|
||||
args[0].rollUpWindow(y - 1);
|
||||
}
|
||||
else {
|
||||
args[0].smashWindow(y - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
mp.events.add("VehStream_SetVehicleWheelStatus_Single", (veh, wheel, state) => {
|
||||
if (veh === undefined || veh === null || !veh.isAVehicle()) return;
|
||||
if (veh !== undefined) {
|
||||
if (wheel === 9) {
|
||||
if (state === 1) {
|
||||
veh.setTyreBurst(45, false, 1000);
|
||||
}
|
||||
else if (state === 0) {
|
||||
veh.setTyreFixed(45);
|
||||
}
|
||||
else {
|
||||
veh.setTyreBurst(45, true, 1000);
|
||||
}
|
||||
}
|
||||
else if (wheel === 10) {
|
||||
if (state === 1) {
|
||||
veh.setTyreBurst(47, false, 1000);
|
||||
}
|
||||
else if (state === 0) {
|
||||
veh.setTyreFixed(47);
|
||||
}
|
||||
else {
|
||||
veh.setTyreBurst(47, true, 1000);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (state === 1) {
|
||||
veh.setTyreBurst(wheel, false, 1000);
|
||||
}
|
||||
else if (state === 0) {
|
||||
veh.setTyreFixed(wheel);
|
||||
}
|
||||
else {
|
||||
veh.setTyreBurst(wheel, true, 1000);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
mp.events.add("VehStream_SetVehicleWheelStatus", (...args) => {
|
||||
if (args[0] !== undefined && args[0] !== null || !args[0].isAVehicle()) {
|
||||
let y = 0;
|
||||
for (y = 1; y < args.length; y++) {
|
||||
if (y === 9) {
|
||||
if (args[y] === 1) {
|
||||
args[0].setTyreBurst(45, false, 1000);
|
||||
}
|
||||
else if (args[y] === 0) {
|
||||
args[0].setTyreFixed(45);
|
||||
}
|
||||
else {
|
||||
args[0].setTyreBurst(45, true, 1000);
|
||||
}
|
||||
}
|
||||
else if (y === 10) {
|
||||
if (args[y] === 1) {
|
||||
args[0].setTyreBurst(47, false, 1000);
|
||||
}
|
||||
else if (args[y] === 0) {
|
||||
args[0].setTyreFixed(47);
|
||||
}
|
||||
else {
|
||||
args[0].setTyreBurst(47, true, 1000);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (args[y] === 1) {
|
||||
args[0].setTyreBurst(y - 1, false, 1000);
|
||||
}
|
||||
else if (args[y] === 0) {
|
||||
args[0].setTyreFixed(y - 1);
|
||||
}
|
||||
else {
|
||||
args[0].setTyreBurst(y - 1, true, 1000);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//Sync data on stream in
|
||||
mp.events.add("entityStreamIn", (entity) => {
|
||||
if (entity === undefined || entity === null || !entity.isAVehicle()) return;
|
||||
if (entity.type === "vehicle") {
|
||||
let typeor = typeof entity.getVariable('VehicleSyncData');
|
||||
let actualData = entity.getVariable('VehicleSyncData');
|
||||
|
||||
//Needed to stop vehicles from freaking out
|
||||
mp.game.streaming.requestCollisionAtCoord(entity.position.x, entity.position.y, entity.position.z);
|
||||
//mp.game.invoke('0x199640F55E0F7596', entity.position.x, entity.position.y, entity.position.z);
|
||||
entity.setLoadCollisionFlag(true);
|
||||
entity.trackVisibility();
|
||||
|
||||
if (typeor !== 'undefined' && entity.isSeatFree(-1)) //Only if there is no driver
|
||||
{
|
||||
entity.position = actualData.Position;
|
||||
entity.rotation = actualData.Rotation;
|
||||
}
|
||||
|
||||
//Set doors unbreakable for a moment
|
||||
let x = 0;
|
||||
for (x = 0; x < 8; x++) {
|
||||
entity.setDoorBreakable(x, false);
|
||||
}
|
||||
|
||||
//Do it anyway
|
||||
entity.setUndriveable(true);
|
||||
|
||||
if (typeor !== 'undefined') {
|
||||
entity.setEngineOn(actualData.Engine, true, false);
|
||||
entity.setUndriveable(true);
|
||||
|
||||
if (actualData.Locked)
|
||||
entity.setDoorsLocked(2);
|
||||
else
|
||||
entity.setDoorsLocked(1);
|
||||
|
||||
entity.setDirtLevel(actualData.Dirt);
|
||||
|
||||
for (x = 0; x < 8; x++) {
|
||||
if (actualData.Door[x] === 1)
|
||||
entity.setDoorOpen(x, false, false);
|
||||
else if (actualData.Door[x] === 0)
|
||||
entity.setDoorShut(x, true);
|
||||
else
|
||||
entity.setDoorBroken(x, true);
|
||||
}
|
||||
|
||||
for (x = 0; x < 4; x++) {
|
||||
if (actualData.Window[x] === 0) {
|
||||
entity.fixWindow(x);
|
||||
}
|
||||
else if (actualData.Window[x] === 1) {
|
||||
entity.rollDownWindow(x);
|
||||
}
|
||||
else {
|
||||
entity.smashWindow(x);
|
||||
}
|
||||
}
|
||||
|
||||
for (x = 0; x < 8; x++) {
|
||||
if (actualData.Wheel[x] === 0) {
|
||||
entity.setTyreFixed(x);
|
||||
}
|
||||
else if (actualData.Wheel[x] === 1) {
|
||||
entity.setTyreBurst(x, false, 0);
|
||||
}
|
||||
else {
|
||||
entity.setTyreBurst(x, true, 1000);
|
||||
}
|
||||
}
|
||||
|
||||
//For trailer mid wheels
|
||||
if (actualData.Wheel[8] === 0) {
|
||||
entity.setTyreFixed(45);
|
||||
}
|
||||
else if (actualData.Wheel[8] === 1) {
|
||||
entity.setTyreBurst(45, false, 0);
|
||||
}
|
||||
else {
|
||||
entity.setTyreBurst(45, true, 1000);
|
||||
}
|
||||
|
||||
if (actualData.Wheel[9] === 0) {
|
||||
entity.setTyreFixed(47);
|
||||
}
|
||||
else if (actualData.Wheel[9] === 1) {
|
||||
entity.setTyreBurst(47, false, 0);
|
||||
}
|
||||
else {
|
||||
entity.setTyreBurst(47, true, 1000);
|
||||
}
|
||||
}
|
||||
|
||||
//Make doors breakable again
|
||||
setTimeout(() => {
|
||||
for (x = 0; x < 8; x++) {
|
||||
if (entity) {
|
||||
entity.setDoorBreakable(x, true);
|
||||
}
|
||||
}
|
||||
}, 1500);
|
||||
}
|
||||
});
|
||||
|
||||
mp.events.add("vehsync:OpenCar", (bool) => {
|
||||
if (bool) {
|
||||
mp.game.audio.playSoundFrontend(1, "OPENED", "MP_PROPERTIES_ELEVATOR_DOORS", true);
|
||||
} else {
|
||||
mp.game.audio.playSoundFrontend(1, "CLOSED", "MP_PROPERTIES_ELEVATOR_DOORS", true);
|
||||
}
|
||||
|
||||
});
|
||||
var locked: boolean = data.Locked;
|
||||
veh.setDoorsLocked(locked);
|
||||
}
|
||||
@@ -11,6 +11,7 @@ using Microsoft.IdentityModel.Tokens;
|
||||
using ReallifeGamemode.Database;
|
||||
using ReallifeGamemode.Database.Entities;
|
||||
using ReallifeGamemode.Database.Models;
|
||||
using ReallifeGamemode.Server.Types;
|
||||
|
||||
namespace ReallifeGamemode.DataService.Logic
|
||||
{
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using ReallifeGamemode.Database;
|
||||
using ReallifeGamemode.Server.Types;
|
||||
|
||||
namespace ReallifeGamemode.DataService.Types
|
||||
{
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
/**
|
||||
* @overview Life of German Reallife - Admin Levels (AdminLevel.cs)
|
||||
* @author VegaZ, hydrant
|
||||
* @copyright (c) 2008 - 2018 Life of German
|
||||
*/
|
||||
|
||||
namespace ReallifeGamemode.Database
|
||||
{
|
||||
public enum AdminLevel : int
|
||||
{
|
||||
PLAYER = 0,
|
||||
MAPPING = 1,
|
||||
ENTWICKLUNG = 2,
|
||||
SUPPORTER = 3,
|
||||
ADMIN = 4,
|
||||
ADMIN2 = 5,
|
||||
ADMIN3 = 6,
|
||||
HEADADMIN = 1337,
|
||||
PROJEKTLEITUNG = 1338
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using GTANetworkAPI;
|
||||
using ReallifeGamemode.Database.Models;
|
||||
using ReallifeGamemode.Server.Types;
|
||||
|
||||
/**
|
||||
* @overview Life of German Reallife - Entities User (User.cs)
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace ReallifeGamemode.Database
|
||||
{
|
||||
public enum GroupRank
|
||||
{
|
||||
NONE,
|
||||
MEMBER,
|
||||
MANAGER,
|
||||
OWNER
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<TargetFramework>netstandard2.1</TargetFramework>
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
<LangVersion>8.0</LangVersion>
|
||||
</PropertyGroup>
|
||||
@@ -17,6 +17,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\ReallifeGamemode.Server.Types\ReallifeGamemode.Server.Types.csproj" />
|
||||
<ProjectReference Include="..\ReallifeGamemode.Services\ReallifeGamemode.Services.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -6,6 +6,8 @@ namespace ReallifeGamemode.Server.Core.API
|
||||
{
|
||||
public struct Color
|
||||
{
|
||||
public static Color White => new Color(255, 255, 255);
|
||||
|
||||
public int R { get; set; }
|
||||
|
||||
public int G { get; set; }
|
||||
|
||||
@@ -15,6 +15,8 @@ namespace ReallifeGamemode.Server.Core.API
|
||||
|
||||
IMarkerAPI Marker { get; }
|
||||
|
||||
ITextLabelAPI TextLabel { get; }
|
||||
|
||||
void DisableDefaultCommandErrorMessages();
|
||||
|
||||
void DisableDefaultSpawnBehavior();
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace ReallifeGamemode.Server.Core.API
|
||||
{
|
||||
public interface IColShape : IEntity
|
||||
{
|
||||
delegate void ColShapeEvent(IColShape colShape, IEntity entity);
|
||||
delegate void ColShapeEvent(IColShape colShape, IPlayer entity);
|
||||
|
||||
event ColShapeEvent OnEntityEnter;
|
||||
event ColShapeEvent OnEntityExit;
|
||||
|
||||
11
ReallifeGamemode.Server.Core.API/ITextLabel.cs
Normal file
11
ReallifeGamemode.Server.Core.API/ITextLabel.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace ReallifeGamemode.Server.Core.API
|
||||
{
|
||||
public interface ITextLabel : IEntity
|
||||
{
|
||||
string Text { get; set; }
|
||||
}
|
||||
}
|
||||
12
ReallifeGamemode.Server.Core.API/ITextLabelAPI.cs
Normal file
12
ReallifeGamemode.Server.Core.API/ITextLabelAPI.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using ReallifeGamemode.Server.Types;
|
||||
|
||||
namespace ReallifeGamemode.Server.Core.API
|
||||
{
|
||||
public interface ITextLabelAPI
|
||||
{
|
||||
ITextLabel CreateTextLabel(string text, Position position, float range, float size, Font font, Color color);
|
||||
}
|
||||
}
|
||||
38
ReallifeGamemode.Server.Core.Extensions/PlayerExtensions.cs
Normal file
38
ReallifeGamemode.Server.Core.Extensions/PlayerExtensions.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using ReallifeGamemode.Database.Entities;
|
||||
using ReallifeGamemode.Database.Models;
|
||||
using ReallifeGamemode.Server.Core.API;
|
||||
using ReallifeGamemode.Server.Types;
|
||||
|
||||
namespace ReallifeGamemode.Server.Core.Extensions
|
||||
{
|
||||
public static class PlayerExtensions
|
||||
{
|
||||
public static User GetUser(this IPlayer player, DatabaseContext dbContext)
|
||||
{
|
||||
if (player == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return dbContext.Users.Where(u => u.Name == player.Name).FirstOrDefault();
|
||||
}
|
||||
|
||||
public static AdminLevel GetAdminLevel(this IPlayer player, DatabaseContext dbContext)
|
||||
{
|
||||
return player.GetData(u => u.AdminLevel, dbContext);
|
||||
}
|
||||
|
||||
public static TData GetData<TData>(this IPlayer player, Expression<Func<User, TData>> data, DatabaseContext dbContext)
|
||||
{
|
||||
if (player == null)
|
||||
{
|
||||
return default;
|
||||
}
|
||||
|
||||
return dbContext.Users.Where(u => u.Name == player.Name).Select(data).FirstOrDefault();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.1</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\ReallifeGamemode.Database\ReallifeGamemode.Database.csproj" />
|
||||
<ProjectReference Include="..\ReallifeGamemode.Server.Core.API\ReallifeGamemode.Server.Core.API.csproj" />
|
||||
<ProjectReference Include="..\ReallifeGamemode.Server.Types\ReallifeGamemode.Server.Types.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -14,6 +14,8 @@ namespace ReallifeGamemode.Server.Core.RageMP
|
||||
|
||||
public IMarkerAPI Marker => new RageMarkerAPI();
|
||||
|
||||
public ITextLabelAPI TextLabel => new RageTextLabelAPI();
|
||||
|
||||
public void DisableDefaultCommandErrorMessages()
|
||||
{
|
||||
NAPI.Server.SetCommandErrorMessage(null);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using GTANetworkAPI;
|
||||
using ReallifeGamemode.Server.Core.API;
|
||||
using ReallifeGamemode.Server.Core.API.API;
|
||||
|
||||
@@ -10,12 +11,14 @@ namespace ReallifeGamemode.Server.Core.RageMP
|
||||
{
|
||||
public IColShape CreateCyclinder(Position position, float height, float range)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
var colShape = NAPI.ColShape.CreateCylinderColShape(position.ToVector3(), range, height);
|
||||
return new RageColShape(colShape);
|
||||
}
|
||||
|
||||
public IColShape CreateSphere(Position position, float range)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
var colShape = NAPI.ColShape.CreateSphereColShape(position.ToVector3(), range);
|
||||
return new RageColShape(colShape);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
20
ReallifeGamemode.Server.Core.RageMP/RageTextLabel.cs
Normal file
20
ReallifeGamemode.Server.Core.RageMP/RageTextLabel.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using GTANetworkAPI;
|
||||
using ReallifeGamemode.Server.Core.API;
|
||||
|
||||
namespace ReallifeGamemode.Server.Core.RageMP
|
||||
{
|
||||
public class RageTextLabel : RageEntity, ITextLabel
|
||||
{
|
||||
private TextLabel textLabel;
|
||||
|
||||
public string Text { get => textLabel.Text; set => textLabel.Text = value; }
|
||||
|
||||
public RageTextLabel(TextLabel textLabel) : base(textLabel)
|
||||
{
|
||||
this.textLabel = textLabel;
|
||||
}
|
||||
}
|
||||
}
|
||||
19
ReallifeGamemode.Server.Core.RageMP/RageTextLabelAPI.cs
Normal file
19
ReallifeGamemode.Server.Core.RageMP/RageTextLabelAPI.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using GTANetworkAPI;
|
||||
using ReallifeGamemode.Server.Core.API;
|
||||
using ReallifeGamemode.Server.Types;
|
||||
|
||||
namespace ReallifeGamemode.Server.Core.RageMP
|
||||
{
|
||||
public class RageTextLabelAPI : ITextLabelAPI
|
||||
{
|
||||
public ITextLabel CreateTextLabel(string text, Position position, float range, float size, Font font, API.Color color)
|
||||
{
|
||||
TextLabel textLabel = NAPI.TextLabel.CreateTextLabel(text, position.ToVector3(), range, size, (int)font, color.ToColor());
|
||||
|
||||
return new RageTextLabel(textLabel);
|
||||
}
|
||||
}
|
||||
}
|
||||
16
ReallifeGamemode.Server.Core/Commands/Admin/AdminCommand.cs
Normal file
16
ReallifeGamemode.Server.Core/Commands/Admin/AdminCommand.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using ReallifeGamemode.Server.Core.API;
|
||||
|
||||
namespace ReallifeGamemode.Server.Core.Commands.Admin
|
||||
{
|
||||
abstract class AdminCommand : Command
|
||||
{
|
||||
|
||||
public override bool CanExecute(IPlayer player)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
59
ReallifeGamemode.Server.Core/Managers/VehicleManager.cs
Normal file
59
ReallifeGamemode.Server.Core/Managers/VehicleManager.cs
Normal file
@@ -0,0 +1,59 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using ReallifeGamemode.Server.Core.API;
|
||||
using ReallifeGamemode.Server.Types;
|
||||
using ReallifeGamemode.Server.Common;
|
||||
|
||||
namespace ReallifeGamemode.Server.Core.Managers
|
||||
{
|
||||
internal class VehicleManager : Script
|
||||
{
|
||||
private const string DataKey = "VehicleData";
|
||||
|
||||
public VehicleManager()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void SetEngineState(IVehicle veh, bool state)
|
||||
{
|
||||
var data = GetData(veh);
|
||||
data.EngineState = state;
|
||||
SetData(veh, data);
|
||||
}
|
||||
|
||||
public bool GetEngineState(IVehicle veh)
|
||||
{
|
||||
return GetData(veh).EngineState;
|
||||
}
|
||||
|
||||
public void SetLocked(IVehicle veh, bool state)
|
||||
{
|
||||
var data = GetData(veh);
|
||||
data.Locked = state;
|
||||
SetData(veh, data);
|
||||
}
|
||||
|
||||
public bool IsLocked(IVehicle veh)
|
||||
{
|
||||
return GetData(veh).Locked;
|
||||
}
|
||||
|
||||
public VehicleData GetData(IVehicle veh)
|
||||
{
|
||||
return veh.GetSharedData(DataKey, new VehicleData());
|
||||
}
|
||||
|
||||
public void SetData(IVehicle veh, VehicleData data)
|
||||
{
|
||||
if (data is null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(data));
|
||||
}
|
||||
|
||||
veh.SetSharedData(DataKey, data);
|
||||
Api.TriggerClientEventForAll("Vehicle:UpdateData", veh.Handle, data.SerializeJson());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,40 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using ReallifeGamemode.Server.Core.API;
|
||||
using ReallifeGamemode.Server.Types;
|
||||
|
||||
namespace ReallifeGamemode.Server.Core.Menus
|
||||
{
|
||||
internal class PoliceDepartment : Script
|
||||
{
|
||||
|
||||
|
||||
public PoliceDepartment()
|
||||
{
|
||||
// Marker position: 440.869 -981.045 30.689
|
||||
|
||||
CreateVisuals();
|
||||
}
|
||||
|
||||
private void CreateVisuals()
|
||||
{
|
||||
Position pos = new Position(440.869, -981.045, 30.689);
|
||||
|
||||
Api.TextLabel.CreateTextLabel("Polizeirevier\n\nDrücke ~y~E~s~, um das Menü zu öffnen", pos, 20f, 1.3f, Font.ChaletLondon, Color.White);
|
||||
Api.Marker.CreateMarker(MarkerType.VerticalCylinder, pos.Subtract(new Position(0, 0, 1.5)), new Position(), new Position(), 1f, new Color());
|
||||
IColShape colShape = Api.ColShape.CreateSphere(pos.Subtract(new Position(0, 0, 1.5)), 3f);
|
||||
|
||||
colShape.OnEntityEnter += OnPlayerEnterPoliceDepartment;
|
||||
colShape.OnEntityExit += OnPlayerExitPoliceDepartment;
|
||||
}
|
||||
|
||||
private void OnPlayerEnterPoliceDepartment(IColShape colShape, IPlayer player)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void OnPlayerExitPoliceDepartment(IColShape colShape, IPlayer player)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -7,21 +7,14 @@ namespace ReallifeGamemode.Server.Types
|
||||
{
|
||||
public enum AdminLevel
|
||||
{
|
||||
[EnumMember(Value = "None")]
|
||||
None = 0,
|
||||
[EnumMember(Value = "Team")]
|
||||
Team = 1,
|
||||
[EnumMember(Value = "Supporter")]
|
||||
Support = 2,
|
||||
[EnumMember(Value = "Administrator (1)")]
|
||||
Admin_1 = 3,
|
||||
[EnumMember(Value = "Administrator (2)")]
|
||||
Admin_2 = 4,
|
||||
[EnumMember(Value = "Administrator (3)")]
|
||||
Admin_3 = 5,
|
||||
[EnumMember(Value = "Head-Administrator")]
|
||||
Headadmin = 6,
|
||||
[EnumMember(Value = "Projektleiter")]
|
||||
Project_Lead = 7,
|
||||
PLAYER = 0,
|
||||
MAPPING = 1,
|
||||
ENTWICKLUNG = 2,
|
||||
SUPPORTER = 3,
|
||||
ADMIN = 4,
|
||||
ADMIN2 = 5,
|
||||
ADMIN3 = 6,
|
||||
HEADADMIN = 1337,
|
||||
PROJEKTLEITUNG = 1338
|
||||
}
|
||||
}
|
||||
|
||||
15
ReallifeGamemode.Server.Types/Font.cs
Normal file
15
ReallifeGamemode.Server.Types/Font.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace ReallifeGamemode.Server.Types
|
||||
{
|
||||
public enum Font
|
||||
{
|
||||
ChaletLondon = 0,
|
||||
HouseScript = 1,
|
||||
Monospacec = 2,
|
||||
CharletComprimeColonge = 4,
|
||||
Pricedown = 7
|
||||
}
|
||||
}
|
||||
@@ -7,12 +7,9 @@ namespace ReallifeGamemode.Server.Types
|
||||
{
|
||||
public enum GroupRank
|
||||
{
|
||||
None,
|
||||
[EnumMember(Value = "Mitglied")]
|
||||
Member,
|
||||
[EnumMember(Value = "Manager")]
|
||||
Manager,
|
||||
[EnumMember(Value = "Leiter")]
|
||||
Leader
|
||||
NONE,
|
||||
MEMBER,
|
||||
MANAGER,
|
||||
OWNER
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ using Microsoft.EntityFrameworkCore;
|
||||
using ReallifeGamemode.Database.Models;
|
||||
using ReallifeGamemode.Database;
|
||||
using ReallifeGamemode.Services;
|
||||
using ReallifeGamemode.Server.Types;
|
||||
|
||||
/**
|
||||
* @overview Life of German Reallife - Admin Commands (Admin.cs)
|
||||
@@ -137,33 +138,33 @@ namespace ReallifeGamemode.Server.Commands
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (player.GetUser().AdminLevel)
|
||||
{
|
||||
case AdminLevel.MAPPING:
|
||||
switch (player.GetUser().AdminLevel)
|
||||
{
|
||||
case AdminLevel.MAPPING:
|
||||
ChatService.SendMessage(player, "~b~ " + "/team, /tc, /position");
|
||||
break;
|
||||
case AdminLevel.ENTWICKLUNG:
|
||||
case AdminLevel.ENTWICKLUNG:
|
||||
ChatService.SendMessage(player, "~b~ " + "/team, /tc, /position");
|
||||
break;
|
||||
case AdminLevel.SUPPORTER:
|
||||
case AdminLevel.SUPPORTER:
|
||||
ChatService.SendMessage(player, "~b~ " + "/tsupport, /showtickets, /rc, /rc quit, /o, /pm, /dimension, /to, /gh, /clearchat, /skick");
|
||||
break;
|
||||
case AdminLevel.ADMIN:
|
||||
case AdminLevel.ADMIN:
|
||||
ChatService.SendMessage(player, "~b~ " + "/a, /countdown, /freeze, /unfreeze, /mark, /gotmark, /gotox, /up, /setdimension, /spec, /warn, /ip, /kick, /ban /unban, /slap, /takeweapon, /tov, /ghv, /factionlist, /businesslist, /joblist");
|
||||
break;
|
||||
case AdminLevel.ADMIN2:
|
||||
case AdminLevel.ADMIN2:
|
||||
ChatService.SendMessage(player, "~b~ " + "/sethp, /setarmor, /arevive, /aunjail, /aclear, /clothes, /props,/aclear");
|
||||
break;
|
||||
case AdminLevel.ADMIN3:
|
||||
case AdminLevel.ADMIN3:
|
||||
ChatService.SendMessage(player, "~b~ " + "/adice, /settime, /setweather, /rsetarmor, /rgiveweapon, /giveweapon, /veh, /fv, /vfix, /vdestroy, /vlivery, /vcolor, /vehsmoke, /aneon, /mod, /showtuningmenu, /rvdestroy, /vsethp");
|
||||
break;
|
||||
case AdminLevel.HEADADMIN:
|
||||
case AdminLevel.HEADADMIN:
|
||||
ChatService.SendMessage(player, "~b~ " + "/aspeed, /set, /setmoney, /givemoney, /sethandmoney, /givehandmoney, /paydaydrop, /setwage, /freekh, /ainvite, /makeleader, /managefactionranks, /setweaponrack, /rmweaponrack, /setweaponrank, /giveitem, /inventory, /save, /remove, /house, /setbusinessbankbalance, /reloaddors, /interior, /editmode, /setbliptemplate, /ipl, /load, /quicksavemode, /createturf, /setturf, /cancleturf, /reloadturfs, /deleteturfs, /setturfpoint");
|
||||
break;
|
||||
case AdminLevel.PROJEKTLEITUNG:
|
||||
case AdminLevel.PROJEKTLEITUNG:
|
||||
ChatService.SendMessage(player, "~b~ " + "/makeadmin, /whitelist, /blind");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -990,7 +991,7 @@ namespace ReallifeGamemode.Server.Commands
|
||||
return;
|
||||
}
|
||||
|
||||
if(name == null || component == null || drawable == null)
|
||||
if (name == null || component == null || drawable == null)
|
||||
{
|
||||
player.SendChatMessage("~m~Benutzung: ~s~/clothes [Spieler] [Component ID] [Drawable] (Textur)");
|
||||
return;
|
||||
|
||||
@@ -4,6 +4,7 @@ using ReallifeGamemode.Database.Entities;
|
||||
using ReallifeGamemode.Server.Extensions;
|
||||
using ReallifeGamemode.Server.Finance;
|
||||
using ReallifeGamemode.Server.Services;
|
||||
using ReallifeGamemode.Server.Types;
|
||||
using ReallifeGamemode.Server.Util;
|
||||
using System;
|
||||
using System.Linq;
|
||||
|
||||
@@ -4,6 +4,7 @@ using GTANetworkAPI;
|
||||
using ReallifeGamemode.Database;
|
||||
using ReallifeGamemode.Database.Models;
|
||||
using ReallifeGamemode.Server.Services;
|
||||
using ReallifeGamemode.Server.Types;
|
||||
using ReallifeGamemode.Server.Util;
|
||||
using ReallifeGamemode.Server.Wanted;
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ using ReallifeGamemode.Database.Models;
|
||||
using ReallifeGamemode.Server.Extensions;
|
||||
using ReallifeGamemode.Server.Factions.Medic;
|
||||
using ReallifeGamemode.Server.Services;
|
||||
using ReallifeGamemode.Server.Types;
|
||||
using ReallifeGamemode.Server.Util;
|
||||
using ReallifeGamemode.Server.Wanted;
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ using ReallifeGamemode.Database.Models;
|
||||
using ReallifeGamemode.Server.Util;
|
||||
using ReallifeGamemode.Server.Services;
|
||||
using ReallifeGamemode.Database;
|
||||
using ReallifeGamemode.Server.Types;
|
||||
|
||||
/**
|
||||
* @overview Life of German Reallife - Event Login (Login.cs)
|
||||
|
||||
@@ -15,6 +15,7 @@ using ReallifeGamemode.Database.Models;
|
||||
using ReallifeGamemode.Server.Util;
|
||||
using ReallifeGamemode.Server.Inventory.Interfaces;
|
||||
using ReallifeGamemode.Server.DrivingSchool;
|
||||
using ReallifeGamemode.Server.Types;
|
||||
/**
|
||||
* @overview Life of German Reallife - Event Key (Key.cs)
|
||||
* @author VegaZ
|
||||
@@ -326,11 +327,11 @@ namespace ReallifeGamemode.Server.Events
|
||||
}
|
||||
player.TriggerEvent("showElevatorMenu", JsonConvert.SerializeObject(stages.ToArray()));
|
||||
}
|
||||
if(nearestClotheShopPoint != null)
|
||||
if (nearestClotheShopPoint != null)
|
||||
{
|
||||
nearestClotheShopPoint.clotheShop.LoadShopNUI(player);
|
||||
}
|
||||
if(nearestItemShopPoint != null)
|
||||
if (nearestItemShopPoint != null)
|
||||
{
|
||||
nearestItemShopPoint.itemShop.LoadShopNUI(player);
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ using ReallifeGamemode.Server.Services;
|
||||
using ReallifeGamemode.Server.Util;
|
||||
using ReallifeGamemode.Server.Wanted;
|
||||
using ReallifeGamemode.Database;
|
||||
using ReallifeGamemode.Server.Types;
|
||||
|
||||
/**
|
||||
* @overview Life of German Reallife - Event Login (Login.cs)
|
||||
|
||||
@@ -3,6 +3,7 @@ using ReallifeGamemode.Database;
|
||||
using ReallifeGamemode.Database.Entities;
|
||||
using ReallifeGamemode.Database.Models;
|
||||
using ReallifeGamemode.Server.Extensions;
|
||||
using ReallifeGamemode.Server.Types;
|
||||
using ReallifeGamemode.Server.Util;
|
||||
using System;
|
||||
|
||||
@@ -105,7 +106,7 @@ namespace ReallifeGamemode.Server.Events
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if(sV is JobVehicle)
|
||||
else if (sV is JobVehicle)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -124,7 +125,7 @@ namespace ReallifeGamemode.Server.Events
|
||||
else if (!player.IsInVehicle)
|
||||
{
|
||||
GTANetworkAPI.Vehicle vehicle = null;
|
||||
foreach(var veh in NAPI.Pools.GetAllVehicles())
|
||||
foreach (var veh in NAPI.Pools.GetAllVehicles())
|
||||
{
|
||||
if (player.Position.DistanceTo(veh.Position) <= 3f)
|
||||
{
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
using ReallifeGamemode.Server.Util;
|
||||
using static ReallifeGamemode.Database.AdminLevel;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using ReallifeGamemode.Database;
|
||||
using ReallifeGamemode.Server.Types;
|
||||
using static ReallifeGamemode.Server.Types.AdminLevel;
|
||||
|
||||
namespace ReallifeGamemode.Server.Extensions
|
||||
{
|
||||
|
||||
@@ -11,6 +11,7 @@ using ReallifeGamemode.Server.Managers;
|
||||
using ReallifeGamemode.Database.Entities;
|
||||
using System.Linq;
|
||||
using Newtonsoft.Json;
|
||||
using ReallifeGamemode.Server.Types;
|
||||
|
||||
namespace ReallifeGamemode.Server.Job
|
||||
{
|
||||
@@ -100,7 +101,7 @@ namespace ReallifeGamemode.Server.Job
|
||||
|
||||
private static void UpdateFare(object sender, ElapsedEventArgs e)
|
||||
{
|
||||
foreach(var player in GetPlayerInJob())
|
||||
foreach (var player in GetPlayerInJob())
|
||||
{
|
||||
if (!player.HasData("hasPassager")) { player.SetData<bool>("hasPassager", false); continue; }
|
||||
int playerId = player.GetUser().Id;
|
||||
@@ -112,7 +113,7 @@ namespace ReallifeGamemode.Server.Job
|
||||
lastPositions[v.Handle] = v.Position;
|
||||
|
||||
double distance = lastPosition.DistanceTo(v.Position) / 1000.0;
|
||||
if (distance > 0.5) { ChatService.BroadcastAdmin($"Möglicher Cheater - {player.Name}", Database.AdminLevel.MAPPING); continue; }
|
||||
if (distance > 0.5) { ChatService.BroadcastAdmin($"Möglicher Cheater - {player.Name}", AdminLevel.MAPPING); continue; }
|
||||
if (!player.GetData<bool>("hasPassager")) continue;
|
||||
foreach (Player occupant in v.Occupants)
|
||||
{
|
||||
|
||||
@@ -11,6 +11,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using ReallifeGamemode.Database;
|
||||
using ReallifeGamemode.Server.Types;
|
||||
|
||||
namespace ReallifeGamemode.Server.Managers
|
||||
{
|
||||
|
||||
@@ -10,6 +10,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using ReallifeGamemode.Database;
|
||||
using ReallifeGamemode.Server.Types;
|
||||
|
||||
namespace ReallifeGamemode.Server.Managers
|
||||
{
|
||||
@@ -19,7 +20,7 @@ namespace ReallifeGamemode.Server.Managers
|
||||
|
||||
public static void LoadCityHall()
|
||||
{
|
||||
NAPI.Marker.CreateMarker(MarkerType.VerticalCylinder, _cityHallPosition.Subtract(new Vector3(0, 0, 1.7)), new Vector3(), new Vector3(), 1.0f, new Color(255, 255, 255));
|
||||
NAPI.Marker.CreateMarker(GTANetworkAPI.MarkerType.VerticalCylinder, _cityHallPosition.Subtract(new Vector3(0, 0, 1.7)), new Vector3(), new Vector3(), 1.0f, new Color(255, 255, 255));
|
||||
NAPI.TextLabel.CreateTextLabel("~y~Stadthalle~s~\nDrücke ~o~E~s~, um das Menü zu öffnen", _cityHallPosition, 5.0f, 1f, 0, new Color(255, 255, 255));
|
||||
var colShape = NAPI.ColShape.CreateSphereColShape(_cityHallPosition, 1.0f);
|
||||
colShape.OnEntityEnterColShape += (s, c) =>
|
||||
|
||||
@@ -6,6 +6,7 @@ using ReallifeGamemode.Server.Extensions;
|
||||
using ReallifeGamemode.Database.Models;
|
||||
using ReallifeGamemode.Server.Util;
|
||||
using ReallifeGamemode.Database;
|
||||
using ReallifeGamemode.Server.Types;
|
||||
/**
|
||||
* @overview Life of German Reallife - Managers BankManager (BankManager.cs)
|
||||
* @author VegaZ
|
||||
|
||||
@@ -12,6 +12,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using ReallifeGamemode.Database;
|
||||
using ReallifeGamemode.Services;
|
||||
using ReallifeGamemode.Server.Types;
|
||||
|
||||
/**
|
||||
* @overview Life of German Reallife - Managers Interaction (InteractionManager.cs)
|
||||
|
||||
@@ -12,6 +12,7 @@ using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
using ReallifeGamemode.Database;
|
||||
using ReallifeGamemode.Services;
|
||||
using ReallifeGamemode.Server.Types;
|
||||
|
||||
namespace ReallifeGamemode.Server.Report
|
||||
{
|
||||
|
||||
@@ -4,6 +4,7 @@ using ReallifeGamemode.Database.Entities;
|
||||
using ReallifeGamemode.Database.Models;
|
||||
using ReallifeGamemode.Server.Extensions;
|
||||
using ReallifeGamemode.Server.Job;
|
||||
using ReallifeGamemode.Server.Types;
|
||||
using ReallifeGamemode.Server.Util;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<TargetFramework>netstandard2.1</TargetFramework>
|
||||
<Configurations>Debug;Release;ServerBuild</Configurations>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
|
||||
@@ -39,6 +39,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ReallifeGamemode.Server.Cor
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ReallifeGamemode.Server.Log", "ReallifeGamemode.Server.Log\ReallifeGamemode.Server.Log.csproj", "{1A6DB9CA-1921-4758-A9F6-9E3AEB3E1D02}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReallifeGamemode.Server.Core.Extensions", "ReallifeGamemode.Server.Core.Extensions\ReallifeGamemode.Server.Core.Extensions.csproj", "{C21396B2-31D3-47C5-8D87-651FA16E60FD}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -193,6 +195,18 @@ Global
|
||||
{1A6DB9CA-1921-4758-A9F6-9E3AEB3E1D02}.ServerBuild|Any CPU.Build.0 = Debug|Any CPU
|
||||
{1A6DB9CA-1921-4758-A9F6-9E3AEB3E1D02}.ServerBuild|x64.ActiveCfg = Debug|Any CPU
|
||||
{1A6DB9CA-1921-4758-A9F6-9E3AEB3E1D02}.ServerBuild|x64.Build.0 = Debug|Any CPU
|
||||
{C21396B2-31D3-47C5-8D87-651FA16E60FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{C21396B2-31D3-47C5-8D87-651FA16E60FD}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{C21396B2-31D3-47C5-8D87-651FA16E60FD}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{C21396B2-31D3-47C5-8D87-651FA16E60FD}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{C21396B2-31D3-47C5-8D87-651FA16E60FD}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{C21396B2-31D3-47C5-8D87-651FA16E60FD}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{C21396B2-31D3-47C5-8D87-651FA16E60FD}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{C21396B2-31D3-47C5-8D87-651FA16E60FD}.Release|x64.Build.0 = Release|Any CPU
|
||||
{C21396B2-31D3-47C5-8D87-651FA16E60FD}.ServerBuild|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{C21396B2-31D3-47C5-8D87-651FA16E60FD}.ServerBuild|Any CPU.Build.0 = Debug|Any CPU
|
||||
{C21396B2-31D3-47C5-8D87-651FA16E60FD}.ServerBuild|x64.ActiveCfg = Debug|Any CPU
|
||||
{C21396B2-31D3-47C5-8D87-651FA16E60FD}.ServerBuild|x64.Build.0 = Debug|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
Reference in New Issue
Block a user