PVars and enums..
#1

In my mod i use for admin variable this:

pawn Код:
enum Info
{
    Admin
}
new P_Data[MAX_PLAYERS][Info];
And when i use it i do this:

pawn Код:
P_Data[playerid][Admin]
and in my FS i have like this:

pawn Код:
if(GetPVarInt(playerid, "Admin") < 1)return SendClientMessage(playerid, -1, "You are not Admin!");
and where is problem? with PVars or?
Reply
#2

yes. you need to set the admin level for a palyer as a PVar before getting it the same way:
pawn Код:
SetPVarInt(playeird,"Admin",P_Data[playerid][Admin]);
set it each time when you set the enum aswell, or better: delete all enum variables, and completedly change them to pvars, you wont need the enum anymore.
its not a good idea to change ALL variables to PVars btw..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)