SA-MP Forums Archive
[Tutorial] How to make admin Rank. - 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)
+---- Forum: Tutorials (https://sampforum.blast.hk/forumdisplay.php?fid=70)
+---- Thread: [Tutorial] How to make admin Rank. (/showthread.php?tid=533018)



How to make admin Rank. - SilverSkill - 21.08.2014

Hi in this tutorial i show you how to make rank for admin.
Go to "public OnPlayerConnect(playerid)" and write this:
PHP код:
PlayerInfo[playerid][AdminLevel] = 0;
stock AdminRank(targetid)
{
        new 
adminrank[10];
        switch(
PlayerInfo[targetid][pAdmin])
       {
          case 
0: { adminrank "None"; }
          case 
1: { adminrank "Moderator"; }
          case 
2: { adminrank "Junior"; }
          case 
3: { adminrank "Senior";}
       }
       return 
adminrank;

[/PHP]
This is a short tutorial how to make admin rank.
Sorry for my bad english


Re: How to make admin Rank. - Giannidw - 21.08.2014

This is not a tutorial? If i didn't know this, i learned nothing... Explain each function, each sentence!


Re: How to make admin Rank. - Vince - 21.08.2014

Besides, I think an array might be more effective.
pawn Код:
static const gAdminRanks[][] = {
    "None", // 0
    "Moderator", // 1
    "Junior", // 2
    "Senior" // 3
};

format(msg, sizeof(msg), "Player %d's admin level is: %s", targetid, gAdminRanks[PlayerInfo[targetid][pAdmin]]);



Re: How to make admin Rank. - Ada32 - 21.08.2014

or or, wait for it.. y_groups!