SA-MP Forums Archive
Problem bugs crash - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Problem bugs crash (/showthread.php?tid=406701)



Problem bugs crash - cristi_bubu - 11.01.2013

Код:
    [13:15:24] [debug] AMX backtrace:
    [13:15:24] [debug] #0 00047eb0 in public OtherTimer () from eXtream.amx
    [13:15:25] [debug] Run time error 4: "Array index out of bounds"
    [13:15:25] [debug]  Accessing element at index 255 past array upper bound 99
-> public OtherTimer in gamemode

http://pastebin.com/2Dge3TdU

Код:
    [15:01:42] [debug] AMX backtrace:
    [15:01:42] [debug] #0 0001aeac in ?? () from eXtream.amx
    [15:01:42] [debug] #1 00002af8 in public Streamer_OnPlayerDisconnect () from eXtream.amx
    [15:01:42] [debug] #2 00001588 in public OnPlayerDisconnect () from eXtream.amx
    [15:01:42] [debug] #3 native Kick () [080d5430] from samp03svr
    [15:01:42] [debug] #4 0002ddd0 in public JBC_OnDialogResponse () from eXtream.amx
    [15:01:42] [debug] #5 00001c40 in public OnDialogResponse () from eXtream.amx
-> public OnPlayerDisconnect din gamemode

http://pastebin.com/An4ZKtjt

-> public OnDialogResponse in gamemode

http://pastebin.com/Vuj0DvJT

Код:
    [15:02:18] [debug] Run time error 4: "Array index out of bounds"
    [15:02:18] [debug]  Accessing element at index 266 past array upper bound 264
    [15:02:18] [debug] AMX backtrace:
    [15:02:18] [debug] #0 0004205c in public OnPlayerStateChange () from eXtream.amx
-> public OnPlayerStateChange in gamemode

http://pastebin.com/qxbQ2vJn


Re: Problem bugs crash - cristi_bubu - 12.01.2013

Nothing?


Re: Problem bugs crash - Konstantinos - 12.01.2013

About the first, it should be up to 99 to the array, but you pass an array of 255. Check where you have 255 and search for your mistake. The other callbacks are a part of the code, you need to post everything from the callback.


Re: Problem bugs crash - cristi_bubu - 12.01.2013

Quote:
Originally Posted by Dwane
Посмотреть сообщение
About the first, it should be up to 99 to the array, but you pass an array of 255. Check where you have 255 and search for your mistake. The other callbacks are a part of the code, you need to post everything from the callback.
I don't understand


Re: Problem bugs crash - Konstantinos - 12.01.2013

1.
pawn Код:
//An example:
#define MAX_SOMETHING 99
new
    something[ MAX_SOMETHING ] // The max cell of array is 99
;

// Somewhere
something[ 255 ] = value; // "Array index out of bounds", the max was 99 and you're using value over the max (255).
For the others callbacks, part of code were missing. Post the whole callback.


Re: Problem bugs crash - cristi_bubu - 12.01.2013

What?


Re: Problem bugs crash - Konstantinos - 12.01.2013

I will try to explain it as simply as I can. You have an array [ ] with size of 99 and somewhere on the timer's callback, you're using over the max (99). You're using 255 instead.


Re: Problem bugs crash - cristi_bubu - 12.01.2013

Change [255] in [99] ?


Re: Problem bugs crash - Konstantinos - 13.01.2013

Kinda. There's somewhere that gets cell of 255 value instead of 99. It can be either as a number or as a name. Be sure what you will change because it may cause more problems. That's why you need the debug.