SA-MP Forums Archive
Need Help in Making Admin System! - 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: Need Help in Making Admin System! (/showthread.php?tid=464856)



Need Help in Making Admin System! - MAFIAWARS - 19.09.2013

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


Re: Need Help in Making Admin System! - alinategh - 19.09.2013

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


Re: Need Help in Making Admin System! - MAFIAWARS - 19.09.2013

Yes I have them Already.


Re: Need Help in Making Admin System! - DavidLuango - 19.09.2013

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 =]


Re: Need Help in Making Admin System! - alinategh - 19.09.2013

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;
}



Re: Need Help in Making Admin System! - MAFIAWARS - 19.09.2013

Thanks