28.10.2012, 12:57
(
Последний раз редактировалось Ambokile; 28.10.2012 в 14:36.
)
Hello, thanks for reading this.
I'm having a few problems with a while loop to load cars in my script. Here is my code:
As you can see, i++ should be increased with every iteration. However, the log prints this out (the server hangs, too):
I'm not sure what I'm doing wrong, I hope one of you can help me.
I'm having a few problems with a while loop to load cars in my script. Here is my code:
pawn Код:
forward loadCars_query();
public loadCars_query()
{
new rows, fields;
new i = -1;
cache_get_data(rows, fields);
if(rows)
{
while(i < rows)
{
i++;
new temp[4], id;
printf("i | rows : %d | %d", i, rows);
cache_get_field_content(i, "ID", temp), id = strval(temp);
}
}
}
Quote:
i | rows : 0 | 2 i | rows : 1 | 2 i | rows : 1 | 2 i | rows : 1 | 2 i | rows : 1 | 2 i | rows : 1 | 2 i | rows : 1 | 2 i | rows : 1 | 2 i | rows : 1 | 2 i | rows : 1 | 2 i | rows : 1 | 2 i | rows : 1 | 2 i | rows : 1 | 2 i | rows : 1 | 2 i | rows : 1 | 2 i | rows : 1 | 2 i | rows : 1 | 2 i | rows : 1 | 2 i | rows : 1 | 2 i | rows : 1 | 2 i | rows : 1 | 2 i | rows : 1 | 2 i | rows : 1 | 2 i | rows : 1 | 2 i | rows : 1 | 2 |