How do you load lots of cars from mysql?
#1

For those who use g-stylzzz's plugin only....


my way:
Код:
stock LoadVehsr()
{
	new query[32];
    format(query,256,"SELECT * FROM vehs");
    mysql_query(query);
    mysql_store_result();
	while(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);
  		}
	mysql_free_result();
	return 1;
}
Please post your code too.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 5 Guest(s)