Catching the checkpoint event does not work (for me)

You can talk about ManiaScript for ManiaPlanet here

Moderator: English Moderator

User avatar
Eole
Nadeo
Nadeo
Posts: 1265
Joined: 26 Apr 2011, 21:08

Re: Catching the checkpoint event does not work (for me)

Post by Eole »

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>
Contribute to the ManiaPlanet documentation on GitHub
A question about ManiaScript? Ask it here!
User avatar
undef.de
Posts: 2095
Joined: 06 Apr 2011, 21:57
Location: Germany, North Sea Coast
Contact:

Re: Catching the checkpoint event does not work (for me)

Post by undef.de »

Eole wrote: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:
Yes... it works and was all i need! 1000x THANKS dude! :thx:
Developer of UASECO, a controller with support of the Modescript Gamemodes for TM².
Visit the official website for more: UASECO.org


Developer of various plugins for XAseco/XAseco2 and MPAseco, visit my lab: www.undef.name

You like what I do? Then award a ManiaStar.
Post Reply

Return to “ManiaScript”

Who is online

Users browsing this forum: No registered users and 1 guest