Run time error 4: "Array index out of bounds"
#1

PHP код:
[07:26:52] [debugRun time error 4"Array index out of bounds"
[07:26:52] [debug]  Accessing element at index 50 past array upper bound 49
[07:26:52] [debugAMX backtrace:
[
07:26:52] [debug#0 00068bbc in public zcmd_OnGameModeInit () from LcGaming.amx
[07:26:52] [debug#1 native CallLocalFunction () from samp03svr
[07:26:52] [debug#2 00034370 in ?? () from LcGaming.amx
[07:26:52] [debug#3 00017310 in public ScriptInit_OnGameModeInit () from LcGaming.amx
[07:26:52] [debug#4 00011d00 in public RL_OnGameModeInit () from LcGaming.amx
[07:26:52] [debug#5 native CallLocalFunction () from samp03svr
[07:26:52] [debug#6 00011c0c in public Iter_OnGameModeInit () from LcGaming.amx
[07:26:52] [debug#7 native CallLocalFunction () from samp03svr
[07:26:52] [debug#8 0000ab6c in public SSCANF_OnGameModeInit () from LcGaming.amx
[07:26:52] [debug#9 0000496c in public IRC_OnGameModeInit () from LcGaming.amx
[07:26:52] [debug#10 native CallLocalFunction () from samp03svr
[07:26:52] [debug#11 000044f0 in public moneyhax_OnGameModeInit () from LcGaming.amx
[07:26:52] [debug#12 native CallLocalFunction () from samp03svr
[07:26:52] [debug#13 00000ebc in public OnGameModeInit () from LcGaming.amx
[07:26:52
Whats Wrong ?

Thanks
Reply
#2

Runtime error 4
Very simple, you're trying to access out-of-bound data in an array, in other words, a cell inside of an array that doesn't exist.

Solution: If you're using the crashdetect plugin, it'll tell you which callback the error is in. Simply debug your code until you find the culprit, then remove it.
Reply
#3

Quote:
Originally Posted by Sreyas
Посмотреть сообщение
Runtime error 4
Very simple, you're trying to access out-of-bound data in an array, in other words, a cell inside of an array that doesn't exist.

Solution: If you're using the crashdetect plugin, it'll tell you which callback the error is in. Simply debug your code until you find the culprit, then remove it.
Already Fixed .. I Just Make a Wrong Definiton With Max Players ...

The New Problem

PHP код:
[07:49:36] [debugServer crashed while executing LcGaming.amx
[07:49:36] [debugAMX backtrace:
[
07:49:36] [debug#0 native fwrite () from samp03svr
[07:49:36] [debug#1 00201720 in ?? () from LcGaming.amx
[07:49:36] [debug#2 00202738 in public Business_TransactionTimer () from LcGaming.amx
[07:49:36] [debugNative backtrace:
[
07:49:36] [debug#0 b3f5ae8b in _ZN10StackTraceC1EPv () from plugins/crashdetect.so
[07:49:36] [debug#1 b3f53bcf in _ZN11CrashDetect20PrintNativeBacktraceERSoPv () from plugins/crashdetect.so
[07:49:36] [debug#2 b3f54dbc in _ZN11CrashDetect20PrintNativeBacktraceEPv () from plugins/crashdetect.so
[07:49:36] [debug#3 b3f55226 in _ZN11CrashDetect11OnExceptionEPv () from plugins/crashdetect.so
[07:49:36] [debug#4 b3f5aadc in ?? () from plugins/crashdetect.so
[07:49:36] [debug#5 b775e600 in ?? ()
[07:49:36] [debug#6 b775e420 in ?? ()
[07:49:36] [debug#7 b7490871 in gsignal () from /lib/libc.so.6
[07:49:36] [debug#8 b749214a in abort () from /lib/libc.so.6
[07:49:36] [debug#9 b7489b8b in ?? () from /lib/libc.so.6
[07:49:36] [debug#10 b7489c46 in ?? () from /lib/libc.so.6
[07:49:36] [debug#11 0809b99c in ?? () from ./samp03svr
[07:49:36] [debug#12 0809bdff in ?? () from ./samp03svr
[07:49:36] [debug#13 080950e4 in ?? () from ./samp03svr
[07:49:36] [debug#14 b3f5694b in _ZN11CrashDetect13DoAmxCallbackEiPiS0_ () from plugins/crashdetect.so
[07:49:36] [debug#15 b3f598f8 in ?? () from plugins/crashdetect.so
[07:49:36] [debug#16 b3f5d916 in amx_Exec () from plugins/crashdetect.so
[07:49:36] [debug#17 b3f55be6 in _ZN11CrashDetect9DoAmxExecEPii () from plugins/crashdetect.so
[07:49:36] [debug#18 b3f59659 in ?? () from plugins/crashdetect.so
[07:49:36] [debug#19 b3b892ea in ?? () from plugins/streamer.so
[07:49:36] [debug#20 080ebc05 in ?? () from ./samp03svr
[07:49:36] [debug#21 080af03c in ?? () from ./samp03svr
[07:49:36] [debug#22 080aa13a in ?? () from ./samp03svr
[07:49:36] [debug#23 b747cd36 in __libc_start_main () from /lib/libc.so.6
[07:49:36] [debug#24 0804b4e1 in ?? () from ./samp03svr 
If I Connect to My Server the server is Crash and Didn't respond

Any Help ?
Reply
#4

This should've error-ed out on compile, or execution in some way... They are also running CrashDetect, and it is true, it's bad code.

This shouldn't have needed CrashDetect. Basic server.log, or compile errors should've had information, or troubleshooting would point to it.




Right now, without crashdetect, chances are you'd face this.... "./samp03svr: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory" being that that crash relates to libc... which if you search around various people are all "change the plugin to XXX" but that does nothing to fix it.

You need the libraries, and the architecture that is appropriate for it.


Seriously though, people need to stop relying on that CrashDetect as the first thing to go to when sa-mp server has got an issue.
Reply
#5

Quote:
Originally Posted by Sew_Sumi
Посмотреть сообщение
This should've error-ed out on compile, or execution in some way... They are also running CrashDetect, and it is true, it's bad code.

This shouldn't have needed CrashDetect. Basic server.log, or compile errors should've had information, or troubleshooting would point to it.




Right now, without crashdetect, chances are you'd face this.... "./samp03svr: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory" being that that crash relates to libc... which if you search around various people are all "change the plugin to XXX" but that does nothing to fix it.

You need the libraries, and the architecture that is appropriate for it.


Seriously though, people need to stop relying on that as the first thing to go to when sa-mp server has got an issue.
I Must Remove crashdetect ,Right ?
Reply
#6

Quote:
Originally Posted by Amunra
Посмотреть сообщение
I Must Remove crashdetect ,Right ?
You should indeed, then run the server, and post the error that comes up.
Reply
#7

Quote:
Originally Posted by Sew_Sumi
Посмотреть сообщение
You should indeed, then run the server, and post the error that comes up.
I Get Same Think ... My Server Did'nt Response After I Connect
Reply
#8

You're on Linux I'm guessing... Post the server.log for a startup as it is now.
Reply
#9

Your server crashed on fwrite, suggesting the directory it tried to read/write to is not existing.
Check the script to see which folders and files are used and make sure the folders exist (Linux is case-sensitive!).

Since it happens when you connect it could probably be that the user files cannot be read/written.

Permissions should also be set to read/write for the whole scriptfiles folder.
Reply
#10

Quote:
Originally Posted by NaS
Посмотреть сообщение
Your server crashed on fwrite, suggesting the directory it tried to read/write to is not existing.
Check the script to see which folders and files are used and make sure the folders exist (Linux is case-sensitive!).

Since it happens when you connect it could probably be that the user files cannot be read/written.

Permissions should also be set to read/write for the whole scriptfiles folder.
Thanks Mate , My Bad .. xD I Forget Add Some Folder to save Data xD

Thanks ..................
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)