Doesn't read the first row in the database - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Doesn't read the first row in the database (
/showthread.php?tid=291782)
Doesn't read the first row in the database -
Incubator - 21.10.2011
Solved.
Re: Doesn't read the first row in the database -
CyNiC - 21.10.2011
Change vehicles = 0 to vehicles = -1
Re: Doesn't read the first row in the database -
Incubator - 21.10.2011
Quote:
Originally Posted by CyNiC
Change vehicles = 0 to vehicles = -1
|
You can't read/set factionvehicles[-1]...
Re: Doesn't read the first row in the database -
CyNiC - 21.10.2011
Quote:
Originally Posted by Incubator
You can't read/set factionvehicles[-1]...
|
vehicles++ will be
0 in the first iteration.
Re: Doesn't read the first row in the database -
Incubator - 21.10.2011
Quote:
Originally Posted by CyNiC
vehicles++ will be 0 in the first iteration.
|
That's meant to be, man.
Read the code again.. thanks.
the variable vehicles grows by one after used by factionvehicles[]
the same is this:
Код:
new factionvehicles[400], vehicles = 0;
while(mysql_retrieve_row())
{
factionvehicles[vehicles] = mysql_fetch_int();
vehicles++;
}
Re: Doesn't read the first row in the database -
Incubator - 21.10.2011
Come on, anybody?