Fix E-Job Starten
This commit is contained in:
@@ -1,6 +1,9 @@
|
|||||||
import { VehicleSeat } from "../game";
|
import { VehicleSeat } from "../game";
|
||||||
|
|
||||||
export default function () {
|
export default function () {
|
||||||
|
|
||||||
|
var TorqueEntity
|
||||||
|
var TorqueValue = 1;
|
||||||
mp.events.addDataHandler("vehicleAdminSpeed", (entity, newValue) => {
|
mp.events.addDataHandler("vehicleAdminSpeed", (entity, newValue) => {
|
||||||
if (!entity.isAVehicle()) return;
|
if (!entity.isAVehicle()) return;
|
||||||
entity.setEnginePowerMultiplier(newValue);
|
entity.setEnginePowerMultiplier(newValue);
|
||||||
@@ -9,7 +12,13 @@ export default function () {
|
|||||||
mp.events.addDataHandler("vehicleAdminSpeed2", (entity, newValue2) => {
|
mp.events.addDataHandler("vehicleAdminSpeed2", (entity, newValue2) => {
|
||||||
if (!entity.isAVehicle()) return;
|
if (!entity.isAVehicle()) return;
|
||||||
mp.gui.chat.push("Debug1");
|
mp.gui.chat.push("Debug1");
|
||||||
entity.setEngineTorqueMultiplier(newValue2);
|
//entity.setEngineTorqueMultiplier(newValue2);
|
||||||
|
TorqueEntity = entity;
|
||||||
|
TorqueValue = newValue2;
|
||||||
mp.gui.chat.push("Debug2");
|
mp.gui.chat.push("Debug2");
|
||||||
});
|
});
|
||||||
|
/*mp.events.add('render', () => {
|
||||||
|
let vehicle = mp.players.local.vehicle;
|
||||||
|
vehicle.setEngineTorqueMultiplier(1.5); // Multiplies by 1.5 the engine torque
|
||||||
|
});*/
|
||||||
}
|
}
|
||||||
@@ -2684,11 +2684,11 @@ namespace ReallifeGamemode.Server.Commands
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (modifier < 0)
|
/*if (modifier < 0)
|
||||||
{
|
{
|
||||||
ChatService.ErrorMessage(player, "Es muss positives Adminspeed angegeben werden");
|
ChatService.ErrorMessage(player, "Es muss positives Adminspeed angegeben werden");
|
||||||
return;
|
return;
|
||||||
}
|
}*/
|
||||||
|
|
||||||
player.Vehicle.SetSharedData("vehicleAdminSpeed", modifier);
|
player.Vehicle.SetSharedData("vehicleAdminSpeed", modifier);
|
||||||
player.Vehicle.SetSharedData("vehicleAdminSpeed2", modifier2);
|
player.Vehicle.SetSharedData("vehicleAdminSpeed2", modifier2);
|
||||||
|
|||||||
@@ -21,6 +21,8 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
[ServerEvent(Event.PlayerConnected)]
|
[ServerEvent(Event.PlayerConnected)]
|
||||||
public void OnPlayerConnected(Player player)
|
public void OnPlayerConnected(Player player)
|
||||||
{
|
{
|
||||||
|
player.TriggerEvent("CLIENT:StopSound");
|
||||||
|
//player.SetSharedData("vehicleAdminSpeed2", 1.0);
|
||||||
player.SetData("isLoggedIn", false);
|
player.SetData("isLoggedIn", false);
|
||||||
player.Position = new Vector3(-1883.736, -781.4911, -10);
|
player.Position = new Vector3(-1883.736, -781.4911, -10);
|
||||||
|
|
||||||
|
|||||||
@@ -172,17 +172,17 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
if (!player.IsLoggedIn()) return;
|
if (!player.IsLoggedIn()) return;
|
||||||
var user = player.GetUser();
|
var user = player.GetUser();
|
||||||
|
|
||||||
|
ElevatorPoint nearestElevatorPoint = PositionManager.ElevatorPoints.Find(e => e.Position.DistanceTo(player.Position) <= 1.5 && (user.FactionId == 1 || user.FactionId == 3));
|
||||||
|
ClotheshopPoint nearestClotheShopPoint = PositionManager.clotheshopPoints.Find(s => s.Position.DistanceTo(player.Position) <= 1.5 && (!user.GetData<bool>("duty")));
|
||||||
|
|
||||||
|
ItemshopPoint nearestItemShopPoint = PositionManager.itemshopPoints.Find(s => s.Position.DistanceTo(player.Position) <= 1.5);
|
||||||
|
JobPoint nearestJobPoint = PositionManager.JobPoints.Find(s => s.Position.DistanceTo(player.Position) <= 1.5);
|
||||||
|
|
||||||
if (user?.FactionId != null)
|
if (user?.FactionId != null)
|
||||||
{
|
{
|
||||||
DutyPoint nearestDuty = PositionManager.DutyPoints.Find(d => d.Position.DistanceTo(player.Position) <= 1.5 && d.FactionId == user.FactionId);
|
DutyPoint nearestDuty = PositionManager.DutyPoints.Find(d => d.Position.DistanceTo(player.Position) <= 1.5 && d.FactionId == user.FactionId);
|
||||||
WeaponPoint nearestWeapon = PositionManager.WeaponPoints.Find(w => w.Position.DistanceTo(player.Position) <= 1.5 && w.FactionId == user.FactionId);
|
WeaponPoint nearestWeapon = PositionManager.WeaponPoints.Find(w => w.Position.DistanceTo(player.Position) <= 1.5 && w.FactionId == user.FactionId);
|
||||||
JailReleasePoint nearestJailReleasePoint = PositionManager.JailReleasePoints.Find(j => j.Position.DistanceTo(player.Position) <= 1.5 && (user.FactionId == 1 || user.FactionId == 3) && user.GetData<bool>("duty"));
|
JailReleasePoint nearestJailReleasePoint = PositionManager.JailReleasePoints.Find(j => j.Position.DistanceTo(player.Position) <= 1.5 && (user.FactionId == 1 || user.FactionId == 3) && user.GetData<bool>("duty"));
|
||||||
ElevatorPoint nearestElevatorPoint = PositionManager.ElevatorPoints.Find(e => e.Position.DistanceTo(player.Position) <= 1.5 && (user.FactionId == 1 || user.FactionId == 3));
|
|
||||||
ClotheshopPoint nearestClotheShopPoint = PositionManager.clotheshopPoints.Find(s => s.Position.DistanceTo(player.Position) <= 1.5 && (!user.GetData<bool>("duty")));
|
|
||||||
|
|
||||||
ItemshopPoint nearestItemShopPoint = PositionManager.itemshopPoints.Find(s => s.Position.DistanceTo(player.Position) <= 1.5);
|
|
||||||
JobPoint nearestJobPoint = PositionManager.JobPoints.Find(s => s.Position.DistanceTo(player.Position) <= 1.5);
|
|
||||||
|
|
||||||
|
|
||||||
if (nearestDuty != null)// Duty Point
|
if (nearestDuty != null)// Duty Point
|
||||||
@@ -262,62 +262,7 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
UpdateCharacterCloth.LoadCharacterDefaults(player);
|
UpdateCharacterCloth.LoadCharacterDefaults(player);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (nearestJobPoint != null)
|
|
||||||
{
|
|
||||||
Job.JobBase job = JobManager.GetJob(player.GetUser().JobId.Value);
|
|
||||||
JobManager jobb = new JobManager();
|
|
||||||
if (nearestJobPoint.jobId != 3 && nearestJobPoint.jobId == player.GetUser().JobId)
|
|
||||||
{
|
|
||||||
if (job.GetUsersInJob().Contains(player))
|
|
||||||
{
|
|
||||||
jobb.StopJob(player);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!job.GetUsersInJob().Contains(player))
|
|
||||||
{
|
|
||||||
jobb.StartJobEvent(player);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (nearestJobPoint.jobId == 3 && player.GetUser().JobId == 3)
|
|
||||||
{
|
|
||||||
if (nearestJobPoint.Skill < 300 && player.GetUser().PilotSkill < 300)
|
|
||||||
{
|
|
||||||
if (job.GetUsersInJob().Contains(player))
|
|
||||||
{
|
|
||||||
jobb.StopJob(player);
|
|
||||||
user.SetData("PilotenBase2", false);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!job.GetUsersInJob().Contains(player))
|
|
||||||
{
|
|
||||||
jobb.StartJobEvent(player);
|
|
||||||
user.SetData("PilotenBase2", false);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (nearestJobPoint.Skill >= 300 && player.GetUser().PilotSkill >= 300)
|
|
||||||
{
|
|
||||||
if (job.GetUsersInJob().Contains(player))
|
|
||||||
{
|
|
||||||
jobb.StopJob(player);
|
|
||||||
user.SetData("PilotenBase2", false);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!job.GetUsersInJob().Contains(player))
|
|
||||||
{
|
|
||||||
jobb.StartJobEvent(player);
|
|
||||||
user.SetData("PilotenBase2", true);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
player.SendChatMessage("~y~[JOB] ~r~Dein Skilllevel ist noch zu niedrig.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (nearestWeapon != null) // Weapon Point
|
if (nearestWeapon != null) // Weapon Point
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -404,29 +349,85 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
}
|
}
|
||||||
player.TriggerEvent("showJailMenu", JsonConvert.SerializeObject(criminals.ToArray()));
|
player.TriggerEvent("showJailMenu", JsonConvert.SerializeObject(criminals.ToArray()));
|
||||||
}
|
}
|
||||||
if (nearestElevatorPoint != null)
|
}
|
||||||
|
if (nearestElevatorPoint != null)
|
||||||
|
{
|
||||||
|
List<string> stages = new List<string>();
|
||||||
|
foreach (var e in PositionManager.ElevatorPoints)
|
||||||
{
|
{
|
||||||
List<string> stages = new List<string>();
|
if (e.Position.DistanceTo2D(player.Position) <= 25 && e.Position.DistanceTo(player.Position) > 1.5)
|
||||||
foreach (var e in PositionManager.ElevatorPoints)
|
|
||||||
{
|
{
|
||||||
if (e.Position.DistanceTo2D(player.Position) <= 25 && e.Position.DistanceTo(player.Position) > 1.5)
|
stages.Add(e.Stage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
player.TriggerEvent("showElevatorMenu", JsonConvert.SerializeObject(stages.ToArray()));
|
||||||
|
}
|
||||||
|
if (nearestClotheShopPoint != null)
|
||||||
|
{
|
||||||
|
nearestClotheShopPoint.clotheShop.LoadShopNUI(player);
|
||||||
|
}
|
||||||
|
if (nearestItemShopPoint != null)
|
||||||
|
{
|
||||||
|
nearestItemShopPoint.itemShop.LoadShopNUI(player);
|
||||||
|
}
|
||||||
|
if (user.FactionLeader)
|
||||||
|
{
|
||||||
|
player.TriggerEvent("CLIENT:StartGangwar");
|
||||||
|
}
|
||||||
|
if (nearestJobPoint != null)
|
||||||
|
{
|
||||||
|
Job.JobBase job = JobManager.GetJob(player.GetUser().JobId.Value);
|
||||||
|
JobManager jobb = new JobManager();
|
||||||
|
if (nearestJobPoint.jobId != 3 && nearestJobPoint.jobId == player.GetUser().JobId)
|
||||||
|
{
|
||||||
|
if (job.GetUsersInJob().Contains(player))
|
||||||
|
{
|
||||||
|
jobb.StopJob(player);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!job.GetUsersInJob().Contains(player))
|
||||||
|
{
|
||||||
|
jobb.StartJobEvent(player);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (nearestJobPoint.jobId == 3 && player.GetUser().JobId == 3)
|
||||||
|
{
|
||||||
|
if (nearestJobPoint.Skill < 300 && player.GetUser().PilotSkill < 300)
|
||||||
|
{
|
||||||
|
if (job.GetUsersInJob().Contains(player))
|
||||||
{
|
{
|
||||||
stages.Add(e.Stage);
|
jobb.StopJob(player);
|
||||||
|
user.SetData("PilotenBase2", false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!job.GetUsersInJob().Contains(player))
|
||||||
|
{
|
||||||
|
jobb.StartJobEvent(player);
|
||||||
|
user.SetData("PilotenBase2", false);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
player.TriggerEvent("showElevatorMenu", JsonConvert.SerializeObject(stages.ToArray()));
|
if (nearestJobPoint.Skill >= 300 && player.GetUser().PilotSkill >= 300)
|
||||||
}
|
{
|
||||||
if (nearestClotheShopPoint != null)
|
if (job.GetUsersInJob().Contains(player))
|
||||||
{
|
{
|
||||||
nearestClotheShopPoint.clotheShop.LoadShopNUI(player);
|
jobb.StopJob(player);
|
||||||
}
|
user.SetData("PilotenBase2", false);
|
||||||
if (nearestItemShopPoint != null)
|
return;
|
||||||
{
|
}
|
||||||
nearestItemShopPoint.itemShop.LoadShopNUI(player);
|
if (!job.GetUsersInJob().Contains(player))
|
||||||
}
|
{
|
||||||
if (user.FactionLeader)
|
jobb.StartJobEvent(player);
|
||||||
{
|
user.SetData("PilotenBase2", true);
|
||||||
player.TriggerEvent("CLIENT:StartGangwar");
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
player.SendChatMessage("~y~[JOB] ~r~Dein Skilllevel ist noch zu niedrig.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user