PVars and enums.. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: PVars and enums.. (
/showthread.php?tid=317473)
PVars and enums.. -
kizla - 11.02.2012
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:
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?
Re: PVars and enums.. -
Babul - 11.02.2012
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..