need help with enum - 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: need help with enum (
/showthread.php?tid=434451)
need help with enum -
mineralo - 02.05.2013
well, I tested some stuff and I need enum in enum but when I do it I get error
pawn Код:
enum SkinInfo
{
sOwned,sOwner[25]
}
enum pGlobalInfo
{
bool:CarsLoading,timer[3],Text:TimeTextDraw,Text:WebsiteTextDraw,Text:DateTextDraw,IconsSys[MAX_INTERIRS],InterIcons[MAX_ICONS],PlayerText:TextDrawPos[MAX_PLAYERS],
Text:SkinBackTextDraw,Text:SkinNameTextDraw,PlayerText:PlayerSkinInfo[MAX_PLAYERS],PlayerText:SelectSkin[MAX_PLAYERS],
Skins[300][SkinInfo] //line 83
}
new ServerGlobalInfo[pGlobalInfo];
error
Код:
gm.pwn(83) : error 001: expected token: "}", but found "["
after I added Skins[300][SkinInfo] into enum I get this error, any ideas?
Re: need help with enum -
Yashas - 02.05.2013
There is an alternat to use 2 Dimensional arrays
Create
Код:
enum lol
{
a[20]
}
#define a][%0][%1] a][MAX_SIZE*%0 + %1]
Now you can use
Код:
new lol[2];
lol[1][a][0][5] //it will work :D
Use this
forumla MAX_SIZE*num1 + num2
****** - Hope this works in PAWN.Will it??
Re: need help with enum -
mineralo - 02.05.2013
Quote:
Originally Posted by ******
You can't have 2D arrays in enums.
|
thanks anyway :/