Why we use var for enums?
#1

Hello , i want to know why we need to use variables for enums . For example
PHP код:
enum Pinfo
{
    
Playermoney,
    
Playeradmin
}
new  
Playerinfo[MAX_PLAYERS][Pinfo// Why we need this? 
Reply
#2

We create that with "MAX_PLAYERS", which means we can use it for "playerid".
If not, you couldn't use these variables with players correctly, but you don't need that variable if you're not using it for playerid or something like that.
Reply
#3

An enum is as its name suggest nothing more than an enumeration. It is not an array. It is in fact very similar to doing this:
pawn Код:
#define Playermoney (0)
#define Playeradmin (1)
Although obviously much clearer and much easier to maintain.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)