[Fixed]ManiaScript Players.cp not emptied onPlayerStart
Posted: 13 Feb 2014, 22:45
Hi, we stumbled on another strange thing today when we played on a map with no checkpoints.
When we first start the track the Player.CurRace.Checkpoints table is empty for each player. Once we finish the map the Player.CurRace.Checkpoints of the player which has the manialink is reseted but it isn't reseted for any other players.
SO we are using this technique to catch player checkpoints : http://forum.maniaplanet.com/viewtopic. ... 10#p200391
The code we uses looks like this.
In this situation as the Player.CurRace.Checkpoints isn't reseted the lastCp is always == Player.CurRace.Checkpoints for all the players expect the one who owns the window.
Here is my logs when playing
and the logs of undef
We were on the same server playing together so we should have had aproximettely the same thing. BUt we can see that I have never the LR: undef.de: Current CP: 0 of 1 and undef never has the LR: oliverde8: Current CP: 0 of 1
So for undef my checkpoints are never reseted
and for me his checkpoints.
So the code just blocks thinking the players doesn't pass through the finish.
Thanks
When we first start the track the Player.CurRace.Checkpoints table is empty for each player. Once we finish the map the Player.CurRace.Checkpoints of the player which has the manialink is reseted but it isn't reseted for any other players.
SO we are using this technique to catch player checkpoints : http://forum.maniaplanet.com/viewtopic. ... 10#p200391
The code we uses looks like this.
Code: Select all
foreach (Player in Players) {
declare lastCp for Player = -1;
if (lastCp != Player.CurRace.Checkpoints.count) {
lastCp = Player.CurRace.Checkpoints.count;
if (lastCp > 0 && lastCp % (totalCp) == 0 && totalCp > acceptMinCp) {
//DO stuff
}
}
}
Here is my logs when playing
Code: Select all
LR: oliverde8: Current CP: 1 of 1 on lap 0, CP-Times: [8626]
LR: undef.de: Current CP: 1 of 1 on lap 0, CP-Times: [9536]
LR: reaby: Current CP: 1 of 1 on lap 0, CP-Times: [13597]
LR: oliverde8: Current CP: 0 of 1 on lap 0, CP-Times: []
LR: oliverde8: Current CP: 1 of 1 on lap 0, CP-Times: [7439]
LR: oliverde8: Current CP: 0 of 1 on lap 0, CP-Times: []
Code: Select all
LR: undef.de: Current CP: 0 of 1 on lap 0, CP-Times: []
LR: reaby: Current CP: 0 of 1 on lap 0, CP-Times: []
LR: oliverde8: Current CP: 0 of 1 on lap 0, CP-Times: []
LR: oliverde8: Current CP: 1 of 1 on lap 0, CP-Times: [8626]
LR: undef.de: Current CP: 1 of 1 on lap 0, CP-Times: [9536]
LR: reaby: Current CP: 1 of 1 on lap 0, CP-Times: [13597]
LR: undef.de: Current CP: 0 of 1 on lap 0, CP-Times: []
LR: undef.de: Current CP: 1 of 1 on lap 0, CP-Times: [7930]
LR: undef.de: Current CP: 0 of 1 on lap 0, CP-Times: []
LR: undef.de: Current CP: 1 of 1 on lap 0, CP-Times: [215797]
LR: undef.de: Current CP: 0 of 1 on lap 0, CP-Times: []
LR: undef.de: Current CP: 1 of 1 on lap 0, CP-Times: [8028]
LR: undef.de: Current CP: 0 of 1 on lap 0, CP-Times: []
So for undef my checkpoints are never reseted
and for me his checkpoints.
So the code just blocks thinking the players doesn't pass through the finish.
Thanks