Quote:
Originally Posted by TwinkiDaBoss
Add these on your OnPLayerLoad and show us the results
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));
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
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");
}
}
EDIT: proper calculation is actually new calc = i-1; since rows start at 1 and car ids at 0
|
"Also why bother making a loop for car ids too?"
maybe cars get removed and the ID doesn't load anymore because it doesn't fill up that ID anymore.
i'll try the printf right now, sec
EDIT:
http://prntscr.com/beavcz
hm, the ids are correct