26.06.2015, 11:03
Hi,
I made the vehicle system for factions but the problem is that the vehicles won't load, they save perfectly but the loading part it doesn't, here is the code:
I made the vehicle system for factions but the problem is that the vehicles won't load, they save perfectly but the loading part it doesn't, here is the code:
pawn Код:
stock LoadVehicles()
{
new string[128];
new VehicleID, VehicleModel, Float:VehicleX, Float:VehicleY, Float:VehicleZ, Float:VehicleA, Col1, Col2, Fac, i = 0;
mysql_query("SELECT * FROM `vehicledata`");
mysql_store_result();
if(mysql_num_rows() != 0)
{
while(mysql_fetch_row(string))
{
sscanf(string, "p<|>ddffffddd", VehicleID, VehicleModel, VehicleX, VehicleY, VehicleZ, VehicleA, Col1, Col2, Fac);
CreateVehicle(VehicleModel, VehicleX, VehicleY, VehicleZ, VehicleA, Col1, Col2, 900000000000, 1);
vInfo[i][Faction] = Fac;
vInfo[i][Owned] = 0;
vInfo[i][VehID] = VehicleID;
i++;
}
}
mysql_free_result();
printf("--- %i vehicles loaded from the database. ---");
return 1;
}