05.09.2013, 18:12
You can add on the enum a boolean that checks if a raceid is valid or not. Whenever you add a checkpoint on it, set it to true. If none of the checkpoints has been set, the race is invalid.
Also, you enter the races manually, so declaring a global variable and assigning how many the loaded races are would be good.
For example:
By the way, it'd be better to save/load the races instead of entering manually. I mean, that if a race has 50 checkpoints, you will need to add them by hand (kinda boring!). Anyways, you know.
Also, you enter the races manually, so declaring a global variable and assigning how many the loaded races are would be good.
For example:
pawn Код:
new
Loaded_Races
;
// Global variable
// OnGameModeInit
AddCheckpointToRace(0, 0, 2378.034423, -1256.948120, 23.392478);
CreateRace(0,"TestRace", 50, 0,0,0,1);
AddCheckpointToRace(1, 0, 0, 0, 0);
CreateRace(1,"Race Farm", 50, 0,0,0,1);
Loaded_Races = 2;
// Somewhere else;
for( new i = 0; i < Loaded_Races; i++ )