Run time error 4
#1

I always got this error in my server console
Code:
[22:05:28] [debug] Parameter count corrections:
[22:05:28] [debug]
[22:05:28] [debug] The 1st mangled argments (e.g. `<1073741823 arguments>`) below should read `<1 arguments>`
[22:05:28] [debug]
[22:05:28] [debug] Run time error 4: "Array index out of bounds"
[22:05:28] [debug]  Attempted to read/write array element at index 60 in array of size 50
[22:05:28] [debug] AMX backtrace:
[22:05:28] [debug] #0 003dd368 in public _y_utils_OnPlayerConnect (60) in roleplay.amx
[22:05:28] [debug] #1 00016738 in public SSCANF_OnPlayerConnect (60) in roleplay.amx
[22:05:28] [debug] #2 00008a64 in public MP_OPC (60) in roleplay.amx
[22:05:28] [debug] #3 native CallLocalFunction () in samp03svr
[22:05:28] [debug] #4 00006650 in ?? (60) in roleplay.amx
[22:05:28] [debug] #5 00025cc4 in public OnPlayerConnect (60) in roleplay.amx
I dont know how to fix it

here's my onplayerconnect codes
its quite long thats why I put in pastebin
https://pastebin.com/FaxLDbUz

Thanks in advance
Reply
#2

Runtime error 4: Array index out of bounds.

It means it tries to get data from an array from an index that does not exist. It literally says that:
Code:
[22:05:28] [debug] Run time error 4: "Array index out of bounds"
[22:05:28] [debug]  Attempted to read/write array element at index 60 in array of size 50
One of your arrays has a size of 50 cells, but it attempts to access index 60.
pawn Code:
new myArray[50];
myArray[60] = 1;
Reply
#3

1) Download crashdetect.dll or crashdetect.so.
2) Edit pawn.cfg, add "-d3", or use #pragma option -d3 on top of the script, then compile it.
3) Run server.exe, when it breaks, you will see the EXACT line where the error has occurred.
4) Profit.
Reply
#4

Quote:
Originally Posted by ShadowMortar
View Post
1) Download crashdetect.dll or crashdetect.so.
2) Edit pawn.cfg, add "-d3", or use #pragma option -d3 on top of the script, then compile it.
3) Run server.exe, when it breaks, you will see the EXACT line where the error has occurred.
4) Profit.
I already fixed it using -d3 method.. thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)