08.10.2013, 13:12
Yeah.
When they start the race.
When a player enters a race checkpoint.
pawn Код:
#define MAX_RACES 5
//change '5' to whatever you want.
#define RACE0CPs 50
#define RACE1CPs 25
//make more '#define RACE[number]CPs [number of checkpoints]' when you need them.
new RaceCPsLeft[MAX_RACES][MAX_PLAYERS];
pawn Код:
/*make sure the number inside RaceCPsLeft[HERE][playerid] is always the proper Race id
and also 'variable' is always the one assoicated with the race id - Make sure the RaceCPsLeft[RACEID][playerid]='variable'.
EG: RaceCPsLeft[3][playerid] SHOULD equal = RACE3CPs.
*/
RaceCPsLeft[0][playerid] = RACE0CPs;
//or
RaceCPsLeft[1][playerid] = RACE1CPs;
pawn Код:
new string[25];
RaceCPsLeft[0][playerid]--;
format(string,sizeof(string),"Checkpoints left: %i.",RaceCPsLeft[0][playerid]);
GameTextForPlayer(playerid,string,3000,3);