27.02.2010, 20:44
Hi, I'm making a race filterscript but there's an issue..
Checkpoints: >>
This is the code I'm using in a function (LoadRace) to read the Checkpoints.
When I start the race the first RaceCheckpoint will show perfectly but when I take the checkpoint the next checkpoint will locate at 0.0, 0.0, 0.0.
This is the way I'm using to set the checkpoints under my function to start the race: >>
and this under OnPlayerEnterRaceCheckpoint: >>
What can be the problem?
Regards,
Checkpoints: >>
Код:
1753.6545 850.6560 9.5190 1568.6921 833.5577 6.3990 1287.6051 905.6605 6.4374 1226.4041 1334.8127 6.3621 1209.0433 1502.7931 6.3621 1263.7335 1732.5851 8.0399 1401.9918 1872.6542 10.3007 1707.2323 1886.4031 10.2967 1728.4037 2053.3477 10.2970 1956.9373 2022.1593 10.2968 2176.9705 2137.1475 10.2968 2349.7729 2179.5166 10.3058 2287.6816 2291.3613 10.3413 2271.7271 2413.7090 10.3006 2189.2878 2325.5537 10.2968 2074.8704 1758.3037 10.2968 2047.5907 1587.5190 10.2968 2061.5239 1531.0094 10.2968 2047.8118 1361.2373 10.2968 2046.0575 861.8326 6.3588
Код:
while(fread(ReadFileString, Line, sizeof Line, false)) { CP[CPCount][1] = floatstr(strtok(Line, Index)); CP[CPCount][2] = floatstr(strtok(Line, Index)); CP[CPCount][3] = floatstr(strtok(Line, Index)); CPCount++; }
This is the way I'm using to set the checkpoints under my function to start the race: >>
Код:
SetPlayerRaceCheckpoint(playerid, 0, CP[WhichCheckpoint[playerid]][1], CP[WhichCheckpoint[playerid]][2],CP[WhichCheckpoint[playerid]][3], CP[WhichCheckpoint[playerid]+1][1], CP[WhichCheckpoint[playerid]+1][2],CP[WhichCheckpoint[playerid]+1][3], CP_SIZE);
Код:
WhichCheckpoint[playerid]++; CP[WhichCheckpoint[playerid]][1]++; CP[WhichCheckpoint[playerid]][2]++; CP[WhichCheckpoint[playerid]][3]++; SetPlayerRaceCheckpoint(playerid, 0, CP[WhichCheckpoint[playerid]][1], CP[WhichCheckpoint[playerid]][2],CP[WhichCheckpoint[playerid]][3], CP[WhichCheckpoint[playerid]+1][1], CP[WhichCheckpoint[playerid]+1][2],CP[WhichCheckpoint[playerid]+1][3], CP_SIZE);
Regards,