only one car loads help
#1

Код:
LoadOvehs()
{
	new query[128],Float:x,Float:y,Float:z,Float:r,mdl,vidid;
	format(query,128,"SELECT * FROM orgvehs ORDER BY VID");
	mysql_query(query);
	mysql_store_result();
	new row[128];
	new field[13][32];

	mysql_fetch_row_format(row, "|");
	explode(row, field, "|");

	mdl=strval(field[1]);
	x=strval(field[2]);
	y=strval(field[3]);
	z=strval(field[4]);
	r=strval(field[5]);
	
	vidid=CreateVehicle(mdl,x,y,z,r,0,1,-1);
	vorg[vidid]=strval(field[0]);
	return 1;
}
only one car gets loaded. what should i do?
Reply
#2

Make a loop?

pawn Код:
while(mysql_fetch_row_format(row, "|"))
{
    // Your stuff
}
Reply
#3

is this correct?

Код:
LoadOvehs()
{
	new query[128],Float:x,Float:y,Float:z,Float:r,mdl,vidid;
	format(query,128,"SELECT * FROM orgvehs ORDER BY VID");
	mysql_query(query);
	mysql_store_result();
	new row[128];
	new field[13][32];

	mysql_fetch_row_format(row, "|");
	explode(row, field, "|");

	while(mysql_fetch_row_format(row, "|"))
	{
	mdl=strval(field[1]);
	x=strval(field[2]);
	y=strval(field[3]);
	z=strval(field[4]);
	r=strval(field[5]);
	
	vidid=CreateVehicle(mdl,x,y,z,r,0,1,-1);
	vorg[vidid]=strval(field[0]);
	mysql_free_result();
	}
	return 1;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)