05.12.2010, 16:29
Hello,
I seem to have hit a very confusing problem,
I have a function from a tutorial that loads cars from mysql,
And it creates the vehicle alright, So that means its getting all the info and creating the vehicle,
But when i get in the vehicle that has someone elses name assigned to it, It didnt kick me out which it should of,
So i made a little debug and i found out that all of the model, owner, etc are empty,
Why? And how if it made the vehicle?
Heres the debug i made:
The 1st debug you see is from a spawned vehicle, So that should be like that,
But the last 2 are from MySQL which shouldnt be like that,
PICTURE ATTACHED,
I seem to have hit a very confusing problem,
I have a function from a tutorial that loads cars from mysql,
pawn Код:
stock LoadVehicles()
{
for(new id; id < SCRIPT_CARS; id++)
{
format(Query, sizeof(Query), "SELECT * FROM vehicles WHERE VehID = %d", id);
mysql_query(Query);
mysql_store_result();
if(mysql_num_rows())
if(mysql_fetch_row(Query,"|"))
{
sscanf(Query, "p<|>e<is[24]is[128]ffff>", VehicleInfo[id]);
CreateVehicle(VehicleInfo[id][Model], VehicleInfo[id][Pos][0], VehicleInfo[id][Pos][1], VehicleInfo[id][Pos][2], VehicleInfo[id][Pos][3], 1, 1, -1);
}
}
}
But when i get in the vehicle that has someone elses name assigned to it, It didnt kick me out which it should of,
So i made a little debug and i found out that all of the model, owner, etc are empty,
Why? And how if it made the vehicle?
Heres the debug i made:
The 1st debug you see is from a spawned vehicle, So that should be like that,
But the last 2 are from MySQL which shouldnt be like that,
PICTURE ATTACHED,
pawn Код:
enum vInfo
{
VehID,
Owner[24],
Model,
Vehicle[128],
Float:Pos[4]
}