fix servercrash taxifahrer
This commit is contained in:
@@ -33,6 +33,13 @@ export default function taximeterInput(globalData: IGlobalData) {
|
|||||||
myVar = setInterval(myTimer, 100);
|
myVar = setInterval(myTimer, 100);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
mp.events.add('CLIENT:stopFare', () => {
|
||||||
|
browser.destroy()
|
||||||
|
browser = null;
|
||||||
|
globalData.InInput = false;
|
||||||
|
return;
|
||||||
|
});
|
||||||
|
|
||||||
function myTimer() {
|
function myTimer() {
|
||||||
if (totalPrice == lastPrice) return;
|
if (totalPrice == lastPrice) return;
|
||||||
let payPrice = +totalPrice - +lastPrice;
|
let payPrice = +totalPrice - +lastPrice;
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ export default function (globalData: IGlobalData) {
|
|||||||
mp.events.callRemote("CLIENT:Job_StartJob");
|
mp.events.callRemote("CLIENT:Job_StartJob");
|
||||||
} else if (index === 1) { // Job stoppen
|
} else if (index === 1) { // Job stoppen
|
||||||
mp.events.callRemote("CLIENT:Job_StopJob");
|
mp.events.callRemote("CLIENT:Job_StopJob");
|
||||||
|
mp.events.callRemote("CLIENT:stopFare");
|
||||||
} else {
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,7 +47,9 @@ namespace ReallifeGamemode.Server.Job
|
|||||||
|
|
||||||
private void TaxiDriverJobJobStop(Player player)
|
private void TaxiDriverJobJobStop(Player player)
|
||||||
{
|
{
|
||||||
// player.Vehicle.SetSharedData("vehicleTaxiLight", false);
|
if (!player.IsInVehicle)
|
||||||
|
return;
|
||||||
|
player.Vehicle.SetSharedData("vehicleTaxiLight", false);
|
||||||
int Id = player.GetUser().Id;
|
int Id = player.GetUser().Id;
|
||||||
player.ResetData("DriverPrice");
|
player.ResetData("DriverPrice");
|
||||||
Vehicle v = player.Vehicle;
|
Vehicle v = player.Vehicle;
|
||||||
@@ -105,7 +107,8 @@ namespace ReallifeGamemode.Server.Job
|
|||||||
if (u.JobId != 1) return;
|
if (u.JobId != 1) return;
|
||||||
if (!player.HasData("hasPassager")) { player.SetData<bool>("hasPassager", false); continue; }
|
if (!player.HasData("hasPassager")) { player.SetData<bool>("hasPassager", false); continue; }
|
||||||
int playerId = player.GetUser().Id;
|
int playerId = player.GetUser().Id;
|
||||||
|
if (player.IsInVehicle)
|
||||||
|
{
|
||||||
Vehicle v = player.Vehicle;
|
Vehicle v = player.Vehicle;
|
||||||
Vector3 lastPosition = v.Position;
|
Vector3 lastPosition = v.Position;
|
||||||
if (lastPositions.ContainsKey(v.Handle)) lastPosition = lastPositions[v.Handle];
|
if (lastPositions.ContainsKey(v.Handle)) lastPosition = lastPositions[v.Handle];
|
||||||
@@ -122,3 +125,4 @@ namespace ReallifeGamemode.Server.Job
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -274,7 +274,9 @@ namespace ReallifeGamemode.Server.Managers
|
|||||||
{
|
{
|
||||||
if (player.GetUser().JobId == 1)//Taxifahrer
|
if (player.GetUser().JobId == 1)//Taxifahrer
|
||||||
{
|
{
|
||||||
//VehicleManager.DeleteVehicle(v);
|
player.TriggerEvent("CLIENT:stopFare");
|
||||||
|
player.Position = new Vector3(-628.598388671875, -2107.609130859375, 6.072586536407471);
|
||||||
|
player.Heading = (-171.50303649902344f);
|
||||||
}
|
}
|
||||||
if (player.GetUser().JobId == 2)//Müllmann
|
if (player.GetUser().JobId == 2)//Müllmann
|
||||||
{
|
{
|
||||||
@@ -327,11 +329,12 @@ namespace ReallifeGamemode.Server.Managers
|
|||||||
}
|
}
|
||||||
|
|
||||||
job.StopJob(player);
|
job.StopJob(player);
|
||||||
/*if (player.GetUser().JobId == 1)//Taxifahrer
|
if (player.GetUser().JobId == 1)//Taxifahrer
|
||||||
{
|
{
|
||||||
player.Position = new Vector3(-628.598388671875, -2107.609130859375, 6.072586536407471);
|
player.Position = new Vector3(-628.598388671875, -2107.609130859375, 6.072586536407471);
|
||||||
player.Heading = (-171.50303649902344f);
|
player.Heading = (-171.50303649902344f);
|
||||||
}*/
|
|
||||||
|
}
|
||||||
if (player.GetUser().JobId == 2)//Müllmann
|
if (player.GetUser().JobId == 2)//Müllmann
|
||||||
{
|
{
|
||||||
player.Position = new Vector3(485.4114685058594, -2173.25, 5.918273448944092);
|
player.Position = new Vector3(485.4114685058594, -2173.25, 5.918273448944092);
|
||||||
|
|||||||
Reference in New Issue
Block a user