SA-MP Forums Archive
Last car keeps loading. - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Last car keeps loading. (/showthread.php?tid=227849)



Last car keeps loading. - THE_KNOWN - 18.02.2011

Код:
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;
}
idk why but when it goes to the last record it gets stuck in a loop there