Unknown Command error and crash detector detects something
#1

Hi guys,
So when i use some commands it appears Unknown Command but it still runs the command. And crash detector shows me this:
PHP код:
[debug]  Accessing element at index 10 past array upper bound 9
[16:56:02] [debugAMX backtrace:
[
16:56:02] [debug#0 00271ccc in public OnPlayerLogin (1, 6079884) from I-RP.amx
[16:56:02] [debug#1 0030db64 in public JB_OnDialogResponse (1, 1, 1, -1, 6079884) from I-RP.amx
[16:56:02] [debug#2 native CallLocalFunction () from samp03svr
[16:56:02] [debug#3 000133f4 in public OnDialogResponse (1, 1, 1, -1, 6079864) from I-RP.amx
[16:56:02] [debugRun time error 4"Array index out of bounds"
[16:56:02] [debug]  Accessing element at index 10 past array upper bound 9
[16:56:02] [debugAMX backtrace:
[
16:56:02] [debug#0 002cfad8 in public SetPlayerToFactionColor (1) from I-RP.amx
[16:56:02] [debug#1 002cd204 in public SetPlayerSpawn (1) from I-RP.amx
[16:56:02] [debug#2 0007c3b4 in public JB_OnPlayerSpawn (1) from I-RP.amx
[16:56:02] [debug#3 native CallLocalFunction () from samp03svr
[16:56:02] [debug#4 0000e1d8 in public OnPlayerSpawn (1) from I-RP.amx
[16:56:03] [debugRun time error 4"Array index out of bounds"
[16:56:03] [debug]  Accessing element at index 10 past array upper bound 9
[16:56:03] [debugAMX backtrace:
[
16:56:03] [debug#0 0027f354 in public PayDay () from I-RP.amx
[16:56:03] [debug#1 00307b14 in public SyncTime () from I-RP.amx
[16:56:03] [debug#2 0028ec64 in public UpdateData () from I-RP.amx
[16:56:14] [debugRun time error 4"Array index out of bounds"
[16:56:14] [debug]  Accessing element at index 10 past array upper bound 9
[16:56:14] [debugAMX backtrace:
[
16:56:14] [debug#0 00287648 in public PayDay2 () from I-RP.amx
[16:56:14] [debug#1 0011d8f4 in public JB_OnPlayerCommandText (1, 6079916) from I-RP.amx
[16:56:14] [debug#2 native CallLocalFunction () from samp03svr
[16:56:14] [debug#3 00012428 in public OnPlayerCommandText (1, 6079864) from I-RP.amx 
Can anyone tell me what it means? and how i can find what line the error is?
Reply
#2

Show us what the commands look like.
Reply
#3

Make sure to return 1 in your command.
Reply
#4

Post the functions OnPlayerLogin, SetPlayerToFactionColor, PayDay and PayDay2. The problem is that the size of an array used in those functions has size of 10 (valid indexes are 0 to 9) and 10 is passed as index which gets out-of-bounds.

The most common mistake about such issues happens in loops because people loop until it's lower or equal to the size of the array which is wrong. The index (iterator variable) should never be equal to the size.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)