[*] Improvements on both Driving and Flight School
This commit is contained in:
@@ -7,10 +7,10 @@ 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, int delay, int markerID, string nEvent)
|
||||
public static void StartCheckPointRoute(Client player, IEnumerable<Vector3> nListCps, int delay, int markerID, int markerSize, string nEvent)
|
||||
{
|
||||
RemovePlayerHandlerFromList(player);
|
||||
CheckPointListForPlayer playerHandle = new CheckPointListForPlayer(player, nListCps, delay, markerID, nEvent);
|
||||
CheckPointListForPlayer playerHandle = new CheckPointListForPlayer(player, nListCps, delay, markerID, markerSize, nEvent);
|
||||
listHandle.Add(playerHandle);
|
||||
|
||||
playerHandle.StartRoute();
|
||||
@@ -50,23 +50,25 @@ namespace ReallifeGamemode.Server.Util
|
||||
public Client player;
|
||||
public int delay = 0;
|
||||
public int markerID;
|
||||
public int markerSize;
|
||||
public string eventInCheckpoint = "";
|
||||
|
||||
int checkPointsDone = 0;
|
||||
|
||||
public CheckPointListForPlayer(Client nPlayer, IEnumerable<Vector3> nList, int nDelay, int nMarkerID, string nEvent)
|
||||
public CheckPointListForPlayer(Client nPlayer, IEnumerable<Vector3> nList, int nDelay, int nMarkerID, int nMarkerSize, string nEvent)
|
||||
{
|
||||
this.player = nPlayer;
|
||||
this.list = nList;
|
||||
this.delay = nDelay;
|
||||
this.markerID = nMarkerID;
|
||||
this.markerSize = nMarkerSize;
|
||||
this.eventInCheckpoint = nEvent;
|
||||
this.checkPointsDone = 0;
|
||||
}
|
||||
|
||||
public void StartRoute()
|
||||
{
|
||||
player.TriggerEvent("setCheckPoint", this.list.ElementAt(0), player, 0, this.delay, this.markerID, this.eventInCheckpoint);
|
||||
player.TriggerEvent("setCheckPoint", this.list.ElementAt(0), player, 0, this.delay, this.markerID, this.markerSize, this.eventInCheckpoint);
|
||||
}
|
||||
public void NextCheckpoint()
|
||||
{
|
||||
@@ -74,12 +76,10 @@ namespace ReallifeGamemode.Server.Util
|
||||
if (this.list.Count() > checkPointsDone)
|
||||
{
|
||||
Vector3 nextCp = list.ElementAt(checkPointsDone);
|
||||
this.player.TriggerEvent("setCheckPoint", nextCp, player, this.checkPointsDone, delay, this.markerID, this.eventInCheckpoint);
|
||||
this.player.TriggerEvent("setCheckPoint", nextCp, player, this.checkPointsDone, delay, this.markerID, this.markerSize, this.eventInCheckpoint);
|
||||
}
|
||||
if (this.list.Count() == checkPointsDone)
|
||||
{
|
||||
ChatService.SendMessage(this.player, "Du hast alle Checkpoints abgefahren!");
|
||||
|
||||
{
|
||||
CheckPointHandle.RemovePlayerHandlerFromList(this.player);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user