Help with loading id's with gaps between them
#4

What kind of field do you use for ID? It doesn't look like SERIAL (int(11) auto increment unique primary key), because 0 isn't a valid ID.
I strongly suggest that you don't rely on database id being mapped to array index.

Anyway, answer to your original question:

pawn Код:
forward OnCarIDsLoad();
public OnCarIDsLoad()
{
    new rows, fields;
    cache_get_data(rows, fields, Handle);
   
    new i = 0, realid = 0;
    while(rows > i < 10000)
    {
        realid = cache_get_row_int(i, 0, Handle);
        VehicleLoad[realid] = true;
        printf("Car %d created", realid);
        i++;
    }
    print("Loading finished");
    return 1;
}
Reply


Messages In This Thread
Help with loading id's with gaps between them - by thimo - 19.07.2013, 10:15
Re: Help with loading id's with gaps between them - by Misiur - 19.07.2013, 10:40
Re: Help with loading id's with gaps between them - by thimo - 19.07.2013, 10:42
Re: Help with loading id's with gaps between them - by Misiur - 19.07.2013, 11:42

Forum Jump:


Users browsing this thread: 1 Guest(s)