Problem with MySQL - 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: Problem with MySQL (
/showthread.php?tid=542992)
Problem with MySQL -
Kevin033 - 23.10.2014
Hello, I have an issue with a loading vehicles with MySQL.
In fact, IG, the ID does not match those in MySQL, and it is because of that AddVehicle take from 1 and MySQL from row 0.
pawn Код:
mysql_tquery(mysql, "SELECT * FROM `cars`", "CarLoad", "");
And my load script :
pawn Код:
forward CarLoad();
public CarLoad()
{
new rows, fields, i;
cache_get_data(rows, fields);
if(rows) {
for(i = 0; i < rows; i++)
{
vInfos[i][ID] = cache_get_field_content_int(i, "ID");
vInfos[i][Model] = cache_get_field_content_int(i, "Model");
vInfos[i][vSpawn][0] = cache_get_field_content_float(i, "SpawnX");
vInfos[i][vSpawn][1] = cache_get_field_content_float(i, "SpawnY");
vInfos[i][vSpawn][2] = cache_get_field_content_float(i, "SpawnZ");
vInfos[i][vSpawn][3] = cache_get_field_content_float(i, "SpawnAng");
vInfos[i][Color1] = cache_get_field_content_int(i, "Color1");
vInfos[i][Color2] = cache_get_field_content_int(i, "Color2");
vInfos[i][ID] = AddStaticVehicleEx(vInfos[i][Model], vInfos[i][vSpawn][0], vInfos[i][vSpawn][1], vInfos[i][vSpawn][2], vInfos[i][vSpawn][3], vInfos[i][Color1], vInfos[i][Color2], -1);
}
}
printf("[MYSQL]: %d car loads", i);
return 1;
}
Can u help me, pls?
Re: Problem with MySQL -
zaibaslr2 - 23.10.2014
Is car number too high or MYSQL row ID is too high?
Re : Problem with MySQL -
Kevin033 - 23.10.2014
I've only two lines in my db
Re : Problem with MySQL -
Kevin033 - 23.10.2014
bump
Re: Problem with MySQL -
zaibaslr2 - 24.10.2014
I don't really understand what you want.
Car ID is not matching one on mysql, right?