Foreach - Multidimensional Array - 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: Foreach - Multidimensional Array (
/showthread.php?tid=524414)
Foreach - Multidimensional Array -
Noliax8 - 06.07.2014
EDIT: Iter_Init (F_ObjetWhere); ON THE GAMEMODEINIT()!
Hi,
I trying to create a multidimensional array, but i've a problem !
pawn Код:
new Iterator:F_ObjetWhere[5]<20>;
The compilation is ok, but when i go in game, the server flood SendClientMessage's...
Do you have an idea?
Thank you
Re : Foreach - Multidimensional Array -
Noliax8 - 07.07.2014
I've not use Iter_Init(), so when i've do a debug, the loop is infinite.
But, I repaired this problem, and I have a another problem.
pawn Код:
new Iterator:F_PocheList[MAX_PLAYERS][MAX_PERSOS];
new Iterator:F_PocheID[MAX_PLAYERS][MAX_PERSOS][MAX_OBJETS_ID];
public OnGameModeInit()
{
Iter_Init(F_PocheList); // ERRORS ARE HERE
Iter_Init(F_PocheID);
}
Quote:
C:\Users\UnJuif\Desktop\GM\gamemodes\base.pwn(90) : error 017: undefined symbol "F_PocheList@YSII_Ag"
C:\Users\UnJuif\Desktop\GM\gamemodes\base.pwn(90) : error 017: undefined symbol "F_PocheList@YSII_Ag"
C:\Users\UnJuif\Desktop\GM\gamemodes\base.pwn(90) : error 017: undefined symbol "F_PocheList@YSII_Ag"
C:\Users\UnJuif\Desktop\GM\gamemodes\base.pwn(90) : fatal error 107: too many error messages on one line
|
I really need Multidimensional array, and I love foreach, it's very very practice !
Thank you for your help ******
Re: Foreach - Multidimensional Array -
Konstantinos - 07.07.2014
I doubt F_PocheID can be done with foreach. About the F_PocheList:
pawn Код:
new Iterator:F_PocheList[MAX_PLAYERS]<MAX_PERSOS>;