SA-MP Forums Archive
Enumerator question - 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: Enumerator question (/showthread.php?tid=630922)



Enumerator question - [DK]Dark_Knight - 20.03.2017

Can you have two or more enums with the same const name without any unwanted effects?
or
Would it be better to prefix them with something?

example:
Код:
enum e_MyEnum
{
    e_First,
    e_Test
}
new EnumTest[MAX_PLAYERS][e_MyEnum];

enum e_SecondEnum
{
    e_Test,
    e_Another
}
new AnotherEnum[MAX_PLAYERS][e_SecondEnum];

EnumTest[0][e_Test] = AnotherEnum[0][e_Test];



Re: Enumerator question - AndySedeyn - 20.03.2017

Yes, you can. And I prefix enumerators with the initials of the enum in which they're defined:

Код:
enum E_PLAYER_DATA {

    epd_Something // epd = E_PLAYER_DATA
};