How to fix rRace System: "Race Position". - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How to fix rRace System: "Race Position". (
/showthread.php?tid=405077)
How to fix rRace System: "Race Position". -
Edvin - 05.01.2013
Hi guys
I have edited a lot ryder's race system, but still i have that bug with incorect position, when i race. Sometimes, it shows me good, but sometimes, shows me like this:
or
This is the variable, what show my position in race:
Код:
RacePosition[ playerid ] = floatround( CPCoords[ CPProgess[ playerid ] ][ 3 ], floatround_floor );
I tried to fix this, by reseting CPProgess variable for all players, when a race stops, but don't work. Someone know how to fix this issue?
Thanks.
Re: How to fix rRace System: "Race Position". -
exclide1 - 04.07.2013
I might as well bump this one, because I stumbled into the same problem. RacePosition variable just keeps increasing with every new race. Any ideas?
Or at least can someone explain me how does it get race position from just this one line under OnPlayerEnterRaceCheckpoint?
RacePosition[playerid] = floatround(CPCoords[CPProgess[playerid]][3], floatround_floor);
EDIT: Still not quite understanding how it works, but this fixed it under LoadRace(), but before reading the race files:
Код:
for(new i;i<MAX_RACE_CHECKPOINTS_EACH_RACE;i++)
{
CPCoords[i][0]=0.0;
CPCoords[i][1]=0.0;
CPCoords[i][2]=0.0;
CPCoords[i][3]=0.0;
}
for(new i = 0; i < MAX_PLAYERS; i++)
{
CPProgess[i] = 0;
CPCoords[i][3] = 0;
}
Re: How to fix rRace System: "Race Position". -
dr1ftp0w3r - 14.01.2014
I did that and now /startautorace says command doesn't exist.
EDT: Actually that loop fixed the problem but I had to put it in stoprace.
Re: How to fix rRace System: "Race Position". -
]Rafaellos[ - 14.01.2014
Maybe this happens because you edit it? Try to create your own, it will be easier, and you will be able to fix any kind of bug.