• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] [SOLVED] [debug] Run time error 4: "Array index out of bounds"
#5
(2021-05-17, 09:13 AM)Pinch Wrote: Add

Code:
if (!rows) return 1;

Before the first for loop



Also, loop through rows, not MAX_VEHICLES



How to change the MAX_VEHICLES sir? why not need it?



steal error sir:

Code:
[OwnableCars]: Spawned: [4 vehicle(s)]

[TRUNK_DEBUG]: Loaded trunk have:[4 row(s)]

[TRUNK_DEBUG]: Slot loaded in ID:[5]

[debug] Run time error 4: "Array index out of bounds"

[debug]? Attempted to read/write array element at index 5 in array of size 4

[debug] AMX backtrace:

[debug] #0 00052204 in ?? () in SuhartawanWorld.amx

[debug] #1 000fd4c4 in public GEOLITE_OnGameModeInit () in SuhartawanWorld.amx

[debug] #2 0004ed58 in public T3DV4_OnGameModeInit () in SuhartawanWorld.amx

[debug] #3 0004ca6c in public Indirection_OnGameModeInit () in SuhartawanWorld.amx

[debug] #4 0002b860 in public ScriptInit_OnGameModeInit () in SuhartawanWorld.amx

[debug] #5 0001d968 in public GZ_OnGameModeInit () in SuhartawanWorld.amx

[debug] #6 0001b454 in ?? () in SuhartawanWorld.amx

[debug] #7 native CallLocalFunction () in samp-server.exe

[debug] #8 0001aff8 in public SSCANF_OnGameModeInit () in SuhartawanWorld.amx

[debug] #9 0000d004 in public FIXES_OnGameModeInit () in SuhartawanWorld.amx

[debug] #10 000037c4 in public OnPlayerLeaveDynamicArea () in SuhartawanWorld.amx

[debug] Run time error 20: "Invalid index parameter (bad entry point)"

Script[gamemodes/SuhartawanWorld.amx]: Run time error 20: "Invalid index parameter (bad entry point)"



is from invalid array enum?

Code:
enum VEHICLE_TRUNK_STRUCTUR

{

? TRUNK_SQL_ID,

? TRUNK_SLOT,

? TRUNK_OC_ID,

? TRUNK_OWNER_ID,

? TRUNK_ITEM_TYPE,? ? // Name of item

? TRUNK_ITEM_AMOUNT,? // value

? TRUNK_ITEM_VALUE? ? // weigh Kg

};



new get_vehicle_trunk[MAX_VEHICLES][MAX_VEHICLE_TRUNK_SLOTS][VEHICLE_TRUNK_STRUCTUR];
  Reply


Messages In This Thread
RE: HELP! [debug] Run time error 4: "Array index out of bounds" - by PutuSuhartawan - 2021-05-17, 09:47 AM

Forum Jump: