Enum to check another enum?
#1

Hey guys, im trying to create a faction enum that will be readable from my playerinfo enum... Im not sure if thats possible? well basically heres what im trying to do..

pawn Code:
enum pFactions
{
    SAPD,
    GOV
}


enum pInfo
{
    pPass,
    pCash,
    Float:pPos[3],
                      pFactions,
    pAdmin,
    pKills,
    pDeaths
}
pFactions is loose so you can see what im trying to do..
So basically i want the pInfo enum to check the values of the pFaction variables..

Im pretty new to scripting so im not sure, Is this the best way to create factions?
Reply
#2

Why dont you simply make in 1 enum
Reply
#3

Quote:
Originally Posted by dr.lozer
View Post
Why dont you simply make in 1 enum
You mean like?
pawn Code:
enum pInfo
{
    pPass,
    pCash,
    Float:pPos[3],
    pAdmin,
                       fSAPD,
                       fGOV,
    pKills,
    pDeaths
}
Like that?
Reply
#4

If it's for player, you can create a variable executing the enum info under the enum.
pawn Code:
new PlayerInfo[MAX_PLAYERS][pInfo];
Now the enum can be used as : PlayerInfo[playerid][pPass] etc.
Reply
#5

Quote:
Originally Posted by Lordz™
View Post
If it's for player, you can create a variable executing the enum info under the enum.
pawn Code:
new PlayerInfo[MAX_PLAYERS][pInfo];
Now the enum can be used as : PlayerInfo[playerid][pPass] etc.
Yea thats kinda what i had before on my first faction attempt but i didn't think it looked.. well.. "professional"? As i would have all the factions and their ranks in the user file would just look like

Pass = ********
Cash = 13434
x = 123123.3434
y = 3535.6456
z = 12.3
Admin = 0
Kills = 9
Deaths = 12
SAPD = 4
GOV = 0
HITMAN = 0
FBI = 0

etc if that makes sence?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)