Problem with MySQL
#1

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?
Reply


Messages In This Thread
Problem with MySQL - by Kevin033 - 23.10.2014, 19:02
Re: Problem with MySQL - by zaibaslr2 - 23.10.2014, 19:03
Re : Problem with MySQL - by Kevin033 - 23.10.2014, 19:05
Re : Problem with MySQL - by Kevin033 - 23.10.2014, 20:34
Re: Problem with MySQL - by zaibaslr2 - 24.10.2014, 11:37

Forum Jump:


Users browsing this thread: 1 Guest(s)