Last car keeps loading. -
Код:
LoadDealer()
{
new query[256];
format(query,256,"SELECT * FROM dealer");
mysql_query(query);
mysql_store_result();
new tmp;
tmp=mysql_num_rows();
for(new i=1;i<tmp;i++)
{
mysql_retrieve_row();
new field[13][128];
if(mysql_num_rows() == 0) continue;
mysql_fetch_row_format(query, "|");
explode(query, field, "|");
new mdl,vidid,Float:x,Float:y,Float:z,Float:r;
mdl=strval(field[0]);
x=strval(field[1]);
y=strval(field[2]);
z=strval(field[3]);
r=strval(field[5]);
vidid=CreateVehicle(mdl,x,y,z+0.5,r,0,1,-1);
price[vidid]=strval(field[4]);
dealer[vidid]=strval(field[6]);
new Text3D:txt,s[32];
format(s,32,"Price:%d",price[vidid]);
txt=Create3DTextLabel(s,0xFFFFFFFF,0.0,0.0,0.0,100,-1,1);
Attach3DTextLabelToVehicle(txt,vidid,0.0,0.0,0.0);
}
mysql_free_result();
return 1;
}