09.06.2016, 14:02
Add these on your OnPLayerLoad and show us the results
Also why bother making a loop for car ids too?
Loops start at SQL at 1 (AUTO_INCREMENT) if im correct and MAX_VEHICLES start at 0.
So there will be 1 ID difference in it.
For example
EDIT: proper calculation is actually new calc = i-1; since rows start at 1 and car ids at 0
PHP код:
printf("ID without handler: %i",cache_get_field_content_int(i, "id"));
printf("ID with handler: %i",cache_get_field_content_int(i, "id", dbhandle));
Loops start at SQL at 1 (AUTO_INCREMENT) if im correct and MAX_VEHICLES start at 0.
So there will be 1 ID difference in it.
For example
PHP код:
#define MAX_SOMETHING 255 //starts at 0, ends at 255
new MyVar[MAX_SOMETHING];
public SomeCallback() {
new rows = cache_num_rows();
for(new i=0; i < rows; i++) {
new calc = i-1; //calling row 1 at start and our MAX_SOMETHNIG starts at 0, therefore sub 1 to the MAX_SOMETHING
MyVar[calc] = cache_get_field_content_int(i,"Something");
}
}