Giant Error
#1

[18:29:46] [debug] Run time error 4: "Array index out of bounds"
[18:29:46] [debug] Accessing element at index 100 past array upper bound 99
[18:29:46] [debug] AMX backtrace:
[18:29:46] [debug] #0 0032f864 in public LoadProperty () at C:\Users\Darius\Desktop\vanilla\gamemodes\agb.pwn: 31895
[18:29:46] [debug] #1 000c274c in ?? () at C:\Users\Darius\Desktop\vanilla\gamemodes\agb.pwn: 1618
[18:29:46] [debug] #2 0002f310 in public L_AFK_OnGM () at C:\Users\Darius\Desktop\vanilla\pawno\include\YSI\ y_hooks/impl.inc:484
[18:29:46] [debug] #3 native CallLocalFunction () from samp03svr
[18:29:46] [debug] #4 0001be90 in public SSCANF_OnGameModeInit () at C:\Users\Darius\Desktop\vanilla\pawno\include\Auto AFK.inc:47
[18:29:46] [debug] #5 0001557c in public Itter_OnGameModeInit () at C:\Users\Darius\Desktop\vanilla\pawno\include\ssca nf2.inc:205
[18:29:46] [debug] #6 native CallLocalFunction () from samp03svr
[18:29:46] [debug] #7 000142b4 in public ScriptInit_OnGameModeInit () at C:\Users\Darius\Desktop\vanilla\pawno\include\YSI\ y_iterate.inc:791
[18:29:46] [debug] #8 00012ed4 in public PZone_OnGameModeInit () at C:\Users\Darius\Desktop\vanilla\pawno\include\YSI\ internal..\y_scriptinit.inc:171
[18:29:46] [debug] #9 native CallLocalFunction () from samp03svr
[18:29:46] [debug] #10 00006eb4 in public OnGameModeInit () at C:\Users\Darius\Desktop\vanilla\pawno\include\play erzone.inc:429
[18:29:46] Number of vehicle models: 58
[18:29:47] Accesory loaded: 100

What should i do>?
Reply
#2

Could you post the LoadProperty function?
Reply
#3

function LoadSVehicles() {
new Cache: db = mysql_query (SQL, "SELECT * FROM `svehicles` ORDER BY `svehicles`.`vID` ASC");
new x, servervehs = 0, result[256];
for (new i, j = cache_get_row_count (); i != j; ++i) {
servervehs ++;
cache_get_field_content(i, "vID", result); x = strval(result);
ServerVehicles[x][vID] = x;
cache_get_field_content(i, "vModel", result); ServerVehicles[x][vModel] = strval(result);
cache_get_field_content(i, "LocationX", result); ServerVehicles[x][vLocation][0] = floatstr(result);
cache_get_field_content(i, "LocationY", result); ServerVehicles[x][vLocation][1] = floatstr(result);
cache_get_field_content(i, "LocationZ", result); ServerVehicles[x][vLocation][2] = floatstr(result);
cache_get_field_content(i, "Angle", result); ServerVehicles[x][vAngle] = floatstr(result);
cache_get_field_content(i, "Color1", result); ServerVehicles[x][vColor][0] = strval(result);
cache_get_field_content(i, "Color2", result); ServerVehicles[x][vColor][1] = strval(result);
cache_get_field_content(i, "Faction", result); ServerVehicles[x][vFaction] = strval(result);
cache_get_field_content(i, "Rank", result); ServerVehicles[x][vRank] = strval(result);
cache_get_field_content(i, "Virtual", result); ServerVehicles[x][vVirtual] = strval(result);

if(ServerVehicles[x][vModel] >= 400 && ServerVehicles[x][vModel] <= 611) {
ServerVehicles[x][vSpawned] = CreateVehicleEx(ServerVehicles[x][vModel], ServerVehicles[x][vLocation][0], ServerVehicles[x][vLocation][1], ServerVehicles[x][vLocation][2], ServerVehicles[x][vAngle], ServerVehicles[x][vColor][0], ServerVehicles[x][vColor][1], -1);
new idd = ServerVehicles[x][vSpawned];
SetVehicleVirtualWorld(idd, ServerVehicles[idd][vVirtual]);
if(ServerVehicles[idd][vFaction] != 0) {
if(ServerVehicles[idd][vModel] == 411) {
new policecar = CreateObject(19327, 1534.2373, -1643.2886, 5.9373, -87.6999, 90.4001, -87.1805);
SetObjectMaterialText(policecar, "POLICE", 0, 50, "Arial", 25, 1, -16777216, 0, 1);
new lspdcar = CreateObject(19419,0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000);
AttachObjectToVehicle(policecar, idd, 0.0, -1.9, 0.3, 270.0, 0.0, 0.0);
AttachObjectToVehicle(lspdcar, idd, 0.0646, 0.1661, 0.6957, 0.0000, 0.0000, 0.0000);
}
if(ServerVehicles[idd][vModel] == 560) {
if(ServerVehicles[idd][vFaction] == 12 || ServerVehicles[idd][vFaction] == 13) {
new taiddiobj = CreateObject(19308, 0.00000, 0.00000, 0.00000,0.00000, 0.00000, 0.00000);
AttachObjectToVehicle(taiddiobj, idd, -0.00930, -0.23880, 0.92300,0.00000, 0.00000, 0.00000);
}
}
if(ServerVehicles[idd][vModel] == 541) {
if(ServerVehicles[idd][vFaction] == 2) {
new object1 = CreateObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
new object2 = CreateObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
AttachObjectToVehicle(object1, idd, 0.375000,0.524999,0.375000,0.000000,0.000000,0.000 000);
AttachObjectToVehicle(object2, idd, 0.375000,0.524999,0.375000,0.000000,0.000000,0.000 000);
}
}
if(ServerVehicles[idd][vModel] == 525) {
new object1 = CreateObject(19294, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
new object2 = CreateObject(19294, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
AttachObjectToVehicle(object1, idd, -0.600000,-0.485000,1.450000,0.000000,0.000000,0.000000);
AttachObjectToVehicle(object2, idd, 0.600000,-0.485000,1.450000,0.000000,0.000000,0.000000);
}
}

new str[64];
if(ServerVehicles[idd][vFaction] != 0) format(str, 64, "F%d %d", ServerVehicles[idd][vFaction], idd);
else format(str, sizeof(str), "RO-0%d", ServerVehicles[x][vSpawned]);
SetVehicleNumberPlate(idd, str);
}
}
printf("Server vehicles: %d", servervehs);
cache_delete(db);
return 1;
}
Reply
#4

People still posting array oob errors. Honestly this is such a routine fix you should be able to do it quickly. Just read the forum.
Reply
#5

Show the function printing:
Код:
[18:29:47] Accesory loaded: 100
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)