11.04.2012, 12:00
Hello all.
I am trying to understand how to effectively use enumeration in my script. This is my current enumeration:
So, i'm trying to create a command which shows what level you are
BUT, when I type it in-game, it shows that I only have level 0 permissions, even though I have level 2 permissions (set in my MySQL database). I know I am doing something wrong, I just need some help to identify what it is i'm doing wrong. (Still trying to learn how to properly use if/switch statements)
Thanks
I am trying to understand how to effectively use enumeration in my script. This is my current enumeration:
pawn Код:
enum PlayerInfo
{
AdminLevel,
}
new pinfo[MAX_PLAYERS][PlayerInfo];
pawn Код:
CMD:mypermissions(playerid, params[])
{
if(pinfo[playerid][AdminLevel] == 0) return MESSAGE(cwhite, "You have level 0 permissions. (Player)");
if(pinfo[playerid][AdminLevel] == 1) return MESSAGE(cyellow, "You have level 1 permissions. (VIP)");
if(pinfo[playerid][AdminLevel] == 2) return MESSAGE(clightblue, "You have level 2 permissions. (Jr. Mod)");
if(pinfo[playerid][AdminLevel] == 3) return MESSAGE(clightblue, "You have level 3 permissions. (Moderator)");
if(pinfo[playerid][AdminLevel] == 4) return MESSAGE(cred, "You have level 4 permissions. (Admin)");
return 1;
}
Thanks