Quote:
[18:05:48] [debug] Run time error 4: "Array index out of bounds" [18:05:48] [debug] Attempted to read/write array element at index 15 in array of size 15 [18:05:48] [debug] AMX backtrace: [18:05:48] [debug] #0 00114bf0 in public onLoadPoints () from WCRP.amx |
PHP Code:
public onLoadPoints()
{
new rows, fields;
cache_get_data(rows,fields);
new id_string[32];
for(new i=0;i<rows;i++)
{
cache_get_row(i,0,id_string);
Points[i][EPointSQLID] = strval(id_string);
cache_get_row(i,1,Points[i][EPointDataName]);
cache_get_row(i,2,id_string);
Points[i][EPointDataX] = floatstr(id_string);
cache_get_row(i,3,id_string);
Points[i][EPointDataY] = floatstr(id_string);
cache_get_row(i,4,id_string);
Points[i][EPointDataZ] = floatstr(id_string);
cache_get_row(i,5,id_string);
Points[i][EPointDataInt] = strval(id_string);
cache_get_row(i,6,id_string);
Points[i][EPointDataVW] = strval(id_string);
cache_get_row(i,7,id_string);
Points[i][EPointDataType] = EPointType:strval(id_string);
cache_get_row(i,8,id_string);
Points[i][EPointDataDeliver] = strval(id_string);
cache_get_row(i,9,id_string);
Points[i][EPointDataIconID] = strval(id_string);
cache_get_row(i,10,id_string);
Points[i][EPointPickupModel] = strval(id_string);
cache_get_row(i,11,id_string);
Points[i][EPointOwnerFamily] = FindFamilyBySQLID(strval(id_string));
cache_get_row(i,12,id_string);
Points[i][EPointCaptureTime] = strval(id_string);
Points[i][EPointPickupID] = CreateDynamicPickup(Points[i][EPointPickupModel], 16, Points[i][EPointDataX], Points[i][EPointDataY], Points[i][EPointDataZ],Points[i][EPointDataVW],Points[i][EPointDataInt]);
//point tip
new pointlabel[128];
format(pointlabel, sizeof(pointlabel), "%s {FFFFFF}(( {FF0000} %s {FFFFFF} ))", Points[i][EPointDataName], givePlayerPointTip(i));
Points[i][EPointLabel] = CreateDynamic3DTextLabel(pointlabel, getPointColour(i), Points[i][EPointDataX], Points[i][EPointDataY], Points[i][EPointDataZ]+1.0, 10.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, Points[i][EPointDataVW],Points[i][EPointDataInt]);
if(Points[i][EPointDataIconID] != -1)
{
new mapid = allocMapID();
Points[i][EPointMapSlotID] = mapid;
}
}
}