more functionality in bus system

This commit is contained in:
2019-09-12 18:41:22 +02:00
parent 5ea2487b29
commit 774129c01c
2 changed files with 18 additions and 3 deletions

View File

@@ -22,11 +22,22 @@ namespace ReallifeGamemode.Server.Util
playerHandle.startRoute();
}
public static void removePlayerHandlerFromList(Client player)
{
checkPointListForPlayer temp = null;
for (int a = 0; a < listHandle.Count; a++)
{
temp = listHandle[a];
if (temp.player == player)
{
listHandle.Remove(temp);
}
}
}
[RemoteEvent("playerInCheckpoint")]
public void playerInCheckpoint(Client user)
{
ChatService.Broadcast("neuer cp");
checkPointListForPlayer temp = null;
for (int a = 0; a < listHandle.Count; a++)
{
@@ -39,6 +50,7 @@ namespace ReallifeGamemode.Server.Util
temp.nextCheckpoint();
ChatService.Broadcast("neuer cp");
}
}
public class checkPointListForPlayer
@@ -69,7 +81,11 @@ namespace ReallifeGamemode.Server.Util
ChatService.SendMessage(this.player, "cp set at " + nextCp.ToString());
this.player.TriggerEvent("setCheckPoint", nextCp, player);
}
if (this.list.Count == checkPointsDone)
{
ChatService.SendMessage(this.player, "Du hast alle Checkpoints abgefahren!");
CheckPointHandle.removePlayerHandlerFromList(this.player);
}
}
}
}