[help] Helpers/Admins list
#1

Hello i want to add command for helpers and admins system . When player type /admins he will get a list of admins ( in dialog box) level 1 admin will be Moderator , level 2 for Super Moderator , Level 3 for Admin , Level 4 for Senior Admin and Level 5 for Senior Admin .
And when they type /helpers they get the list of helpers (in dialog box).
Reply
#2

Код:
CMD:admins(playerid,params[])
{
    new Count, string[128];
    SendClientMessage(playerid, COLOR_RED, "__________|Online Admins|__________");
    SendClientMessage(playerid, COLOR_RED, "                                   ");
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
       if(IsPlayerConnected(i))
       {
          if(PlayerInfo[i][pAdmin] >=1)
		  {
             format(string,sizeof(string),"| Admin: %s(ID:%d) || Level: %s(%d) |",PlayerName(i),i,AdminLevelName(i),PlayerInfo[i][pAdmin]);
             SendClientMessage(playerid,COLOR_RED,string);
             Count++;
          }
	   }
    }
    if(Count == 0) SendClientMessage(playerid, COLOR_RED, "None Admin Online");
    SendClientMessage(playerid, COLOR_RED, "____________________________");
    return 1;
}CMD:admins(playerid,params[])
{
    new Count, string[128];
    SendClientMessage(playerid, COLOR_RED, "__________|Online Admins|__________");
    SendClientMessage(playerid, COLOR_RED, "                                   ");
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
       if(IsPlayerConnected(i))
       {
          if(PlayerInfo[i][pAdmin] >=1)
		  {
             format(string,sizeof(string),"| Admin: %s(ID:%d) || Level: %s(%d) |",PlayerName(i),i,AdminLevelName(i),PlayerInfo[i][pAdmin]);
             SendClientMessage(playerid,COLOR_RED,string);
             Count++;
          }
	   }
    }
    if(Count == 0) SendClientMessage(playerid, COLOR_RED, "None Admin Online");
    SendClientMessage(playerid, COLOR_RED, "____________________________");
    return 1;
}
Код:
stock AdminLevelName(playerid)
{
	new adminlevelname[128];
	switch(PlayerInfo[playerid][pAdmin])
	{
		case 0: adminlevelname = "Player";
		case 1: adminlevelname = "Basic Admin";
		case 2: adminlevelname = "Junior Admin";
		case 3: adminlevelname = "Senior Admin";
		case 4: adminlevelname = "Lead Admin";
		case 5: adminlevelname = "Head Admin";
		case 6: adminlevelname = "Community Co-Owner";
		case 7: adminlevelname = "Community Owner";
	}
	return adminlevelname;
}
You could do the same with Helpers!
Reply
#3

AS i wrote i want it in Dialog Box not in the messages line.
Reply
#4

Well make a ShowPlayerDialog, or just get a scripter on the Scripter Request part , do not ask people to script you stuff and not appreciate it.
Reply
#5

pawn Код:
// The command "/admins".
CMD:admins(playerid, params[])
{
        new count = 1, string[828];
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i) && adminLevel[i] >= 1)
            {
                // String
                format(string, sizeof(string), "%s(%i) - Admin Level: %i\n",PlayerName(i), i, adminLevel[i]);
                count ++;
            }
        }

        if(count != 1)
        {
            // Shows the admins that are present
            ShowPlayerDialog(playerid, 200, DIALOG_STYLE_MSGBOX, "Online Administrators", string, "Close", "");
        }
        else
        {
            // No admins online
            ShowPlayerDialog(playerid, 200, DIALOG_STYLE_MSGBOX, "Online Admins", "{FFFFFF}There are no administrators online at the moment.", "OK", "");
        }
    }
    return 1;
}
// The command "/helpers".
CMD:helpers(playerid, params[])
{
        new count = 1, string[828];
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i) && helperLevel[i] >= 1)
            {
                // String
                format(string, sizeof(string), "%s(%i) - Helper Level: %i\n",PlayerName(i), i, helperLevel[i]);
                count ++;
            }
        }

        if(count != 1)
        {
            // Shows the helpers that are present
            ShowPlayerDialog(playerid, 200, DIALOG_STYLE_MSGBOX, "Online Helpers", string, "Close", "");
        }
        else
        {
            // No helpers online
            ShowPlayerDialog(playerid, 200, DIALOG_STYLE_MSGBOX, "Online Helpers", "{FFFFFF}There are no helpers online at the moment.", "OK", "");
        }
    }
    return 1;
}
Do not forget to change the variables, the dialog IDs, all that.
Reply
#6

Quote:
Originally Posted by MrCallum
Посмотреть сообщение
Well make a ShowPlayerDialog, or just get a scripter on the Scripter Request part , do not ask people to script you stuff and not appreciate it.
Actually, it's your fault -- He clearly stated that he wants it in a dialog.


pawn Код:
CMD:admins(playerid, params[]) {
    new string[256], count = 0;
    foreach(Player, i)
    {
        if(!PlayerInfo[ i ][ AdminLevel ]) continue;
       
        format(string, sizeof(string), "%s\n{64CC66}%s %s{FFFFFF}(%d)", string, AdminRank(i), PlayerInfo[ i ][ PlayerName ], i), count++;
    }
    if(count) ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "List of online administrators" , string, "Close", "");
    else ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "Note" , "There aren't any online administrators.", "Close", "");
    return 1;
}
stock AdminRank(playerid)
{
    new string[16];
    switch(PlayerInfo[ playerid ][ AdminLevel ])
    {
        case 0: string = "Player";
        case 1: string = "Moderator";
        case 2: string = "Super Moderator";
        case 3: string = "Admin";
        case 4: string = "Senior Admin";
        case 5: string = "Head Admin";
        default: string = "Unknown";
    }
    return string;
}
Change AdminLevel and PlayerName to your variable/array.
You should be able to make the '/helpers' command by your own now.
Reply
#7

I'm sorry but, regardless that people have tried to help you here, You're in the wrong section completely. The SA-MP forums has a topic for people requesting someone to provide code, this is the SCRIPTING HELP section and we HELP you solve issues related to code you've done or tried to do.

My statement still really stands in this community and what its turned into, we're not your slaves, do it yourself and we'll help you with your issues, otherwise don't do it at-all.
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)