/admins
#1

I have an a duty command but I was wondering if there was a way to make it so I could do /admins and it we should online admins, and Admins on duty would appear green also a /re command that would send your request to on duty admins
Reply
#2

Cara tinha nada para fazer, porйm fiz este comando aqui agora se quiser usa-lo e aperfeiзoa-lo fica ao seu critйrio.
Man had nothing to do but did this command here now if you want to use it and perfect it is at your discretion.
[ ****** Tradutor Owna ;p ]

pawn Код:
if(strcmp(cmd,"/admins", true) == 0)
{
    new string[258];
    if(preso[playerid] == 0)
    {
        SendClientMessage(playerid, 0x7A7A7AAA, "• [BGL] Administradores e Moderadores Conectados •");
        new aname[MAX_PLAYER_NAME];
        new countADM[playerid] = 0;
        new countMOD[playerid] = 0;
        for(new i=0; i<MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {
                if(PlayerInfo[i][Admin] == 1)
                {
                    GetPlayerName(i,aname,sizeof(aname));
                    format(string,sizeof(string),"%s {008000}[ Moderador ]", aname);
                    SendClientMessage(playerid, -1, string);
                    countMOD[playerid]++;
                }
                else if(PlayerInfo[i][Admin] == 2)
                {
                    GetPlayerName(i,aname,sizeof(aname));
                    format(string,sizeof(string),"%s {FF0000}[ Administrador ]", aname);
                    SendClientMessage(playerid, -1, string);
                    countADM[playerid]++;
                }
                else if(PlayerInfo[i][Admin] == 3)
                {
                    GetPlayerName(i,aname,sizeof(aname));
                    format(string,sizeof(string),"%s {FF0000}[ Administrador ]", aname);
                    SendClientMessage(playerid, -1, string);
                    countADM[playerid]++;
                }
            }
        }
        if(countMOD[playerid] == 0)
        {
            SendClientMessage(playerid, -1, "[ BGL ] {FF0000}Nenhum Moderador online no momento.");
        }
        if(countADM[playerid] == 0)
        {
            SendClientMessage(playerid, -1, "[ BGL ] {FF0000}Nenhum Administrador online no momento.");
        }
    }
    else
    {
        SendClientMessage(playerid,-1,"[ ERRO ] {FF0000}Vocк nгo pode usar comandos estando preso.");
    }
    return 1;
}
Reply
#3

One problem I don't understand the code because it's in a different language
Reply
#4

Yes, let's post foreign code in the English section of the forum.

Reply
#5

Quote:
Originally Posted by RealCop228
Посмотреть сообщение
Yes, let's post foreign code in the English section of the forum.

Seriously I understand you're trying to help but it not being in English is a major issue they have a foreign section
Reply
#6

Which command processor do you use? strcmp? zCMD? YCMD?

Also give me the variables you have that shows the administrator is on aduty. Also do you want to show the offline administrators as well?
Reply
#7

I use zcmd and I don't use any variables to show offline or online admins I just change their name
Color on the scoreboard I want it to show offline admins in light grey on the scoreboard and on duty admins as green. If possible could you make me a /re command that sends what the user impute to on duty admins
Reply
#8

Untested and probably inefficient, but hey.
Add "new boolnDuty[MAX_PLAYERS];" at the top of your script and when a player goes on duty, use onDuty[playerid] = true;
pawn Код:
CMD:admins(playerid, params[])
{
    new pName[MAX_PLAYER_NAME], message[128];
    SCM(playerid, -1, "Admins online:");
    foreach(new i : Player) // assuming you use foreach.
    {
        if(IsPlayerAdmin(i))
        {
            GetPlayerName(i, pName, sizeof(pName));
            if(onDuty[i] == true) // or whatever variable you use.
            {
                format(message, sizeof(message), "%s (ID %d)", pName, i);
                SendClientMessage(playerid, COLOR_GREEN, message);
            }
            else
            {
                format(message, sizeof(message), "%s (ID %d)", pName, i);
                SendClientMessage(playerid, -1, message);
            }
           
        }
    }
    return 1;
}
Reply
#9

Can you explain the code also IsPlayerAdmin anyway to make it work with pAdmin admin level
Reply
#10

Can you show me your player info enum?
if(IsPlayerAdmin) basically checks if you're logged in as an RCON admin.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)