Vehicle System - AGAIN :| - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Vehicle System - AGAIN :| (
/showthread.php?tid=257580)
Vehicle System - AGAIN :| -
Luis- - 26.05.2011
I am sorry for all of this, but I am having trouble with my vehicle loading code AGAIN..
Here is the code for the loading:
pawn Код:
forward LoadVehicles();
public LoadVehicles()
{
new query[128], line[512], placeholder;
for(cars = 1; cars <= MAX_CARS; cars++) {
format(query, sizeof(query), "SELECT * FROM vehicles WHERE `ID` = %d", cars);
mysql_query(query);
mysql_store_result();
if(mysql_num_rows() != 1) {
cars--;
return 1;
}
mysql_free_result();
mysql_fetch_row(line);
sscanf(line, "p|ddffffdd", placeholder, VehicleInfo[cars][vModel], VehicleInfo[cars][vPosX], VehicleInfo[cars][vPosY], VehicleInfo[cars][vPosZ], VehicleInfo[cars][vPosA], VehicleInfo[cars][vCol1], VehicleInfo[cars][vCol2]);
printf("DEBUG: %d Vehicles Loaded.", cars);
print(line);
CreateVehicle(VehicleInfo[cars][vModel], VehicleInfo[cars][vPosX], VehicleInfo[cars][vPosY], VehicleInfo[cars][vPosZ], VehicleInfo[cars][vPosA], VehicleInfo[cars][vCol1], VehicleInfo[cars][vCol2], 0);
}
return 1;
}
And here is my server log:
Код:
[20:57:22] DEBUG: 1 Vehicles Loaded.
[20:57:22] (null)
[20:57:22] DEBUG: 2 Vehicles Loaded.
[20:57:22] (null)
[20:57:22]
As you can see it says "null" which I have no idea why, I have used this vehicle system before on another script but it just doesn't want to work any more.
~ Regards, Luis.