Fixed tuning issue, added new dlc cars to car list, added command to open tuning menu

This commit is contained in:
hydrant
2018-12-14 18:08:01 +01:00
parent 458c25d074
commit 3fc109ff8b
4 changed files with 70 additions and 11 deletions

View File

@@ -87,9 +87,5 @@ mp.events.add('disableLogin', () => {
}); });
function showCefError(error) { function showCefError(error) {
loginBrowser.execute(`showError(\`` + error + `\`)`); loginBrowser.execute(`showError('${error}')`);
} }
//function isPlayerBanned() {
//}

View File

@@ -6,7 +6,7 @@
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 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];
var carModSlotName = [ var carModSlotName = [
{ Slot: 0, Name: "Spoiler" }, { Slot: 0, Name: "Spoiler" },
@@ -35,6 +35,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" }
]; ];
@@ -220,6 +221,7 @@ mp.events.add("showTuningMenu", () => {
var oldToggleValue; var oldToggleValue;
if (modSlot === 18 || modSlot === 22) { if (modSlot === 18 || modSlot === 22) {
oldToggleValue = localVehicle.isToggleModOn(modSlot); oldToggleValue = localVehicle.isToggleModOn(modSlot);
mp.gui.chat.push("oldToggleValue = " + oldToggleValue.toString());
currentMod = oldToggleValue ? 0 : -1; currentMod = oldToggleValue ? 0 : -1;
} }
var currentModItem; var currentModItem;
@@ -263,7 +265,7 @@ mp.events.add("showTuningMenu", () => {
mp.events.callRemote("setVehicleMod", modSlot, index); mp.events.callRemote("setVehicleMod", modSlot, index);
if (modSlot === 18 || modSlot === 22) { if (modSlot === 18 || modSlot === 22) {
oldToggleValue = index === 0 ? false : true; oldToggleValue = index;
return; return;
} }
@@ -298,8 +300,7 @@ mp.events.add("showTuningMenu", () => {
modMenu.Visible = false; modMenu.Visible = false;
if (modSlot === 18 || modSlot === 22) { if (modSlot === 18 || modSlot === 22) {
oldToggleValue = (oldToggleValue === false) ? 0 : 1; localVehicle.toggleMod(modSlot, !!oldToggleValue);
localVehicle.toggleMod(modSlot, oldToggleValue === 0 ? false : true);
return; return;
} }
localVehicle.setMod(modSlot, currentMod); localVehicle.setMod(modSlot, currentMod);
@@ -452,6 +453,9 @@ function getModName(vehicle, slot, mod) {
case 3: case 3:
realModName = "Rennfederung"; realModName = "Rennfederung";
break; break;
case 4:
realModName = "Wettkampffederung";
break;
} }
} }

View File

@@ -878,7 +878,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))
{ {
@@ -2028,6 +2029,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

View File

@@ -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>();