Array index out of bounds -
Scott Zulkifli - 30.12.2013
Код:
[07:29:27] [debug] Run time error 4: "Array index out of bounds"
[07:29:27] [debug] Accessing element at index 51 past array upper bound 50
[07:29:27] [debug] Backtrace:
[07:29:27] [debug] #0 000008e0 in public FS_CreateButton () from buttons.amx
[07:29:27] [debug] #1 native CallRemoteFunction () from samp-server.exe
[07:29:27] [debug] #2 00000008 in public RL_OnGameModeInit () from Naturally3.amx
[07:29:27] [debug] #3 native CallLocalFunction () from samp-server.exe
[07:29:27] [debug] #4 00014880 in public Audio_OnGameModeInit () from Naturally3.amx
[07:29:27] [debug] #5 native CallLocalFunction () from samp-server.exe
[07:29:27] [debug] #6 000125e0 in public SSCANF_OnGameModeInit () from Naturally3.amx
[07:29:27] [debug] #7 native CallLocalFunction () from samp-server.exe
[07:29:27] [debug] #8 0000c6fc in public zcmd_OnGameModeInit () from Naturally3.amx
[07:29:27] [debug] #9 native CallLocalFunction () from samp-server.exe
[07:29:27] [debug] #10 0000c014 in public Timers_OnScriptInit () from Naturally3.amx
[07:29:27] [debug] #11 native CallLocalFunction () from samp-server.exe
[07:29:27] [debug] #12 0000be9c in public YVers_OnScriptInit () from Naturally3.amx
[07:29:27] [debug] #13 native CallLocalFunction () from samp-server.exe
[07:29:27] [debug] #14 0000abbc in public Itter_OnGameModeInit () from Naturally3.amx
[07:29:27] [debug] #15 native CallLocalFunction () from samp-server.exe
[07:29:27] [debug] #16 0000130c in public OnGameModeInit () from Naturally3.amx
and many such it
Re: Array index out of bounds -
TheOriginal1337 - 30.12.2013
Show the lines where the functions come from.
Re : Array index out of bounds -
Noliax8 - 30.12.2013
Give me code
Re: Array index out of bounds -
Scott Zulkifli - 30.12.2013
I do not know where the line, here a lot of code
Re: Array index out of bounds -
FireCat - 30.12.2013
Copy line 50.
Re: Array index out of bounds -
Scott Zulkifli - 31.12.2013
I tried to use print ("TEXT ...");
there seems to be a problem with
CreateDynamicObject
CreateObject
Re: Array index out of bounds -
Scott Zulkifli - 31.12.2013
Код:
for(new x;x<sizeof(LAElevatorDoorLeft);x++)
{
LAElevatorDoorLeft[x] = CreateDynamicObject(18756, 1786.661254, -1299.346162, (23.117773) + (x * 5.45), 0.000000, 0.000000, 90.000000); //Door Left
}
LAElevatorDoorLeft[0] = CreateDynamicObject(18756, 1786.661254, -1299.346162, 14.595184, 0.000000, 0.000000, 90.000000); //Door Left
for(new x;x<sizeof(LAElevatorDoorRight);x++)
{
LAElevatorDoorRight[x] = CreateDynamicObject(18757, 1786.661254, -1299.346162, (23.117773) + (x * 5.45), 0.000000, 0.000000, 90.000000); //Door Right
}
LAElevatorDoorRight[0] = CreateDynamicObject(18757, 1786.661254, -1299.346162, 14.595184, 0.000000, 0.000000, 90.000000); //Door Right
LAElevator = CreateObject(18755, 1786.634887, -1303.237329, 14.614652, 0.000000, 0.000000, 270.000000); //First Floor
for(new x;x<sizeof(LAElevatorButton);x++)
{
LAElevatorButton[x] = CreateButton(1783.894409, -1301.119140, 22.721138 + (x * 5.45),180.000000); //Elevator Floor Call
}
LAElevatorButton[0] = CreateButton(1783.894409, -1301.119140, 13.918642,180.000000); //Elevator Floor Call
LAElevatorFloorPick = CreateButton(1788.889282, -1302.229003, 13.656608,270.000000); //Elevator Floor Call
CreateDynamicObject(10832, 1775.283447, -1303.936523, 132.553176, 0.000000, 0.000000, 180.000000); //ROOF
CreateDynamicObject(2949, 1770.609741, -1303.600219, 124.720870, 0.000000, 0.000000, 180.000000); //INSIDE
Re: Array index out of bounds -
Konstantinos - 31.12.2013
Quote:
Originally Posted by FireCat
Copy line 50.
|
50 is the last valid index, not the line..
An array was declared with size of 51 so the valid indexes are 0-50 but it passes 51 as an index which is an invalid one.
Update crashdetect plugin's version to 4.12 (if that's not the version you use):
https://github.com/Zeex/samp-plugin-...ases/tag/v4.12
And also re-compile your scripts with debug info (-d3):
https://github.com/Zeex/samp-plugin-...ith-debug-info
Start the server again and if you get debug details, then post them here.