24.07.2012, 12:20
Glad you got it working.
I just released a new version that deals with player array sorting much more efficiently (DL at first post).
Basically, change your sorting code to this:
I just released a new version that deals with player array sorting much more efficiently (DL at first post).
Basically, change your sorting code to this:
pawn Код:
new sorted_racers[MAX_PLAYERS];
SortArrayUsingComparator(gPlayerRaceData, CompareDistanceToFinish, SORT_IS_PLAYERS) => sorted_racers;
for (new i = 0; i < sizeof(sorted_racers); i++) {
new playerid = sorted_racers[i];
// All valid player IDs are at the start of the array, so the first invalid one means the rest will be, too.
if (playerid == INVALID_PLAYER_ID)
break;
// do stuff with "playerid"
}