What to use? Enum or Array?
#1

Hello guys,

Many of you use enums as of saving systems (register/login data), so I want to ask this question here. What if I would use all player data in one enum? I use enums only for saving dates, and arrays for temp data. So, if you don't understand me I'll give an example.

pawn Код:
enum pInfo
{
    pAdmin,
    pKills,
    pDeaths,
    pBanned,
    pVip
};
new PlayerData[MAX_PLAYERS][pInfo];
new gPlayerLogged[MAX_PLAYERS char];
new gPlayerZone[MAX_PLAYERS char];
new gPlayerAFK[MAX_PLAYERS];
new gPlayerName[MAX_PLAYER_NAME];
new gPlayerIp[16];
// more
that's what I'm using currently. But could I move them to pInfo enum? And tell me please difference.

pawn Код:
enum pInfo
{
    pAdmin,
    pKills,
    pDeaths,
    pBanned,
    pVip,
    pLogged,
    pZone,
    pAFK,
    pName[MAX_PLAYER_NAME],
    pIp[16]
    // more
};
new PlayerData[MAX_PLAYERS][pInfo];
Thanks in advise.
Reply


Messages In This Thread
What to use? Enum or Array? - by Yera96 - 14.10.2014, 14:48
Re: What to use? Enum or Array? - by Yera96 - 14.10.2014, 14:57
Re: What to use? Enum or Array? - by silentus - 14.10.2014, 15:11
Re: What to use? Enum or Array? - by Pottus - 14.10.2014, 15:15
Re: What to use? Enum or Array? - by Yera96 - 15.10.2014, 12:51

Forum Jump:


Users browsing this thread: 3 Guest(s)