stock AdminLevelName(playerid)
{
new staffname[256];
switch(pInfo[playerid][pAdmin]) //line of proble, the pInfo thing
{
case 0: staffname = "Member";
case 1: staffname = "Helper";
case 2: staffname = "Moderator";
case 3: staffname = "Manager";
case 4: staffname = "Head Admin";
case 5: staffname = "Founder";
}
return staffname;
}
enum pInfo
{
pPass,
pLog,
pCash,
pBleed,
pSleep,
pEXP,
pNEXP,
pLv,
pAdmin,
pKills,
pDeaths,
pSpawn,
pSkin,
pSlot,
pSlotu,
pBanned,
pHunger,
pThirst,
pMale,
pHas,
pNoR,
pWeapon[13],
pWeapona[13],
pAmmoColt,
pAmmoShotgun,
pAmmoSMS,
pAmmoAus,
pAmmoRifle,
Float:hp,
Float:sposx,
Float:sposy,
Float:sposz
}
PHP код:
|
enum PlayerStats
{
pPass,
pLog,
pCash,
pBleed,
pSleep,
pEXP,
pNEXP,
pLv,
pAdmin,
pKills,
pDeaths,
pSpawn,
pSkin,
pSlot,
pSlotu,
pBanned,
pHunger,
pThirst,
pMale,
pHas,
pNoR,
pWeapon[13],
pWeapona[13],
pAmmoColt,
pAmmoShotgun,
pAmmoSMS,
pAmmoAus,
pAmmoRifle,
Float:hp,
Float:sposx,
Float:sposy,
Float:sposz
}
new pInfo[MAX_PLAYERS][PlayerStats];
If I Rename That, I Got bunch Of Things To Rename.
I Just Do: switch(PlayerInfo[playerid][pAdmin]) BTW, thanks for reply, +1 |
You didn't do the enum correctly, like you did, the only thing you need to do is:
1) Change the name of the enum to anything 2) Do this: new pInfo[MAX_PLAYERS][-YOUR-ENUM-NAME-]; You shouldn't have any errors, because this is the correct way of doing it, what you showed me before, you were using the enum's name, instead you need to create for it, look at what I did, maybe you'll understand it, but the code I gave you is the correct way to use an enum. BTW: You are supposed to put the new variable for the enum under the enum. Note: This is only the var you are creating to use the enum, if you have used everything with pInf[etc][etc] Then you should have ZERO errors. |
that is just edit, i thought, it was like from my other scripts. so now i use PlayerInfo
|