Merge branch 'develop' of ssh://development.life-of-german.org:451/log-gtav/reallife-gamemode into develop
This commit is contained in:
@@ -87,9 +87,5 @@ mp.events.add('disableLogin', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
function showCefError(error) {
|
function showCefError(error) {
|
||||||
loginBrowser.execute(`showError(\`` + error + `\`)`);
|
loginBrowser.execute(`showError('${error}')`);
|
||||||
}
|
}
|
||||||
|
|
||||||
//function isPlayerBanned() {
|
|
||||||
|
|
||||||
//}
|
|
||||||
@@ -6,7 +6,9 @@
|
|||||||
|
|
||||||
var keyBound = false;
|
var keyBound = false;
|
||||||
|
|
||||||
var carModTypes = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 18, 22, 25, 27, 28, 33, 34, 35, 38, 46, 48];
|
var disableInput = [75, 278, 279, 280, 281, 23, 59, 60, 71, 72, 74];
|
||||||
|
|
||||||
|
var carModTypes = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 18, 22, 25, 27, 28, 33, 34, 35, 38, 39, 40, 41, 42, 43, 44, 46, 48, 69];
|
||||||
|
|
||||||
var carModSlotName = [
|
var carModSlotName = [
|
||||||
{ Slot: 0, Name: "Spoiler" },
|
{ Slot: 0, Name: "Spoiler" },
|
||||||
@@ -35,6 +37,7 @@ var carModSlotName = [
|
|||||||
{ Slot: 34, Name: "Schalthebel" },
|
{ Slot: 34, Name: "Schalthebel" },
|
||||||
{ Slot: 35, Name: "Schild" },
|
{ Slot: 35, Name: "Schild" },
|
||||||
{ Slot: 38, Name: "Hydraulik" },
|
{ Slot: 38, Name: "Hydraulik" },
|
||||||
|
{ Slot: 46, Name: "Fenster" },
|
||||||
{ Slot: 48, Name: "Design" }
|
{ Slot: 48, Name: "Design" }
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -45,6 +48,10 @@ var customPartNames = [
|
|||||||
{
|
{
|
||||||
Slot: 8,
|
Slot: 8,
|
||||||
Name: "Lüftungsschlitze"
|
Name: "Lüftungsschlitze"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Slot: 43,
|
||||||
|
Name: "Motorhaubenstifte"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -114,6 +121,10 @@ mp.events.add('hideTuningInfo', (unbind) => {
|
|||||||
mp.game.ui.clearHelp(true);
|
mp.game.ui.clearHelp(true);
|
||||||
mp.gui.chat.show(true);
|
mp.gui.chat.show(true);
|
||||||
|
|
||||||
|
if (mp.players.local.vehicle) {
|
||||||
|
mp.players.local.vehicle.setLights(0);
|
||||||
|
}
|
||||||
|
|
||||||
if (typeof mainMenu !== "undefined" && unbind) {
|
if (typeof mainMenu !== "undefined" && unbind) {
|
||||||
mainMenu.Close();
|
mainMenu.Close();
|
||||||
globalData.InTuning = false;
|
globalData.InTuning = false;
|
||||||
@@ -135,6 +146,14 @@ function keyPressHandler() {
|
|||||||
mp.events.callRemote("startPlayerTuning");
|
mp.events.callRemote("startPlayerTuning");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mp.events.add("render", () => {
|
||||||
|
if (globalData.InTuning) {
|
||||||
|
disableInput.forEach((input) => {
|
||||||
|
mp.game.controls.disableControlAction(1, input, true);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
mp.events.add("showTuningMenu", () => {
|
mp.events.add("showTuningMenu", () => {
|
||||||
mp.events.call("hideTuningInfo" , false);
|
mp.events.call("hideTuningInfo" , false);
|
||||||
mp.gui.chat.show(false);
|
mp.gui.chat.show(false);
|
||||||
@@ -142,6 +161,8 @@ mp.events.add("showTuningMenu", () => {
|
|||||||
var localPlayer = mp.players.local;
|
var localPlayer = mp.players.local;
|
||||||
var localVehicle = localPlayer.vehicle;
|
var localVehicle = localPlayer.vehicle;
|
||||||
|
|
||||||
|
localVehicle.setLights(1);
|
||||||
|
|
||||||
if (typeof mainMenu !== "undefined" && mainMenu.Visible) {
|
if (typeof mainMenu !== "undefined" && mainMenu.Visible) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -193,8 +214,9 @@ mp.events.add("showTuningMenu", () => {
|
|||||||
if (slotName === "undefined") slotName = "Slot " + modType;
|
if (slotName === "undefined") slotName = "Slot " + modType;
|
||||||
|
|
||||||
var menuItem = new UIMenuItem(slotName);
|
var menuItem = new UIMenuItem(slotName);
|
||||||
|
var num = localVehicle.getNumMods(modType);
|
||||||
if(localVehicle.getNumMods(modType) !== 0 || modType === 18 || modType === 22) mainMenu.AddItem(menuItem);
|
if (num === undefined && modType !== 18 && modType !== 22) return;
|
||||||
|
if (num !== 0 || modType === 18 || modType === 22) mainMenu.AddItem(menuItem);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -206,6 +228,7 @@ mp.events.add("showTuningMenu", () => {
|
|||||||
restStr = item.Text.substring(5);
|
restStr = item.Text.substring(5);
|
||||||
modSlot = parseInt(restStr);
|
modSlot = parseInt(restStr);
|
||||||
}
|
}
|
||||||
|
if (modSlot === undefined) return;
|
||||||
|
|
||||||
if (modSlot === 38) {
|
if (modSlot === 38) {
|
||||||
localVehicle.setDoorOpen(5, false, false);
|
localVehicle.setDoorOpen(5, false, false);
|
||||||
@@ -218,14 +241,25 @@ mp.events.add("showTuningMenu", () => {
|
|||||||
|
|
||||||
var currentMod = localVehicle.getMod(modSlot);
|
var currentMod = localVehicle.getMod(modSlot);
|
||||||
var oldToggleValue;
|
var oldToggleValue;
|
||||||
if (modSlot === 18 || modSlot === 22) {
|
if (modSlot === 18) {
|
||||||
oldToggleValue = localVehicle.isToggleModOn(modSlot);
|
oldToggleValue = localVehicle.isToggleModOn(modSlot);
|
||||||
currentMod = oldToggleValue ? 0 : -1;
|
currentMod = oldToggleValue ? 0 : -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (modSlot === 22) {
|
||||||
|
localVehicle.setLights(2);
|
||||||
|
var hlColor = localVehicle.getVariable("headlightColor");
|
||||||
|
if (typeof hlColor !== "number" || isNaN(hlColor) || hlColor < 0 || hlColor === 255) {
|
||||||
|
currentMod = -1;
|
||||||
|
} else if (hlColor === 13) currentMod = 0;
|
||||||
|
else currentMod = hlColor + 2;
|
||||||
|
}
|
||||||
|
|
||||||
var currentModItem;
|
var currentModItem;
|
||||||
|
|
||||||
var modNum = localVehicle.getNumMods(modSlot);
|
var modNum = localVehicle.getNumMods(modSlot);
|
||||||
if (modSlot === 18 || modSlot === 22) modNum = 1;
|
if (modSlot === 18) modNum = 1;
|
||||||
|
if (modSlot === 22) modNum = 14;
|
||||||
|
|
||||||
modMenu = new Menu(item.Text, "Änderung: " + item.Text, new Point(50, 50));
|
modMenu = new Menu(item.Text, "Änderung: " + item.Text, new Point(50, 50));
|
||||||
|
|
||||||
@@ -237,16 +271,12 @@ mp.events.add("showTuningMenu", () => {
|
|||||||
} else {
|
} else {
|
||||||
var modName = getModName(localVehicle, modSlot, i);
|
var modName = getModName(localVehicle, modSlot, i);
|
||||||
|
|
||||||
if (modSlot === 18) modName = "Turbolader";
|
|
||||||
if (modSlot === 22) modName = "Xenon-Licht";
|
|
||||||
|
|
||||||
modItem = new UIMenuItem(modName, "");
|
modItem = new UIMenuItem(modName, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i === currentMod) {
|
if (i === currentMod - (modSlot === 22 ? 1 : 0)) {
|
||||||
modItem.SetRightBadge(BadgeStyle.Car);
|
modItem.SetRightBadge(BadgeStyle.Car);
|
||||||
currentModItem = modItem;
|
currentModItem = modItem;
|
||||||
modFound = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
modMenu.AddItem(modItem);
|
modMenu.AddItem(modItem);
|
||||||
@@ -262,8 +292,13 @@ mp.events.add("showTuningMenu", () => {
|
|||||||
}
|
}
|
||||||
mp.events.callRemote("setVehicleMod", modSlot, index);
|
mp.events.callRemote("setVehicleMod", modSlot, index);
|
||||||
|
|
||||||
if (modSlot === 18 || modSlot === 22) {
|
if (modSlot === 18) {
|
||||||
oldToggleValue = index === 0 ? false : true;
|
oldToggleValue = index;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (modSlot === 22) {
|
||||||
|
currentMod = index;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -272,8 +307,9 @@ mp.events.add("showTuningMenu", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
modMenu.IndexChange.on((index) => {
|
modMenu.IndexChange.on((index) => {
|
||||||
if (modSlot === 18 || modSlot === 22) {
|
if (modSlot === 18) return;
|
||||||
localVehicle.toggleMod(modSlot, index === 0 ? false : true);
|
if (modSlot === 22) {
|
||||||
|
setHeadlightsColor(localVehicle, index);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (index === 0) index = -1;
|
if (index === 0) index = -1;
|
||||||
@@ -297,9 +333,10 @@ mp.events.add("showTuningMenu", () => {
|
|||||||
mainMenu.Visible = true;
|
mainMenu.Visible = true;
|
||||||
modMenu.Visible = false;
|
modMenu.Visible = false;
|
||||||
|
|
||||||
if (modSlot === 18 || modSlot === 22) {
|
if (modSlot === 18) return;
|
||||||
oldToggleValue = (oldToggleValue === false) ? 0 : 1;
|
else if (modSlot === 22) {
|
||||||
localVehicle.toggleMod(modSlot, oldToggleValue === 0 ? false : true);
|
localVehicle.setLights(1);
|
||||||
|
setHeadlightsColor(localVehicle, currentMod);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
localVehicle.setMod(modSlot, currentMod);
|
localVehicle.setMod(modSlot, currentMod);
|
||||||
@@ -310,6 +347,7 @@ mp.events.add("showTuningMenu", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
mainMenu.MenuClose.on(() => {
|
mainMenu.MenuClose.on(() => {
|
||||||
|
localVehicle.setLights(0);
|
||||||
globalData.InTuning = false;
|
globalData.InTuning = false;
|
||||||
mp.events.call("hideTuningInfo", false);
|
mp.events.call("hideTuningInfo", false);
|
||||||
});
|
});
|
||||||
@@ -452,8 +490,73 @@ function getModName(vehicle, slot, mod) {
|
|||||||
case 3:
|
case 3:
|
||||||
realModName = "Rennfederung";
|
realModName = "Rennfederung";
|
||||||
break;
|
break;
|
||||||
|
case 4:
|
||||||
|
realModName = "Wettkampffederung";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else if (slot === 18) {
|
||||||
|
realModName = "Turbotuning";
|
||||||
|
} else if (slot === 22) {
|
||||||
|
switch (mod) {
|
||||||
|
case 0:
|
||||||
|
realModName = "Xenon Licht";
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
realModName = "Weißes Licht";
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
realModName = "Blaues Licht";
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
realModName = "Hell-blaues Licht";
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
realModName = "Grünes Licht";
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
realModName = "Hell-grünes Licht";
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
realModName = "Hell-gelbes Licht";
|
||||||
|
break;
|
||||||
|
case 7:
|
||||||
|
realModName = "Gelbes Licht";
|
||||||
|
break;
|
||||||
|
case 8:
|
||||||
|
realModName = "Orangenes Licht";
|
||||||
|
break;
|
||||||
|
case 9:
|
||||||
|
realModName = "Rotes Licht";
|
||||||
|
break;
|
||||||
|
case 10:
|
||||||
|
realModName = "Hell-pinkes Licht";
|
||||||
|
break;
|
||||||
|
case 11:
|
||||||
|
realModName = "Pinkes Licht";
|
||||||
|
break;
|
||||||
|
case 12:
|
||||||
|
realModName = "Lila Licht";
|
||||||
|
break;
|
||||||
|
case 13:
|
||||||
|
realModName = "Hell-lila Licht";
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return realModName;
|
return realModName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setHeadlightsColor(vehicle, index) {
|
||||||
|
var color = index - 2;
|
||||||
|
if (index === 0) color = -1;
|
||||||
|
if (index === 1) color = 13;
|
||||||
|
if (typeof color !== "number" || isNaN(color) || color < 0 || color === 255) {
|
||||||
|
// Disable
|
||||||
|
vehicle.toggleMod(22, false);
|
||||||
|
mp.game.invoke("0xE41033B25D003A07", vehicle.handle, 255);
|
||||||
|
} else {
|
||||||
|
// Enable
|
||||||
|
vehicle.toggleMod(22, true);
|
||||||
|
mp.game.invoke("0xE41033B25D003A07", vehicle.handle, color);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,15 +1,10 @@
|
|||||||
mp.events.add('entityStreamIn', (entity) => {
|
mp.events.add('entityStreamIn', (entity) => {
|
||||||
if (entity.isAVehicle()) {
|
if (entity.isAVehicle()) {
|
||||||
var mod18 = entity.getVariable('mod18');
|
var mod18 = entity.getVariable('mod18');
|
||||||
var mod22 = entity.getVariable('mod22');
|
|
||||||
|
|
||||||
if (mod18 !== undefined) {
|
if (mod18 !== undefined) {
|
||||||
entity.toggleMod(18, mod18);
|
entity.toggleMod(18, mod18);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mod22 !== undefined) {
|
|
||||||
entity.toggleMod(22, mod22);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
19
Client/coloredhlights/index.js
Normal file
19
Client/coloredhlights/index.js
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
function setHeadlightsColor(vehicle, color) {
|
||||||
|
if (typeof color !== "number" || isNaN(color) || color < 0 || color === 255) {
|
||||||
|
// Disable
|
||||||
|
vehicle.toggleMod(22, false);
|
||||||
|
mp.game.invoke("0xE41033B25D003A07", vehicle.handle, 255);
|
||||||
|
} else {
|
||||||
|
// Enable
|
||||||
|
vehicle.toggleMod(22, true);
|
||||||
|
mp.game.invoke("0xE41033B25D003A07", vehicle.handle, color);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mp.events.add("entityStreamIn", (entity) => {
|
||||||
|
if (entity.type === "vehicle") setHeadlightsColor(entity, parseInt(entity.getVariable("headlightColor")));
|
||||||
|
});
|
||||||
|
|
||||||
|
mp.events.addDataHandler("headlightColor", (entity, value) => {
|
||||||
|
if (entity.type === "vehicle") setHeadlightsColor(entity, value);
|
||||||
|
});
|
||||||
@@ -13,6 +13,8 @@ mp.game.gameplay.enableMpDlcMaps(true);
|
|||||||
|
|
||||||
require('./CharCreator/index.js');
|
require('./CharCreator/index.js');
|
||||||
|
|
||||||
|
require('./coloredhlights');
|
||||||
|
|
||||||
require('./FactionManagement/main.js');
|
require('./FactionManagement/main.js');
|
||||||
|
|
||||||
require('./DoorManager/doormanager.js');
|
require('./DoorManager/doormanager.js');
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
//You don't need to worry about anything here
|
//You don't need to worry about anything here
|
||||||
|
|
||||||
mp.events.add("VehStream_SetEngineStatus", (veh, status) => {
|
mp.events.add("VehStream_SetEngineStatus", (veh, status) => {
|
||||||
if (veh === undefined || veh === null) return;
|
if (veh === undefined || veh === null || !veh.isAVehicle()) return;
|
||||||
if (veh !== undefined) {
|
if (veh !== undefined) {
|
||||||
if (veh.isSeatFree(-1)) //Turns engine on instantly if no driver, otherwise it will not turn on
|
if (veh.isSeatFree(-1)) //Turns engine on instantly if no driver, otherwise it will not turn on
|
||||||
{
|
{
|
||||||
@@ -17,7 +17,7 @@ mp.events.add("VehStream_SetEngineStatus", (veh, status) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
mp.events.add("VehStream_SetLockStatus", (veh, status) => {
|
mp.events.add("VehStream_SetLockStatus", (veh, status) => {
|
||||||
if (veh === undefined || veh === null) return;
|
if (veh === undefined || veh === null || !veh.isAVehicle()) return;
|
||||||
if (veh !== undefined) {
|
if (veh !== undefined) {
|
||||||
if (status)
|
if (status)
|
||||||
veh.setDoorsLocked(2);
|
veh.setDoorsLocked(2);
|
||||||
@@ -27,7 +27,7 @@ mp.events.add("VehStream_SetLockStatus", (veh, status) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
mp.events.add("VehStream_PlayerEnterVehicleAttempt", (entity, seat) => {
|
mp.events.add("VehStream_PlayerEnterVehicleAttempt", (entity, seat) => {
|
||||||
if (entity === undefined || entity === null) return;
|
if (entity === undefined || entity === null || !entity.isAVehicle()) return;
|
||||||
if (typeof entity.getVariable("VehicleSyncData") !== 'undefined') {
|
if (typeof entity.getVariable("VehicleSyncData") !== 'undefined') {
|
||||||
var toggle = entity.getVariable("VehicleSyncData");
|
var toggle = entity.getVariable("VehicleSyncData");
|
||||||
entity.setEngineOn(toggle.Engine, false, true);
|
entity.setEngineOn(toggle.Engine, false, true);
|
||||||
@@ -36,7 +36,7 @@ mp.events.add("VehStream_PlayerEnterVehicleAttempt", (entity, seat) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
mp.events.add("VehStream_PlayerExitVehicleAttempt", (entity) => {
|
mp.events.add("VehStream_PlayerExitVehicleAttempt", (entity) => {
|
||||||
if (entity === undefined || entity === null) return;
|
if (entity === undefined || entity === null || !entity.isAVehicle()) return;
|
||||||
if (entity !== undefined) {
|
if (entity !== undefined) {
|
||||||
if (typeof entity.getVariable("VehicleSyncData") !== 'undefined') {
|
if (typeof entity.getVariable("VehicleSyncData") !== 'undefined') {
|
||||||
var toggle = entity.getVariable("VehicleSyncData");
|
var toggle = entity.getVariable("VehicleSyncData");
|
||||||
@@ -50,177 +50,181 @@ mp.events.add("VehStream_PlayerExitVehicleAttempt", (entity) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
mp.events.add("VehStream_PlayerExitVehicle", (entity) => {
|
mp.events.add("VehStream_PlayerExitVehicle", (entity) => {
|
||||||
if (entity === undefined || entity === null) return;
|
try {
|
||||||
setTimeout(() => {
|
if (entity === undefined || entity === null || !entity.isAVehicle()) return;
|
||||||
var Status = [];
|
setTimeout(() => {
|
||||||
let y = 0;
|
var Status = [];
|
||||||
for (y = 0; y < 8; y++) {
|
let y = 0;
|
||||||
if (entity.isDoorDamaged(y)) {
|
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);
|
Status.push(2);
|
||||||
}
|
}
|
||||||
else if (entity.getDoorAngleRatio(y) > 0.15) {
|
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]);
|
||||||
|
|
||||||
|
Status = [];
|
||||||
|
if (!entity.isTyreBurst(0, false)) {
|
||||||
|
Status.push(0);
|
||||||
|
}
|
||||||
|
else if (entity.isTyreBurst(0, false)) {
|
||||||
Status.push(1);
|
Status.push(1);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
Status.push(2);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!entity.isTyreBurst(1, false)) {
|
||||||
Status.push(0);
|
Status.push(0);
|
||||||
}
|
}
|
||||||
}
|
else if (entity.isTyreBurst(1, false)) {
|
||||||
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);
|
Status.push(1);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
Status.push(2);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!entity.isTyreBurst(2, false)) {
|
||||||
Status.push(0);
|
Status.push(0);
|
||||||
}
|
}
|
||||||
}
|
else if (entity.isTyreBurst(2, false)) {
|
||||||
else {
|
|
||||||
Status.push(2);
|
|
||||||
}
|
|
||||||
if (entity.isWindowIntact(1)) {
|
|
||||||
if (entity.getBoneIndexByName("window_lf") === -1) {
|
|
||||||
Status.push(1);
|
Status.push(1);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
Status.push(2);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!entity.isTyreBurst(3, false)) {
|
||||||
Status.push(0);
|
Status.push(0);
|
||||||
}
|
}
|
||||||
}
|
else if (entity.isTyreBurst(3, false)) {
|
||||||
else {
|
|
||||||
Status.push(2);
|
|
||||||
}
|
|
||||||
if (entity.isWindowIntact(2)) {
|
|
||||||
if (entity.getBoneIndexByName("window_rr") === -1) {
|
|
||||||
Status.push(1);
|
Status.push(1);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
Status.push(2);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!entity.isTyreBurst(4, false)) {
|
||||||
Status.push(0);
|
Status.push(0);
|
||||||
}
|
}
|
||||||
}
|
else if (entity.isTyreBurst(4, false)) {
|
||||||
else {
|
|
||||||
Status.push(2);
|
|
||||||
}
|
|
||||||
if (entity.isWindowIntact(3)) {
|
|
||||||
if (entity.getBoneIndexByName("window_lr") === -1) {
|
|
||||||
Status.push(1);
|
Status.push(1);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
Status.push(2);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!entity.isTyreBurst(5, false)) {
|
||||||
Status.push(0);
|
Status.push(0);
|
||||||
}
|
}
|
||||||
}
|
else if (entity.isTyreBurst(5, false)) {
|
||||||
else {
|
Status.push(1);
|
||||||
Status.push(2);
|
}
|
||||||
}
|
else {
|
||||||
mp.events.callRemote("VehStream_SetWindowData", entity, Status[0], Status[1], Status[2], Status[3]);
|
Status.push(2);
|
||||||
|
}
|
||||||
|
|
||||||
Status = [];
|
if (!entity.isTyreBurst(6, false)) {
|
||||||
if (!entity.isTyreBurst(0, false)) {
|
Status.push(0);
|
||||||
Status.push(0);
|
}
|
||||||
}
|
else if (entity.isTyreBurst(6, false)) {
|
||||||
else if (entity.isTyreBurst(0, false)) {
|
Status.push(1);
|
||||||
Status.push(1);
|
}
|
||||||
}
|
else {
|
||||||
else {
|
Status.push(2);
|
||||||
Status.push(2);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (!entity.isTyreBurst(1, false)) {
|
if (!entity.isTyreBurst(7, false)) {
|
||||||
Status.push(0);
|
Status.push(0);
|
||||||
}
|
}
|
||||||
else if (entity.isTyreBurst(1, false)) {
|
else if (entity.isTyreBurst(7, false)) {
|
||||||
Status.push(1);
|
Status.push(1);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Status.push(2);
|
Status.push(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!entity.isTyreBurst(2, false)) {
|
if (!entity.isTyreBurst(45, false)) {
|
||||||
Status.push(0);
|
Status.push(0);
|
||||||
}
|
}
|
||||||
else if (entity.isTyreBurst(2, false)) {
|
else if (entity.isTyreBurst(45, false)) {
|
||||||
Status.push(1);
|
Status.push(1);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Status.push(2);
|
Status.push(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!entity.isTyreBurst(3, false)) {
|
if (!entity.isTyreBurst(47, false)) {
|
||||||
Status.push(0);
|
Status.push(0);
|
||||||
}
|
}
|
||||||
else if (entity.isTyreBurst(3, false)) {
|
else if (entity.isTyreBurst(47, false)) {
|
||||||
Status.push(1);
|
Status.push(1);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Status.push(2);
|
Status.push(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!entity.isTyreBurst(4, false)) {
|
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]);
|
||||||
Status.push(0);
|
}, 2500);
|
||||||
}
|
} catch (e) {
|
||||||
else if (entity.isTyreBurst(4, false)) {
|
console.log("error: " + e);
|
||||||
Status.push(1);
|
}
|
||||||
}
|
|
||||||
else {
|
|
||||||
Status.push(2);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!entity.isTyreBurst(5, false)) {
|
|
||||||
Status.push(0);
|
|
||||||
}
|
|
||||||
else if (entity.isTyreBurst(5, false)) {
|
|
||||||
Status.push(1);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
Status.push(2);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!entity.isTyreBurst(6, false)) {
|
|
||||||
Status.push(0);
|
|
||||||
}
|
|
||||||
else if (entity.isTyreBurst(6, false)) {
|
|
||||||
Status.push(1);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
Status.push(2);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!entity.isTyreBurst(7, false)) {
|
|
||||||
Status.push(0);
|
|
||||||
}
|
|
||||||
else if (entity.isTyreBurst(7, false)) {
|
|
||||||
Status.push(1);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
Status.push(2);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!entity.isTyreBurst(45, false)) {
|
|
||||||
Status.push(0);
|
|
||||||
}
|
|
||||||
else if (entity.isTyreBurst(45, false)) {
|
|
||||||
Status.push(1);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
Status.push(2);
|
|
||||||
}
|
|
||||||
|
|
||||||
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) => {
|
mp.events.add("VehStream_PlayerEnterVehicleAttempt", (entity, seat) => {
|
||||||
if (entity === undefined || entity === null) return;
|
if (entity === undefined || entity === null || !entity.isAVehicle()) return;
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
var Status = [];
|
var Status = [];
|
||||||
let y = 0;
|
let y = 0;
|
||||||
@@ -287,14 +291,14 @@ mp.events.add("VehStream_PlayerEnterVehicleAttempt", (entity, seat) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
mp.events.add("VehStream_SetVehicleDirtLevel", (entity, dirt) => {
|
mp.events.add("VehStream_SetVehicleDirtLevel", (entity, dirt) => {
|
||||||
if (entity === undefined || entity === null) return;
|
if (entity === undefined || entity === null || !entity.isAVehicle()) return;
|
||||||
if (entity !== undefined) {
|
if (entity !== undefined) {
|
||||||
entity.setDirtLevel(dirt);
|
entity.setDirtLevel(dirt);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
mp.events.add("VehStream_SetVehicleDoorStatus_Single", (veh, door, state) => {
|
mp.events.add("VehStream_SetVehicleDoorStatus_Single", (veh, door, state) => {
|
||||||
if (veh === undefined || veh === null) return;
|
if (veh === undefined || veh === null || !veh.isAVehicle()) return;
|
||||||
if (veh !== undefined) {
|
if (veh !== undefined) {
|
||||||
if (state === 0) {
|
if (state === 0) {
|
||||||
veh.setDoorShut(door, false);
|
veh.setDoorShut(door, false);
|
||||||
@@ -309,7 +313,7 @@ mp.events.add("VehStream_SetVehicleDoorStatus_Single", (veh, door, state) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
mp.events.add("VehStream_SetVehicleDoorStatus", (...args) => {
|
mp.events.add("VehStream_SetVehicleDoorStatus", (...args) => {
|
||||||
if (args[0] !== undefined && args[0] !== null) {
|
if (args[0] !== undefined && args[0] !== null || !args[0].isAVehicle()) {
|
||||||
let y = 0;
|
let y = 0;
|
||||||
for (y = 1; y < args.length; y++) {
|
for (y = 1; y < args.length; y++) {
|
||||||
if (args[y] === 0) {
|
if (args[y] === 0) {
|
||||||
@@ -326,7 +330,7 @@ mp.events.add("VehStream_SetVehicleDoorStatus", (...args) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
mp.events.add("VehStream_SetVehicleWindowStatus_Single", (veh, windw, state) => {
|
mp.events.add("VehStream_SetVehicleWindowStatus_Single", (veh, windw, state) => {
|
||||||
if (veh === undefined || veh === null) return;
|
if (veh === undefined || veh === null || !veh.isAVehicle()) return;
|
||||||
if (veh !== undefined) {
|
if (veh !== undefined) {
|
||||||
if (state === 1) {
|
if (state === 1) {
|
||||||
veh.rollDownWindow(windw);
|
veh.rollDownWindow(windw);
|
||||||
@@ -342,7 +346,7 @@ mp.events.add("VehStream_SetVehicleWindowStatus_Single", (veh, windw, state) =>
|
|||||||
});
|
});
|
||||||
|
|
||||||
mp.events.add("VehStream_SetVehicleWindowStatus", (...args) => {
|
mp.events.add("VehStream_SetVehicleWindowStatus", (...args) => {
|
||||||
if (args[0] !== undefined && args[0] !== null) {
|
if (args[0] !== undefined && args[0] !== null || !args[0].isAVehicle()) {
|
||||||
let y = 0;
|
let y = 0;
|
||||||
for (y = 1; y < 4; y++) {
|
for (y = 1; y < 4; y++) {
|
||||||
if (args[y] === 1) {
|
if (args[y] === 1) {
|
||||||
@@ -360,7 +364,7 @@ mp.events.add("VehStream_SetVehicleWindowStatus", (...args) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
mp.events.add("VehStream_SetVehicleWheelStatus_Single", (veh, wheel, state) => {
|
mp.events.add("VehStream_SetVehicleWheelStatus_Single", (veh, wheel, state) => {
|
||||||
if (veh === undefined || veh === null) return;
|
if (veh === undefined || veh === null || !veh.isAVehicle()) return;
|
||||||
if (veh !== undefined) {
|
if (veh !== undefined) {
|
||||||
if (wheel === 9) {
|
if (wheel === 9) {
|
||||||
if (state === 1) {
|
if (state === 1) {
|
||||||
@@ -399,7 +403,7 @@ mp.events.add("VehStream_SetVehicleWheelStatus_Single", (veh, wheel, state) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
mp.events.add("VehStream_SetVehicleWheelStatus", (...args) => {
|
mp.events.add("VehStream_SetVehicleWheelStatus", (...args) => {
|
||||||
if (args[0] !== undefined && args[0] !== null) {
|
if (args[0] !== undefined && args[0] !== null || !args[0].isAVehicle()) {
|
||||||
let y = 0;
|
let y = 0;
|
||||||
for (y = 1; y < args.length; y++) {
|
for (y = 1; y < args.length; y++) {
|
||||||
if (y === 9) {
|
if (y === 9) {
|
||||||
@@ -441,6 +445,7 @@ mp.events.add("VehStream_SetVehicleWheelStatus", (...args) => {
|
|||||||
|
|
||||||
//Sync data on stream in
|
//Sync data on stream in
|
||||||
mp.events.add("entityStreamIn", (entity) => {
|
mp.events.add("entityStreamIn", (entity) => {
|
||||||
|
if (entity === undefined || entity === null || !entity.isAVehicle()) return;
|
||||||
if (entity.type === "vehicle") {
|
if (entity.type === "vehicle") {
|
||||||
let typeor = typeof entity.getVariable('VehicleSyncData');
|
let typeor = typeof entity.getVariable('VehicleSyncData');
|
||||||
let actualData = entity.getVariable('VehicleSyncData');
|
let actualData = entity.getVariable('VehicleSyncData');
|
||||||
|
|||||||
3
Main.cs
3
Main.cs
@@ -37,9 +37,6 @@ namespace reallife_gamemode
|
|||||||
|
|
||||||
|
|
||||||
InventoryManager.LoadItems();
|
InventoryManager.LoadItems();
|
||||||
TuningManager.AddTuningGarage(new Vector3(-341, -134, 38.5));
|
|
||||||
TuningManager.AddTuningGarage(new Vector3(732, -1088, 21));
|
|
||||||
TuningManager.AddTuningGarage(new Vector3(-1155, -2006, 12));
|
|
||||||
TuningManager.AddTuningGarage(new Vector3(-341, -134, 38.5)); // Downtown LS
|
TuningManager.AddTuningGarage(new Vector3(-341, -134, 38.5)); // Downtown LS
|
||||||
TuningManager.AddTuningGarage(new Vector3(732, -1088, 21)); // LS Intersection
|
TuningManager.AddTuningGarage(new Vector3(732, -1088, 21)); // LS Intersection
|
||||||
TuningManager.AddTuningGarage(new Vector3(-1155, -2006, 12)); // LS Airport
|
TuningManager.AddTuningGarage(new Vector3(-1155, -2006, 12)); // LS Airport
|
||||||
|
|||||||
@@ -90,13 +90,10 @@ namespace reallife_gamemode.Server.Commands
|
|||||||
|
|
||||||
player.SendChatMessage("Online Teammitglieder:");
|
player.SendChatMessage("Online Teammitglieder:");
|
||||||
|
|
||||||
List<Client> playerlist = NAPI.Pools.GetAllPlayers();
|
List<Client> playerlist = NAPI.Pools.GetAllPlayers().FindAll(c => c.GetUser()?.IsAdmin(AdminLevel.SUPPORTER) ?? false).OrderByDescending(c => c.GetUser().AdminLevel).ToList();
|
||||||
foreach (Client currentPlayer in playerlist)
|
foreach (Client currentPlayer in playerlist)
|
||||||
{
|
{
|
||||||
if (currentPlayer.GetUser()?.IsAdmin(AdminLevel.SUPPORTER) ?? false)
|
player.SendChatMessage(currentPlayer.GetUser().AdminLevel.GetName() + " | " + currentPlayer.Name);
|
||||||
{
|
|
||||||
player.SendChatMessage(currentPlayer.Name);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -842,7 +839,8 @@ namespace reallife_gamemode.Server.Commands
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint uHash = NAPI.Util.GetHashKey(hash);
|
if(!uint.TryParse(hash, out uint uHash))
|
||||||
|
uHash = NAPI.Util.GetHashKey(hash);
|
||||||
|
|
||||||
if(!VehicleManager.IsValidHash(uHash))
|
if(!VehicleManager.IsValidHash(uHash))
|
||||||
{
|
{
|
||||||
@@ -873,8 +871,8 @@ namespace reallife_gamemode.Server.Commands
|
|||||||
player.Vehicle.Repair();
|
player.Vehicle.Repair();
|
||||||
}
|
}
|
||||||
|
|
||||||
[Command("vdestroy")]
|
[Command("vdestroy", "~m~Benutzung: ~s~/vdestroy (ID)")]
|
||||||
public void CmdAdminVdestroy(Client player)
|
public void CmdAdminVdestroy(Client player, int vid = -1)
|
||||||
{
|
{
|
||||||
if (!player.GetUser()?.IsAdmin(AdminLevel.ADMIN3) ?? true)
|
if (!player.GetUser()?.IsAdmin(AdminLevel.ADMIN3) ?? true)
|
||||||
{
|
{
|
||||||
@@ -882,22 +880,35 @@ namespace reallife_gamemode.Server.Commands
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!player.IsInVehicle)
|
Vehicle targetVeh;
|
||||||
|
|
||||||
|
if (vid == -1)
|
||||||
{
|
{
|
||||||
player.SendChatMessage("~r~[FEHLER]~s~ Du sitzt momentan nicht in einem Fahrzeug.");
|
if (!player.IsInVehicle)
|
||||||
return;
|
{
|
||||||
|
player.SendChatMessage("~m~Benutzung: ~s~/vdestroy (ID)");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
targetVeh = player.Vehicle;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
targetVeh = VehicleManager.GetVehicleFromId(vid);
|
||||||
|
if(targetVeh == null)
|
||||||
|
{
|
||||||
|
player.SendChatMessage("~r~[FEHLER]~s~ Dieses Fahrzeug existiert nicht.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Vehicle playerVeh = player.Vehicle;
|
ServerVehicle veh = VehicleManager.GetServerVehicleFromVehicle(targetVeh);
|
||||||
|
|
||||||
ServerVehicle veh = VehicleManager.GetServerVehicleFromVehicle(playerVeh);
|
|
||||||
if(veh != null)
|
if(veh != null)
|
||||||
{
|
{
|
||||||
player.SendChatMessage("~r~[FEHLER]~s~ Dieses Fahrzeug wird von einem Server-System benutzt: ~m~" + veh.GetType().Name);
|
player.SendChatMessage("~r~[FEHLER]~s~ Dieses Fahrzeug wird von einem Server-System benutzt: ~m~" + veh.GetType().Name);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
VehicleManager.DeleteVehicle(playerVeh);
|
VehicleManager.DeleteVehicle(targetVeh);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Command("vlivery", "~m~Benutzung: ~s~/vlivery [Livery]")]
|
[Command("vlivery", "~m~Benutzung: ~s~/vlivery [Livery]")]
|
||||||
@@ -1297,7 +1308,7 @@ namespace reallife_gamemode.Server.Commands
|
|||||||
}
|
}
|
||||||
|
|
||||||
[Command("time", "~m~Benutzung: ~s~/time [Stunde] (Minuten) (Sekunden)")]
|
[Command("time", "~m~Benutzung: ~s~/time [Stunde] (Minuten) (Sekunden)")]
|
||||||
public void CmdAdminSetTime(Client player, int hour, int min = 0, int sec = 0)
|
public void CmdAdminTime(Client player, int hour, int min = 0, int sec = 0)
|
||||||
{
|
{
|
||||||
if (!player.GetUser()?.IsAdmin(AdminLevel.HEADADMIN) ?? true)
|
if (!player.GetUser()?.IsAdmin(AdminLevel.HEADADMIN) ?? true)
|
||||||
{
|
{
|
||||||
@@ -1305,8 +1316,22 @@ namespace reallife_gamemode.Server.Commands
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(hour > 23 || min > 59 || sec > 59)
|
||||||
|
{
|
||||||
|
player.SendChatMessage("~r~[FEHLER]~s~ Es wurde eine ungültige Zeit eingegeben.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(hour == -1)
|
||||||
|
{
|
||||||
|
player.SendChatMessage("Es wird nun wieder die Echtzeit genutzt.");
|
||||||
|
TimeManager.StartTimeManager();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
string broadcastMsg = $"Serverzeit wurde auf {hour:D2}:{min:D2}:{sec:D2} gesetzt!";
|
string broadcastMsg = $"Serverzeit wurde auf {hour:D2}:{min:D2}:{sec:D2} gesetzt!";
|
||||||
NAPI.Notification.SendNotificationToAll(broadcastMsg);
|
NAPI.Notification.SendNotificationToAll(broadcastMsg);
|
||||||
|
TimeManager.PauseTimeManager();
|
||||||
NAPI.World.SetTime(hour, min, sec);
|
NAPI.World.SetTime(hour, min, sec);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -2034,6 +2059,18 @@ namespace reallife_gamemode.Server.Commands
|
|||||||
BankManager.SetMoney(player, business, amount, "Admin");
|
BankManager.SetMoney(player, business, amount, "Admin");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Command("showtuningmenu", "~m~Benutzung: ~s~/showtuningmenu")]
|
||||||
|
public void CmdAdminShowtuningmenu(Client player)
|
||||||
|
{
|
||||||
|
if (!player.GetUser()?.IsAdmin(AdminLevel.HEADADMIN) ?? true)
|
||||||
|
{
|
||||||
|
ChatService.NotAuthorized(player);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
player.TriggerEvent("showTuningMenu");
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region ALevel1338
|
#region ALevel1338
|
||||||
|
|||||||
@@ -8,12 +8,22 @@ namespace reallife_gamemode.Server.Managers
|
|||||||
{
|
{
|
||||||
public class TimeManager
|
public class TimeManager
|
||||||
{
|
{
|
||||||
|
private static Timer realTimeTimer;
|
||||||
|
|
||||||
public static void StartTimeManager()
|
public static void StartTimeManager()
|
||||||
{
|
{
|
||||||
Timer t = new Timer(1000);
|
if(realTimeTimer == null)
|
||||||
t.Elapsed += SetTime;
|
{
|
||||||
|
realTimeTimer = new Timer(1000);
|
||||||
|
realTimeTimer.Elapsed += SetTime;
|
||||||
|
}
|
||||||
|
|
||||||
t.Start();
|
realTimeTimer.Start();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void PauseTimeManager()
|
||||||
|
{
|
||||||
|
realTimeTimer.Stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void SetTime(object sender, ElapsedEventArgs args)
|
private static void SetTime(object sender, ElapsedEventArgs args)
|
||||||
|
|||||||
@@ -47,17 +47,23 @@ namespace reallife_gamemode.Server.Managers
|
|||||||
|
|
||||||
|
|
||||||
veh.SetSharedData("mod18", false);
|
veh.SetSharedData("mod18", false);
|
||||||
veh.SetSharedData("mod22", false);
|
|
||||||
|
|
||||||
using (var dbContext = new DatabaseContext())
|
using (var dbContext = new DatabaseContext())
|
||||||
{
|
{
|
||||||
foreach(VehicleMod vMod in dbContext.VehicleMods.ToList().FindAll(vM => vM.ServerVehicleId == sVeh.Id))
|
foreach(VehicleMod vMod in dbContext.VehicleMods.ToList().FindAll(vM => vM.ServerVehicleId == sVeh.Id))
|
||||||
{
|
{
|
||||||
if(vMod.Slot == 18 || vMod.Slot == 22)
|
if(vMod.Slot == 18)
|
||||||
{
|
{
|
||||||
veh.SetSharedData("mod" + vMod.Slot, true);
|
veh.SetSharedData("mod" + vMod.Slot, true);
|
||||||
}
|
}
|
||||||
veh.SetMod(vMod.Slot, vMod.ModId - 1);
|
else if(vMod.Slot == 22)
|
||||||
|
{
|
||||||
|
int color = vMod.ModId - 2;
|
||||||
|
if (vMod.ModId == 0) color = -1;
|
||||||
|
if (vMod.ModId == 1) color = 13;
|
||||||
|
veh.SetSharedData("headlightColor", color);
|
||||||
|
}
|
||||||
|
else veh.SetMod(vMod.Slot, vMod.ModId - 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -83,13 +89,24 @@ namespace reallife_gamemode.Server.Managers
|
|||||||
Vehicle pV = player.Vehicle;
|
Vehicle pV = player.Vehicle;
|
||||||
if (index == 0) index--;
|
if (index == 0) index--;
|
||||||
|
|
||||||
if(slot != 18 && slot != 22)
|
if(slot != 18)
|
||||||
{
|
{
|
||||||
pV.SetMod(slot, index - 1);
|
if(slot == 22)
|
||||||
|
{
|
||||||
|
int color = index - 2;
|
||||||
|
if (index == 0) color = -1;
|
||||||
|
if (index == 1) color = 13;
|
||||||
|
pV.SetSharedData("headlightColor", color);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pV.SetMod(slot, index - 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
bool newVal = index == -1 ? false : true;
|
bool newVal = index == -1 ? false : true;
|
||||||
|
NAPI.Util.ConsoleOutput("Setting turbo to: " + newVal.ToString());
|
||||||
pV.SetSharedData("mod" + slot, newVal);
|
pV.SetSharedData("mod" + slot, newVal);
|
||||||
NAPI.ClientEvent.TriggerClientEventForAll("vehicleToggleMod", pV, slot, newVal);
|
NAPI.ClientEvent.TriggerClientEventForAll("vehicleToggleMod", pV, slot, newVal);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,53 @@ namespace reallife_gamemode.Server.Managers
|
|||||||
{
|
{
|
||||||
private static readonly List<string> _enabledMods = new List<string>()
|
private static readonly List<string> _enabledMods = new List<string>()
|
||||||
{
|
{
|
||||||
"polamggtr"
|
"polamggtr",
|
||||||
|
"impaler3",
|
||||||
|
"monster4",
|
||||||
|
"monster5",
|
||||||
|
"slamvan6",
|
||||||
|
"issi6",
|
||||||
|
"cerberus2",
|
||||||
|
"cerberus3",
|
||||||
|
"deathbike2",
|
||||||
|
"dominator6",
|
||||||
|
"deathbike3",
|
||||||
|
"impaler4",
|
||||||
|
"slamvan4",
|
||||||
|
"slamvan5",
|
||||||
|
"brutus",
|
||||||
|
"brutus2",
|
||||||
|
"brutus3",
|
||||||
|
"deathbike",
|
||||||
|
"dominator4",
|
||||||
|
"dominator5",
|
||||||
|
"bruiser",
|
||||||
|
"bruiser2",
|
||||||
|
"bruiser3",
|
||||||
|
"rcbandito",
|
||||||
|
"italigto",
|
||||||
|
"cerberus",
|
||||||
|
"impaler2",
|
||||||
|
"monster3",
|
||||||
|
"tulip",
|
||||||
|
"scarab",
|
||||||
|
"scarab2",
|
||||||
|
"scarab3",
|
||||||
|
"issi4",
|
||||||
|
"issi5",
|
||||||
|
"clique",
|
||||||
|
"deveste",
|
||||||
|
"vamos",
|
||||||
|
"imperator",
|
||||||
|
"imperator2",
|
||||||
|
"imperator3",
|
||||||
|
"toros",
|
||||||
|
"deviant",
|
||||||
|
"schlagen",
|
||||||
|
"impaler",
|
||||||
|
"zr380",
|
||||||
|
"zr3802",
|
||||||
|
"zr3803"
|
||||||
};
|
};
|
||||||
|
|
||||||
private static Dictionary<int, NetHandle> _serverVehicles = new Dictionary<int, NetHandle>();
|
private static Dictionary<int, NetHandle> _serverVehicles = new Dictionary<int, NetHandle>();
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
||||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||||
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
|
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
|
||||||
|
<Platforms>AnyCPU;x64</Platforms>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Remove="meta.xml" />
|
<None Remove="meta.xml" />
|
||||||
@@ -31,6 +32,7 @@
|
|||||||
</Reference>
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Folder Include="Client\dlcpacks\polamggtr\" />
|
||||||
<Folder Include="Migrations\" />
|
<Folder Include="Migrations\" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition="'$(ConfigurationName)' == 'Debug'">
|
<Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition="'$(ConfigurationName)' == 'Debug'">
|
||||||
|
|||||||
Reference in New Issue
Block a user