Admin Levels?
#1

Hello, I was wondering how I would make admin levels, I forgot how you start like
stock AdminLevel
{
// dunno what to put here
}

I honestly can't remember, thanks!
Reply
#2

Just make a variable:
pawn Код:
new AdminLevel[MAX_PLAYERS];

AdminLevel[playerid] = 1; // Lvl 1 admin.
Reply
#3

No...
pawn Код:
stock pInfo
{
   AdminLevel,
   //other useful variables
}
You must have player info lol
Reply
#4

Make a enum if you are going to make saving system
than variables

pawn Код:
enum pInfo
{
    AdminLevel
};
new PlayerData[MAX_PLAYERS][pInfo];
USAGE:

pawn Код:
PlayerData[playerid][AdminLevel] = 10; //Level 10 Admin Level
Reply
#5

No I mean like
stock AdminLevel
{
case 1: "Trial Administrator"...
}
Reply
#6

Is the stock to make the player a desired admin level or simply state the name?


Quote:
Originally Posted by Cjgogo
Посмотреть сообщение
You must have player info lol
No you don't..
Reply
#7

I get this idea from LuxAdmin

pawn Код:
new RankA[80]; //at the top of script

//at the stock function

switch(PlayerData[playerid][AdminLevel])
{
    case 1: RankA = "Trial Admin";
}
Reply
#8

pawn Код:
new AdminLevel[MAX_PLAYERS];


stock SetAdminLevel(playerid, level)
{
    AdminLevel[playerid] = level;
    return 1;
}
Like this?
Reply
#9

Basically what I want is when I'm making an admin command it would be like: say if there level one admin which would be Server Moderator: %s %s has just kicked %s!
Server Moderator *NAME* has just kicked *NAME*!

If you know what I mean!

So I need the stock for the admin levels!
Reply
#10

Quote:
Originally Posted by Snipa
Посмотреть сообщение
pawn Код:
new AdminLevel[MAX_PLAYERS];


stock SetAdminLevel(playerid, level)
{
    switch(level)
    {
        case 1: AdminLevel[playerid] = 1;
        case 2: AdminLevel[playerid] = 2;
        case 3: AdminLevel[playerid] = 3;
        case 4: AdminLevel[playerid] = 4;
        case 5: AdminLevel[playerid] = 5;
    }
    return 1;
}
Like this?
Like i give above he wants something like Admin Ranks like in LuxAdmin or in other server.

QUOTE (Previous)

pawn Код:
new RankA[80]; //at the top of script

//at the stock function

switch(PlayerData[playerid][AdminLevel])
{
    case 1: RankA = "Trial Admin";
}
EDITED:

Example:

pawn Код:
new string[128], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
format(string, 128, "%s: %s(%d) has kicked %s(%d)", AdminLevel(playerid), pName, playerid, targetname, targetid);
SendClientMessageToAll(-1, string);
AdminLevel(playerid) - Your stock function
pName - AdminName
playerid - your id
targetname - the one was being kicked (not mention in code)
targetid - the id of player who being kicked (not mention in code)

targetname and targetid is not in code so if you copy/paste it you will get a error
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)