Need Help in Making Admin System!
#1

Hello! I would like to learn the Admin System for RPG Server.

I want to learn:

/admin cmd to see the Online Administrators like this:

List of Online Administrators:
<1> MAFIA_WARS
End of List:

and Admins level System and also /makeadmin <level> CMD.

Help Me
Reply
#2

First of all, you need to have Register/Login system and Database to save your players accounts, do you have them already?
Reply
#3

Yes I have them Already.
Reply
#4

Here is the idea

if (strcmp(cmd, "/admins", true) == 0)
{
if(IsPlayerConnected(playerid))
{
SendClientMessage(playerid, COLOR_YELLOW5,"___________________________________ _______________________");
SendClientMessage(playerid, COLOR_LIGHTYELLOW5," Admin onlines ");
foreach (Player,i)
{
if(PlayerInfo[i][pHidden] == 0)
{
if(PlayerInfo[i][pAdmin] >= 1)
{
new admtext[64];
if(PlayerInfo[i][pAdmin] == 10) { admtext = "<11>"; }
else if(PlayerInfo[i][pAdmin] == 4) { admtext = "<1>"; }

else { admtext = "Level 1 Administrator"; }
GetPlayerName(i, sendername, sizeof(sendername));
GiveNameSpace(sendername);


I am not going to post the full code so you don't just C+P and learn nothing I've gave you the idea.

if you need more help, I'll be more than happy to help you you =]
Reply
#5

pawn Код:
CMD:admins(playerid, params[])
{
  SendClientMessage(playerid, -1, "____Administration Team____");
  for(new i = 0; i < MAX_PLAYERS; i++)
  {
    if(PlayerInfo[i][admlvl] >= 1)
    {
       new string[128], pname[24];
       GetPlayerName(i, pname, sizeof(pname));
       format(string, sizeof(string), "%s - Level: %d (ID:%d)", pname, PlayerInfo[i][admlvl], i);
       SendClientMessage(playerid, -1, string);
    }
  }
  return 1;
}
Reply
#6

Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)