Add to Admin List upon connect
#1

Well I was wondering what I can script to make it so admins appear on the list upon connect.
This is what I have for an admin to add themselves to the list. But, they must type /turn then select appear in admin list.

Код:
	else if(PlayerInfo[playerid][pAppearList] == 0)
					{
					   	PlayerInfo[playerid][pAppearList] = 1;
				        SendClientMessage(playerid, COLOR_GREY, "* You have added yourself from the Online Admin List!");
				        format(string, sizeof(string), "[ADMIN]: %s has added himself from the Online Admin List.",sendername);
				        ABroadCast(COLOR_LIGHTRED, string, 5);
					}

I was thinking That maybe I could add like a function under,
OnPlayerConnect
Reply
#2

after they did /turn

you need a variables like
PHP код:
 new pTurned;
and 
than if(PlayerInfo[playerid][pTurned] == 1) {
// commmad to show admins

PHP код:

if(PlayerInfo[playerid][pAdminLevel] >= 1// change admin level to yours
                    
{
                           
PlayerInfo[playerid][pTurned] = 1;
                        
SendClientMessage(playeridCOLOR_GREY"* You have added yourself from the Online Admin List!");
                        
format(stringsizeof(string), "[ADMIN]: %s has added himself from the Online Admin List.",sendername);
                        
ABroadCast(COLOR_LIGHTREDstring5);
return 
1
}
Reply
#3

You should use foreach like this
pawn Код:
CMD:admins(playerid,params[])
{
    foreach(Player, i)
    {
        new level[128],status[200], string[128];

        if(PlayerInfo[i][pAdmin] >= 1)
        {
            switch(PlayerInfo[i][pAdmin])
            {
                case 1: level = "[Trial Staff Member] ";
                case 2: level = "[Junior Moderator] ";
                case 3: level = "[Moderator] ";
                case 4: level = "[Junior Admin] ";
                case 5: level = "[Lead Admin] ";
                case 6: level = "[Community Co-Owner] ";
                case 7: level = "[Community Owner] ";
            }
            // Other if ststement removed to stop copying of my main code
            format(string, sizeof(string), "%s %s\n", level, GetName(i));
            ShowPlayerDialog(playerid, DIALOG_ONLINE_ADMINS, DIALOG_STYLE_LIST, "Online Staff", string, "Close", "");
        }
        else{
        ShowPlayerDialog(playerid, DIALOG_ONLINE_ADMINS, DIALOG_STYLE_LIST, "Online Staff", "[SERVER] Anti-Cheat Is: Administrating", "Close", "");
        }
    }
    return 1;
}
PS, Code updated this is the one i made for my server
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)