Help! Run time erorr
#1

When I login the server restarts

How to fix this?

[00:07:57] [debug] Run time error 4: "Array index out of bounds"
[00:07:57] [debug] Accessing element at index 1500 past array upper bound 1499
[00:07:57] [debug] AMX backtrace:
[00:07:57] [debug] #0 0011fc2c in public FC_OnGameModeInit () from internationalrp.amx
[00:07:57] [debug] #1 native CallLocalFunction () [080dc980] from samp03svr
[00:07:57] [debug] #2 0000db7c in public SSCANF_OnGameModeInit () from internationalrp.amx
[00:07:57] [debug] #3 native CallLocalFunction () [080dc980] from samp03svr
[00:07:57] [debug] #4 00005908 in public YVers_OnScriptInit () from internationalrp.amx
[00:07:57] [debug] #5 native CallLocalFunction () [080dc980] from samp03svr
[00:07:57] [debug] #6 0000503c in public Timers_OnScriptInit () from internationalrp.amx
[00:07:57] [debug] #7 native CallLocalFunction () [080dc980] from samp03svr
[00:07:57] [debug] #8 00004dbc in public Streamer_OnGameModeInit () from internationalrp.amx
[00:07:57] [debug] #9 native CallLocalFunction () [080dc980] from samp03svr
[00:07:57] [debug] #10 0000291c in public Itter_OnGameModeInit () from internationalrp.amx
[00:07:57] [debug] #11 native CallLocalFunction () [080dc980] from samp03svr
[00:07:57] [debug] #12 0000077c in public OnGameModeInit () from internationalrp.amx
Reply
#2

Someone?
Reply
#3

it's up to you to make sure that the code you write is safe and won't cause any errors that the compiler can't catch. luckily, it's caught upon run time...

anyway, you're trying to access the 1500 element. take the following examples,

pawn Код:
new arr[1500]; //0 - 1499
    arr[1500] = 10;
Код:
error 032: array index out of bounds (variable "arr")
caught by the compiler ^

pawn Код:
new arr[1500];
for(new i = 0; i < 1501; i++)
{
    arr[i] = i++;
}
legal and will compile fine, but not intended (will be caught upon run time)
Reply
#4

Hmm run time error, it happens when you just type in incorrectly.. and Compiler doesn't catch that
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)