13.02.2011, 12:27
Код:
LoadDealer() { new query[256]; format(query,256,"SELECT * FROM dealer"); mysql_query(query); mysql_store_result(); new tmp=mysql_num_rows(); for( new i=mysql_retrieve_row();i<tmp;i++) { new field[13][32],row[128]; if(mysql_num_rows() == 0) continue; mysql_fetch_row_format(row , "|"); explode(row , 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+3,r,0,1,-1); price[vidid]=strval(field[4]); } mysql_free_result(); return 1; }
Код:
LoadMap() { new q[128]; format(q,128,"SELECT * FROM 'map'"); mysql_query(q); mysql_store_result(); for(new i=0;i<mysql_num_rows();mysql_retrieve_row()) { new field[6][32],row[128]; mysql_fetch_row_format(row , "|"); explode(row , field, "|"); new Float:x,Float:y,Float:z,t; x=strval(field[1]); y=strval(field[2]); z=strval(field[3]); t=strval(field[4]); CreateDynamicMapIcon(x,y,z,t,1,-1,-1,-1,100.0); } mysql_free_result(); return 1; }