mysql vehicles - 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)
+--- Thread: mysql vehicles (
/showthread.php?tid=512506)
mysql vehicles -
n00el - 11.05.2014
PHP код:
stock LoadVehicles()
{
new id;
mysql_format(sqldb, query, sizeof(query), "SELECT * FROM vehicles");
mysql_query(sqldb, query);
mysql_store_result();
printf("Kocsik tцltйse..");
while(mysql_fetch_row("|"))
{
id = LoadedInfo[Vehicles];
sscanf(query, "p<|>e<iis[30]s[30]iiiiffffii>", VehicleInfo[id]);
CreateVehicle(VehicleInfo[id][vModel],VehicleInfo[id][vX],VehicleInfo[id][vY],VehicleInfo[id][vZ],VehicleInfo[id][vR],VehicleInfo[id][vSzin1],VehicleInfo[id][vSzin2], 10);
SetVehicleNumberPlate(id, VehicleInfo[id][vRendszam]);
LoadedInfo[Vehicles] = LoadedInfo[Vehicles] + 1;
}
}
why dont spawn this the car? i call LoadVehicles(); in onplayerconnect
PHP код:
enum vInfo
{
vID,
vModel,
vRendszam[30],
vTulajdonos[30],
vAr,
vUzemanyagTipus,
vUzemanyag,
vAllapot,
Float:vX,
Float:vY,
Float:vZ,
Float:vR,
vSzin1,
vSzin2
}
Re: mysql vehicles -
n00el - 11.05.2014
anyone?
Re: mysql vehicles -
Tingesport - 11.05.2014
First of all
pawn Код:
CreateVehicle(VehicleInfo[id][vModel],VehicleInfo[id][vX],VehicleInfo[id][vY],VehicleInfo[id][vZ],VehicleInfo[id][vR],VehicleInfo[id][vSzin1],VehicleInfo[id][vSzin2], 10);
That one is loaded as a string, and the coords aren't loaded at all?
Re: mysql vehicles -
n00el - 11.05.2014
string? in a CreateVehicle? cord loaded az here: VehicleInfo[id][vX],VehicleInfo[id][vY],VehicleInfo[id][vZ]
Re: mysql vehicles -
Tingesport - 11.05.2014
sscanf(query, "p<|>e<iis[30]s[30]iiiiffffii>", VehicleInfo[id]); see this?
You load the coords inside the CreateVehicle function and that function is loaded as a string, therefor you don't load any coords at all.
Re: mysql vehicles -
n00el - 11.05.2014
uuhm, okey
Re: mysql vehicles -
n00el - 11.05.2014
solved, thx