20.12.2010, 15:35
Hi again, i want to select vehicle's information OnPlayerEnterVehicle. I have a stock wich is not working correctly, becouse vInfo[vehicleid][Id] returns = 0 or 1 becouse it's just 2 vehicles. What should i use to select current vehicle's Id? In DB Id is 277 and 278. Should i add something when i LoadVehicles? Or maybe you can suggest any other suggestions? Maybe i should first get Id with Fetch_field_row?
pawn Код:
stock GetCarSetting(vehicleid)
{
new Query[256];
format(Query, sizeof(Query), "SELECT * FROM vehicles WHERE ID= %d", vInfo[vehicleid][Id]);
mysql_query(Query); // Querys the "Query" Variable.
mysql_store_result(); // Stores the result from Query
if(mysql_num_rows()) // Checks if theres anyrow.
if(mysql_fetch_row_format(Query,"|"))
{
sscanf(Query, "p<|>e<ds[25]dffffdddddddddddddddddddds[20]s[20]>",vInfo[vehicleid]);
}
}