30.11.2009, 14:15
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.
if you could show me how it should be done thanks so much to those who help!
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");
}
}
}