SA-MP Forums Archive
Enum Array String Help - 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: Enum Array String Help (/showthread.php?tid=566562)



Enum Array String Help - maxisaibot - 06.03.2015

Код:
enum test
{
     testvar,
     testtext[6][32]
}
how can i use testtext? Thats codes giving error


Re: Enum Array String Help - wooolly - 06.03.2015

this is a snippet from my server:

Quote:

enum e_pInfo
{
pUserid,
}
new g_PlayerInfo[MAX_PLAYERS][e_pInfo],

you can then access it using g_PlayerInfo[playerid][pUserid]

You could just change this code to fit your own uses of course playerid probably won't be necessary if it isn't user data.


Re : Enum Array String Help - Golimad - 06.03.2015

Код:
enum test
{
     testvar,
     testtext[32]
}
new Something[MAX_PLAYERS][Enum name which is test]

What you can't do is :
Something[MAX_PLAYERS][testtext] ="....."
because Enums are not arrays.
you can use strmid or format I think to insert text in it.
Or 
new testtext[6][32];
testtext[0..5]="Working";