SA-MP Forums Archive
Que podria estar mal aquн? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Español/Spanish (https://sampforum.blast.hk/forumdisplay.php?fid=29)
+---- Thread: Que podria estar mal aquн? (/showthread.php?tid=633741)



Que podria estar mal aquн? - Blackaslan - 06.05.2017

Quote:

[16:32:36] [debug] Run time error 4: "Array index out of bounds"
[16:32:36] [debug] Accessing element at index 6 past array upper bound 5
[16:32:36] [debug] AMX backtrace:
[16:32:36] [debug] #0 0008bc08 in public PoolZombeys () at C:\x.pwn:6795
[16:32:37] [Zombeydere] 3 Zombeys successfully spawned.
[16:32:37] [Zombeydere] 3 Dummy zombies were kicked.
[16:32:37] [connection] incoming connection: 64.110.27.130:49676 id: 0
[16:32:37] [npc:join] [NPC]Hunter has joined the server (0:64.110.27.130)

Linea 6795:

Код:
public PoolZombeys()
{
	new name[MAX_PLAYER_NAME],zombey;
	format(name,sizeof name,"Z%d%d%d",random(10),random(200),random(500));
	zombey = ConnectRNPC(name);
	NPCdere[zombey][dArea] = -1; // 6795
	NPCdere[zombey][dPool] = true;
	if(zombey < DUMMY_QUANT + MAX_ZOMBEY) SetTimer("PoolZombeys",70,false);
	return 1;
}



Respuesta: Que podria estar mal aquн? - Parka - 06.05.2017

El arreglo NPCdere estб obteniendo un valor de la variable zombey que es mayor a el tamaсo dado, es decir, el tamaсo del arreglo es 5 y esta accediendo al 6 el cual no existe.