loading cars from mysql
#4

pawn Код:
stock LoadOvehs()
{
    mysql_debug(1);
    new
       query[128],
       field[13][128],
       c1,
       c2;
    mysql_query("SELECT * FROM `orgvehs`");
    mysql_store_result();
    if(mysql_num_rows() > 0)
    {
      while(mysql_fetch_row(query))
      {
            mysql_fetch_row_format(query, "|");
            explode(query, field, "|");
            new mdl,vidid,Float:x,Float:y,Float:z,Float:r;
            mdl=strval(field[1]);
            x=strval(field[2]);
            y=strval(field[3]);
            z=strval(field[4]);
            r=strval(field[5]);
            c1=strval(field[6]);
            c2=strval(field[7]);
            vidid=CreateVehicle(mdl,x,y,z+0.2,r,c1,c2,-1);
            vorg[vidid]=strval(field[0]);
      }
    }
    mysql_free_result();
    mysql_debug(0);
    return 1;
}
Try this.
Reply


Messages In This Thread
loading cars from mysql - by THE_KNOWN - 01.04.2011, 15:19
Re: loading cars from mysql - by mprofitt - 01.04.2011, 15:40
Re: loading cars from mysql - by THE_KNOWN - 02.04.2011, 07:42
Re: loading cars from mysql - by Alby Fire - 02.04.2011, 08:04

Forum Jump:


Users browsing this thread: 1 Guest(s)