19.07.2013, 11:42
What kind of field do you use for ID? It doesn't look like SERIAL (int(11) auto increment unique primary key), because 0 isn't a valid ID.
I strongly suggest that you don't rely on database id being mapped to array index.
Anyway, answer to your original question:
I strongly suggest that you don't rely on database id being mapped to array index.
Anyway, answer to your original question:
pawn Код:
forward OnCarIDsLoad();
public OnCarIDsLoad()
{
new rows, fields;
cache_get_data(rows, fields, Handle);
new i = 0, realid = 0;
while(rows > i < 10000)
{
realid = cache_get_row_int(i, 0, Handle);
VehicleLoad[realid] = true;
printf("Car %d created", realid);
i++;
}
print("Loading finished");
return 1;
}