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
#2

Is car number too high or MYSQL row ID is too high?
Reply
#3

I've only two lines in my db
Reply
#4

bump
Reply
#5

I don't really understand what you want.
Car ID is not matching one on mysql, right?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)