MySQL Help please
#1

i need it so that it read the feilds as its all set in the MySQL database, i just need it to read them and create the vehicle, i'm new with MySQL so help would be so great.

pawn Код:
stock LoadPlayerVehicles()
{
    samp_mysql_query("SELECT * FROM Vehicles");
    samp_mysql_store_result();
    if(samp_mysql_num_rows())
    {
      new Car,result[256];
        while(samp_mysql_fetch_row(result))
        {
        sscanf(result,"p|d",Car);
        sscanf(result,"p|dffffddssddd",VehInfo[Car][cModel],VehInfo[Car][cLocationx],VehInfo[Car][cLocationy],VehInfo[Car][cLocationz],VehInfo[Car][cAngle],VehInfo[Car][cColorOne],VehInfo[Car][cColorTwo],VehInfo[Car][cOwner],VehInfo[Car][cDescription],VehInfo[Car][cValue],VehInfo[Car][cOwned],VehInfo[Car][cLock]);
    AddStaticVehicleEx(VehInfo[Car][cModel],VehInfo[Car][cLocationx],VehInfo[Car][cLocationy],VehInfo[Car][cLocationz]+1.0,VehInfo[Car][cAngle],VehInfo[Car][cColorOne],VehInfo[Car][cColorTwo],-1);
    printf( "Car Spawned");
    }
    }
}
if you could show me how it should be done thanks so much to those who help!
Reply


Messages In This Thread
MySQL Help please - by Cem - 30.11.2009, 14:15
Re: MySQL Help please - by Cem - 30.11.2009, 20:06
Re: MySQL Help please - by Cem - 01.12.2009, 10:54
Re: MySQL Help please - by Marcel - 01.12.2009, 11:45

Forum Jump:


Users browsing this thread: 1 Guest(s)