SA-MP Forums Archive
Ayuda con este error porfavor - 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: Ayuda con este error porfavor (/showthread.php?tid=634668)



Ayuda con este error porfavor - Blackaslan - 23.05.2017

Hola , me preguntaba si alguien podria ayudarme a resolver este error porfavor:

Quote:

[ [debug] Run time error 4: "Array index out of bounds"
[debug] Accessing element at index 99 past array upper bound 48
[debug] AMX backtrace:
[debug] #0 0008df24 in crearBarraSalud (npcid=99) at C:\x:7016
[debug] #1 0008bd64 in crearZombie (name[]=@000a3028 "Zombie_0") at C:\x.pwn:6779
[debug] #2 0008bc80 in crearZombies () at C:\x:6764
[debug] #3 00043148 in main () at C:\x.pwn:582
Script[gamemodes/x.amx]: Run time error 4: "Array index out of bounds"

linea 7106:

Код:
stock crearBarraSalud(npcid)
{
	static Float:saludZombie;
	static string[32];
	saludZombie = FCNPC_GetHealth(npcid);
	format(string, sizeof(string), "Zombie\n%.2f\tHP", saludZombie);
	labelZombies[npcid] = Create3DTextLabel(string, -1, 0, 0, 0, 100.0, 0, 1);
	Attach3DTextLabelToPlayer(labelZombies[npcid], npcid, 0, 0, 1.3);
}



Re: Ayuda con este error porfavor - Blackaslan - 23.05.2017

Solucionado, tenia esto : new Text3D:labelZombies[MAX_ZOMBIES]; y era asi : new Text3D:labelZombies[MAX_PLAYERS]