Änderung Busfahrer/Pilot Bugs fix siehe Forenbeitrag
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using ReallifeGamemode.Server.Services;
|
||||
using GTANetworkAPI;
|
||||
using System.Linq;
|
||||
@@ -87,7 +87,7 @@ namespace ReallifeGamemode.Server.Util
|
||||
NAPI.Task.Run(() =>
|
||||
{
|
||||
BusCheckpoint(user);
|
||||
}, delayTime: 3850);
|
||||
}, delayTime: 3250);
|
||||
}
|
||||
if (!(veh.GetData<IndicatorData>("indicatorData") is IndicatorData data)) data = new IndicatorData();
|
||||
data.Left = false;
|
||||
@@ -135,13 +135,13 @@ namespace ReallifeGamemode.Server.Util
|
||||
if ((VehicleHash)veh.Model == VehicleHash.Tourbus)
|
||||
{
|
||||
user.TriggerEvent("CLIENT:PlaySound", "jobs/busfahrer/AbfahrtHaltestelleTourbus", "wav", 25);
|
||||
user.TriggerEvent("CLIENT:SetDoorShutDelayed", 3, false, 2100);
|
||||
user.TriggerEvent("CLIENT:SetDoorShutDelayed", 2, false, 2100);
|
||||
user.TriggerEvent("CLIENT:SetDoorShutDelayed", 3, false, 2100);
|
||||
user.TriggerEvent("CLIENT:SetDoorShutDelayed", 3, false, 2600);
|
||||
user.TriggerEvent("CLIENT:SetDoorShutDelayed", 2, false, 2600);
|
||||
user.TriggerEvent("CLIENT:SetDoorShutDelayed", 3, false, 2600);
|
||||
NAPI.Task.Run(() =>
|
||||
{
|
||||
user.TriggerEvent("CLIENT:UnFreezeVehicle", veh);
|
||||
}, delayTime: 2100);
|
||||
}, delayTime: 2600);
|
||||
}
|
||||
//user.TriggerEvent("CLIENT:UnFreezeVehicle", veh);
|
||||
}
|
||||
@@ -225,7 +225,7 @@ namespace ReallifeGamemode.Server.Util
|
||||
{
|
||||
LastCheckpoint = 0;
|
||||
Vector3 nextCp = list.ElementAt(checkPointsDone);
|
||||
this.player.TriggerEvent("setCheckPoint", nextCp, player, this.checkPointsDone, delay, this.markerID, this.markerSize, this.markerDist, this.eventInCheckpoint);
|
||||
this.player.TriggerEvent("setCheckPoint", nextCp, player, this.checkPointsDone, delay, this.markerID, this.markerSize, this.markerDist, this.useVehicle, this.eventInCheckpoint);
|
||||
}
|
||||
if (checkPointsDone == this.list.Count()-1)
|
||||
{
|
||||
|
||||
38
ReallifeGamemode.Server/Util/PlayerTimer.cs
Normal file
38
ReallifeGamemode.Server/Util/PlayerTimer.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Timers;
|
||||
using GTANetworkAPI;
|
||||
|
||||
namespace ReallifeGamemode.Server.Util
|
||||
{
|
||||
public class PlayerTimer
|
||||
{
|
||||
private readonly Player player;
|
||||
private readonly Vehicle veh;
|
||||
private readonly Timer timer;
|
||||
|
||||
public delegate void PlayerTimerElapsed(Player player, Vehicle veh);
|
||||
public event PlayerTimerElapsed Elapsed;
|
||||
|
||||
public PlayerTimer(Player player, Vehicle veh = null, int milliseconds = 1000)
|
||||
{
|
||||
this.player = player;
|
||||
this.veh = veh;
|
||||
|
||||
this.timer = new Timer(milliseconds);
|
||||
this.timer.Elapsed += Timer_Elapsed;
|
||||
this.timer.Start();
|
||||
}
|
||||
|
||||
private void Timer_Elapsed(object sender, ElapsedEventArgs e)
|
||||
{
|
||||
Elapsed?.Invoke(player, veh);
|
||||
}
|
||||
|
||||
public void Stop()
|
||||
{
|
||||
this.timer.Stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user