added pilot job

This commit is contained in:
2019-09-16 15:05:23 +02:00
parent d8cddb3411
commit b3d3d4550d
5 changed files with 59 additions and 14 deletions

View File

@@ -15,9 +15,9 @@ namespace ReallifeGamemode.Server.Util
public class CheckPointHandle : Script
{
public static List<CheckPointListForPlayer> listHandle = new List<CheckPointListForPlayer>();
public static void StartCheckPointRoute(Client player, IEnumerable<Vector3> nListCps)
public static void StartCheckPointRoute(Client player, IEnumerable<Vector3> nListCps, int delay, int markerID)
{
CheckPointListForPlayer playerHandle = new CheckPointListForPlayer(player, nListCps);
CheckPointListForPlayer playerHandle = new CheckPointListForPlayer(player, nListCps, delay, markerID);
listHandle.Add(playerHandle);
playerHandle.StartRoute();
@@ -55,21 +55,25 @@ namespace ReallifeGamemode.Server.Util
{
public IEnumerable<Vector3> list = new List<Vector3>();
public Client player;
public int delay = 0;
public int markerID;
Vector3 checkPoint;
bool done;
int checkPointsDone = 0;
public CheckPointListForPlayer(Client nPlayer, IEnumerable<Vector3> nList)
public CheckPointListForPlayer(Client nPlayer, IEnumerable<Vector3> nList, int nDelay, int nMarkerID)
{
this.player = nPlayer;
this.list = nList;
this.delay = nDelay;
this.markerID = nMarkerID;
}
public void StartRoute()
{
player.TriggerEvent("setCheckPoint", this.list.ElementAt(0), player);
player.TriggerEvent("setCheckPoint", this.list.ElementAt(0), player, this.delay, this.markerID);
}
public void NextCheckpoint()
{
@@ -77,7 +81,7 @@ namespace ReallifeGamemode.Server.Util
if (this.list.Count() > checkPointsDone)
{
Vector3 nextCp = list.ElementAt(checkPointsDone);
this.player.TriggerEvent("setCheckPoint", nextCp, player);
this.player.TriggerEvent("setCheckPoint", nextCp, player, this.delay, this.markerID);
}
if (this.list.Count() == checkPointsDone)
{