more functionality in bus system
This commit is contained in:
@@ -10,7 +10,6 @@ export default function checkpointHandle(globalData: GlobalData) {
|
||||
var inCheckpoint = false;
|
||||
|
||||
mp.events.add('setCheckPoint', (position, player) => {
|
||||
mp.gui.chat.push("jaha");
|
||||
inCheckpoint = false;
|
||||
posCp = position;
|
||||
Player = player;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user