[HELP] Debuged command /p array index of bounds - 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: [HELP] Debuged command /p array index of bounds (
/showthread.php?tid=520568)
[HELP] Debuged command /p array index of bounds -
Luca12 - 19.06.2014
Hello I was finally debuged my gamemode and in server log it says [16:48:23] [debug] Run time error 4: "Array index out of bounds"
[16:48:23] [debug] Accessing element at negative index -1
[16:48:23] [debug] AMX backtrace:
that error is in command /p
at this line : RazgovaraSa[ZoveGa[playerid]] = PozivZa[ZoveGa[playerid]];
Re: [HELP] Debuged command /p array index of bounds -
Konstantinos - 19.06.2014
pawn Код:
if (ZoveGa[playerid] != -1) RazgovaraSa[ZoveGa[playerid]] = PozivZa[ZoveGa[playerid]];
Re: [HELP] Debuged command /p array index of bounds -
Luca12 - 19.06.2014
that's the same error is show at this code:
naplatipoziv[RazgovaraSa[playerid]] = SetTimerEx("UzmiZaPoziv",Min(1),true,"d",Razgovara Sa[playerid]);
Re: [HELP] Debuged command /p array index of bounds -
Konstantinos - 19.06.2014
Then
RazgovaraSa[playerid] is -1 so you should do the same method as above (checking if the variable is not -1 and use it inside the array).
I'm pretty sure those are probably the default values for those variables and it does not set the values as it was supposed to and it will never call the timer as long as
RazgovaraSa[playerid] is -1.