Question related to enum
#1

Hello,
Can I use enums like that:

Код:
enum pCInfo
{
	pName[MAX_PLAYER_NAME],
	pExp,
	pFreePoints,
	pAircraftLvl,
	pTankLvl,
	pSparrowLvl,
	pHunterLvl,
	pHeliLvl,
	pKills,
	pDeaths,
    Float:pHealth, Float:pArmor
}
new PlayerClassInfo[MAX_PLAYERS][4][pCInfo];
PlayerClassInfo[playerid][1][pCInfo], PlayerClassInfo[playerid][2][pCInfo] and etc would be different variables.

I just need to store four classes data for each player.
Reply
#2

I think you have to use simply

pawn Код:
enum pCInfo
{
        pName[MAX_PLAYER_NAME],
    pExp,
    pFreePoints,
    pAircraftLvl,
    pTankLvl,
    pSparrowLvl,
    pHunterLvl,
    pHeliLvl,
    pKills,
    pDeaths,
        Float:pHealth,
        Float:pArmor,
}
new PlayerClassInfo[MAX_PLAYERS][pCInfo];
Reply
#3

I wan't to use this enum for each player + 4 enums per player, because I have 4 classes in database for each player. Player will be able to switch to any other class anytime he wants.

So this can't be made like that:
Quote:

new PlayerClassInfo[MAX_PLAYERS][4][pCInfo];

?

PlayerClassInfo[playerid][1][pName] == Medic;
PlayerClassInfo[playerid][2][pName] == Engineer;
And etc.
Reply
#4

pawn Код:
new PlayerClassInfo[MAX_PLAYERS][pCInfo][4];

PlayerClassInfo[playerid][item][class] = anythink;
Reply
#5

use this for that.
pawn Код:
enum pInfo
{
ptype[24],
}
new Player[MAX_PLAYERS][pInfo];
use it for Player[playerid][ptype] = any number you want to set for the type;
Reply
#6

Quote:
Originally Posted by Tigerkiller
Посмотреть сообщение
pawn Код:
new PlayerClassInfo[MAX_PLAYERS][pCInfo][4];

PlayerClassInfo[playerid][item][class] = anythink;
Thanks, gonna test it.
Reply
#7

it should work
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)