14.04.2012, 16:14
Well, I can't figure out this issue in this code, so hopefully someone on these forums could.
Here's the debug log, it shows that it's working:
Here's the loading:
On the printf it says:
It shows no vehicles models, and the model comes out as 0 on there, which I can't understand.
Here's my enum:
Thanks in advance to anyone who posts.
Here's the debug log, it shows that it's working:
pawn Код:
CMySQLHandler::FetchRow() - Return: 1|TWF-6561|560|103.146|1.17058|0.797754|0|1|1|State|42
pawn Код:
stock LoadCars()
{
new Query[255];
for(new id; id < MAX_CARS; id++)
{
format(Query, sizeof(Query), "SELECT * FROM Vehicles WHERE ID = %d", id);
mysql_query(Query);
mysql_store_result();
if(mysql_num_rows())
if(mysql_fetch_row_format(Query,"|"))
{
sscanf(Query, "p<|>e<iffff>", Vehicles[id]);
printf("Model = %i",Vehicles[id][Model]);
CreateVehicle(Vehicles[id][Model],Vehicles[id][Posx],Vehicles[id][Posy],Vehicles[id][Posz],Vehicles[id][Posa],1,1, 60*10000);
printf("Model = %i",Vehicles[id][Model]);
}
}
}
On the printf it says:
pawn Код:
12:16:18] Model = 0
[12:16:18] Model = 0
[12:16:24] Server has been started.
[12:16:24] Number of vehicle models: 0
Here's my enum:
pawn Код:
enum cars
{
Plate[12],
Model,
Float:Posx,
Float:Posy,
Float:Posz,
Float:Posa,
Color1,
Color2,
Owner[32],
Fuel
};
Thanks in advance to anyone who posts.