07.11.2010, 08:11
Okay, first of all:
This script wont work anymore when a car get's removed in-game (like selling a car) because it will take the number of rows in the database. So you have id 1 to 5, 4 get's removed, and 6 is bought. It will take id 1-5, and not 1-6. So, use a while loop.
Still not working? Pm me
This script wont work anymore when a car get's removed in-game (like selling a car) because it will take the number of rows in the database. So you have id 1 to 5, 4 get's removed, and 6 is bought. It will take id 1-5, and not 1-6. So, use a while loop.
pawn Код:
new query[100], data[100];
mysql_query("SELECT model, x, y, z FROM vehicles");
mysql_store_result();
while(mysql_fetch_row(data))
{
This will loop untill there are no more row's in the database.
sscanf(data, "p<|>ifff", VehicleInfo[i][CarModel], VehicleInfo[i][CarX], VehicleInfo[i][CarY], VehicleInfo[i][CarZ]); //dont know if you know how sscanf works
}