23.10.2014, 19:02
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.
And my load script :
Can u help me, pls?
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", "");
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;
}