more functionality in bus system
This commit is contained in:
@@ -10,7 +10,6 @@ export default function checkpointHandle(globalData: GlobalData) {
|
|||||||
var inCheckpoint = false;
|
var inCheckpoint = false;
|
||||||
|
|
||||||
mp.events.add('setCheckPoint', (position, player) => {
|
mp.events.add('setCheckPoint', (position, player) => {
|
||||||
mp.gui.chat.push("jaha");
|
|
||||||
inCheckpoint = false;
|
inCheckpoint = false;
|
||||||
posCp = position;
|
posCp = position;
|
||||||
Player = player;
|
Player = player;
|
||||||
|
|||||||
@@ -22,11 +22,22 @@ namespace ReallifeGamemode.Server.Util
|
|||||||
|
|
||||||
playerHandle.startRoute();
|
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")]
|
[RemoteEvent("playerInCheckpoint")]
|
||||||
public void playerInCheckpoint(Client user)
|
public void playerInCheckpoint(Client user)
|
||||||
{
|
{
|
||||||
ChatService.Broadcast("neuer cp");
|
|
||||||
checkPointListForPlayer temp = null;
|
checkPointListForPlayer temp = null;
|
||||||
for (int a = 0; a < listHandle.Count; a++)
|
for (int a = 0; a < listHandle.Count; a++)
|
||||||
{
|
{
|
||||||
@@ -39,6 +50,7 @@ namespace ReallifeGamemode.Server.Util
|
|||||||
|
|
||||||
temp.nextCheckpoint();
|
temp.nextCheckpoint();
|
||||||
|
|
||||||
|
ChatService.Broadcast("neuer cp");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public class checkPointListForPlayer
|
public class checkPointListForPlayer
|
||||||
@@ -69,7 +81,11 @@ namespace ReallifeGamemode.Server.Util
|
|||||||
ChatService.SendMessage(this.player, "cp set at " + nextCp.ToString());
|
ChatService.SendMessage(this.player, "cp set at " + nextCp.ToString());
|
||||||
this.player.TriggerEvent("setCheckPoint", nextCp, player);
|
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