AdminLevel
#1

Hi all,im making registration system with admin system,i've the variable AdminLevel, i need to add 3 levels to this.

Admin level 1,Admin level 2 and Admin level 3.

Any way to do?

The registration system is this.

Код:
enum pInfo
{
     AdminLevel,
     Cash,
     Score,
}
Any help?Thanks.
Reply
#2

Just save their admin variable, if dini:
pawn Код:
dini_IntSet(YOURFILE, "Admin", playerinfo[playerid][AdminLevel]); // Saves admin level 5.
and then load that player's variables:
pawn Код:
dini_Int(YOURFILE, "Admin", Value);
pawn Код:
CMD:test(playerid, params[])
{
    if(playerinfo[playerid][AdminLevel] >= 5) // only admin lvl 5 can use the command
To set them admin level:
pawn Код:
CMD:makeadmin(playerid, params[])
{
    new PID, Level;
    if(sscanf(params, "ui", PID, Level)) return /* Error Message */
    // Add other filters here
    playerinfo[PID][AdminLevel] = Level;
    return 1;
}
Reply
#3

Got it.Thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)