Re: Catching the checkpoint event does not work (for me)
Posted: 17 Jan 2014, 14:57
One way to know if a player crossed a checkpoint directly from a Manialink script without communicating directly with the server would be to do something like that:
Code: Select all
<script><!--
main() {
while (True) {
yield;
if (!PageIsVisible || InputPlayer == Null) continue;
foreach (Player in Players) {
declare PrevCheckpointCount for Player = -1;
if (PrevCheckpointCount != Player.CurRace.Checkpoints.count) {
PrevCheckpointCount = Player.CurRace.Checkpoints.count;
// A player crossed a checkpoint, do something now !
}
}
}
}
--></script>