SA-MP Forums Archive
Array index out of bonus - 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: Array index out of bonus (/showthread.php?tid=646443)



Array index out of bonus - RedGun2015 - 17.12.2017

Hello guys, I have this problem with my cheats report on my server.

I get this error:
Код:
[11:23:23] [debug] Run time error 4: "Array index out of bounds"
[11:23:23] [debug] AMX backtrace:
[11:23:23] [debug] #0 001140c0 in public misc_timer () at D:\gamemode\gamemodes\exgaming.pwn:16718
I get this error because I have this function in my global timer (1sec):
Код:
foreach(new k : Cheateri) {
		if(Cheaters[k][cheatValid] && (gettime()-Cheaters[k][cheatTime]) >= 240) {
			Cheaters[k][cheatValid] = 0;
			Cheaters[k][cheatPlayer] = INVALID_PLAYER_ID;
			Cheaters[k][cheatCheater] = INVALID_PLAYER_ID;
			Cheaters[k][cheatTime] = 0;
			new cur = k;
			Iter_SafeRemove(Reporturi, cur, k);
		}
	}
The line is this
Код:
if(Cheaters[k][cheatValid] && (gettime()-Cheaters[k][cheatTime]) >= 240)
How can I fix?


Re: Array index out of bonus - IvanElistratov - 17.12.2017

foreach(new k : Player) {


Re: Array index out of bonus - RedGun2015 - 18.12.2017

Quote:
Originally Posted by IvanElistratov
Посмотреть сообщение
foreach(new k : Player) {
I use Iterators man


bump


Re: Array index out of bonus - raydx - 18.12.2017

What value is printed by crashlog?


Re: Array index out of bonus - RedGun2015 - 23.12.2017

Solved.