SA-MP Forums Archive
[AJUDA] Comando /admins - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [AJUDA] Comando /admins (/showthread.php?tid=521483)



[AJUDA] Comando /admins - Cheleber_Pausini - 23.06.2014

Bem preciso de uma pequena ajuda, estou a criar um comando onde possa ver os admins que estao online, o comando compila, mas quando dou /admins no server, os nomes dos admins nao aparecem...

Linha de cуdigo:
Код:
CMD:admins(playerid, params[])
  {
        new str[600], name[MAX_PLAYER_NAME], Nivel[10];
        new contadoradm = 0;
        if(Login[playerid] == 0) return SendClientMessage(playerid, COR_BORDO, "[PT Life] Vocк nгo estб logado.");
        SendClientMessage(playerid, 0xFFF600FF, "|_________ Admins Online _________|");
        for (new i = 0; i < MAX_PLAYERS; i++)
        {
            if(PlayerInfo[i][pAdmin] == 0) return true;
            if(!IsPlayerConnected(i)) return true;
            if(PlayerInfo[i][pAdmin] == 1) Nivel = "nнvel 1";
            if(PlayerInfo[i][pAdmin] == 2) Nivel = "nнvel 2";
            if(PlayerInfo[i][pAdmin] == 3) Nivel = "nнvel 3";
            if(PlayerInfo[i][pAdmin] == 4) Nivel = "nнvel 4";
            if(PlayerInfo[i][pAdmin] == 5) Nivel = "nнvel 5";
            if(PlayerInfo[i][pAdmin] == 6) Nivel = "GOD";
            if(PlayerInfo[i][pAdmin] > 0){
            GetPlayerName(i, name, 24);
            format(str, sizeof str ,"Administrador %s: %s\r\n", Nivel, name);
            SendClientMessage(playerid, 0xFFFFFFFF, str);
            contadoradm++;
            }
        }
        if(contadoradm == 0) return SendClientMessage(playerid, 0x0000BBAA, "Nгo hб adminitradores online no momento!");
        return 1;
    }
Nao sou muito experiente em pawno, podemos dizer que sou mediano xd

@EDIT: O contadoradm, tambem nao funfa, se nao tiver qualquer adm online, aparece |_________ Admins Online _________|


Re: [AJUDA] Comando /admins - CrazyHelp - 23.06.2014

Porque colocaste isso no SendClientMessage ?
pawn Код:
if(contadoradm == 0) return



Re: [AJUDA] Comando /admins - Cheleber_Pausini - 23.06.2014

Quote:
Originally Posted by CrazyHelp
Посмотреть сообщение
Porque colocaste isso no SendClientMessage ?
pawn Код:
if(contadoradm == 0) return
Para que quando nao houver nenhum admin online, mostrar a mensagem de que nao ha admins online


Re: [AJUDA] Comando /admins - Cheleber_Pausini - 23.06.2014

UP UP, HELP!


Re: [AJUDA] Comando /admins - Cheleber_Pausini - 23.06.2014

Dei uma pesquisada pelo fуrum e acabei por conseguir! Obrigado (:
pawn Код:
CMD:admins(playerid, params[])
{
        new count = 0;
        if(Login[playerid] == 0) return SendClientMessage(playerid, COR_BORDO, "[PT Life] Vocк nгo estб logado.");
        SendClientMessage(playerid, 0xFFF600FF, "|_________ Admins Online _________|");
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            new admtext[64];
            new str[600], name[MAX_PLAYER_NAME];
            switch(PlayerInfo[i][pAdmin])
            {
                case 1: admtext = "nнvel 1";
                case 2: admtext = "nнvel 2";
                case 3: admtext = "nнvel 3";
                case 4: admtext = "nнvel 4";
                case 5: admtext = "nнvel 5";
                case 6: admtext = "GOD";
            }
            if(IsPlayerConnected(i))
            {
                if(PlayerInfo[i][pAdmin] >= 1)
                {
                    GetPlayerName(i, name, sizeof(name));
                    format(str, 128, "Administrador %s: %s\r\n", admtext, name);
                    SendClientMessage(playerid, -1, str);
                    count++;
                }
            }
        }
        if(count == 0) return SendClientMessage(playerid, 0x0000BBAA, "Nгo hб adminitradores online no momento!");
        return 1;
    }



Re: [AJUDA] Comando /admins - DarkBr - 07.03.2017

Quote:
Originally Posted by Cheleber_Pausini
Посмотреть сообщение
Dei uma pesquisada pelo fуrum e acabei por conseguir! Obrigado (:
pawn Код:
CMD:admins(playerid, params[])
{
        new count = 0;
        if(Login[playerid] == 0) return SendClientMessage(playerid, COR_BORDO, "[PT Life] Vocк nгo estб logado.");
        SendClientMessage(playerid, 0xFFF600FF, "|_________ Admins Online _________|");
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            new admtext[64];
            new str[600], name[MAX_PLAYER_NAME];
            switch(PlayerInfo[i][pAdmin])
            {
                case 1: admtext = "nнvel 1";
                case 2: admtext = "nнvel 2";
                case 3: admtext = "nнvel 3";
                case 4: admtext = "nнvel 4";
                case 5: admtext = "nнvel 5";
                case 6: admtext = "GOD";
            }
            if(IsPlayerConnected(i))
            {
                if(PlayerInfo[i][pAdmin] >= 1)
                {
                    GetPlayerName(i, name, sizeof(name));
                    format(str, 128, "Administrador %s: %s\r\n", admtext, name);
                    SendClientMessage(playerid, -1, str);
                    count++;
                }
            }
        }
        if(count == 0) return SendClientMessage(playerid, 0x0000BBAA, "Nгo hб adminitradores online no momento!");
        return 1;
    }
NГO SEI COMO AGRADECER. DEUS TE ABENЗOE!!!!! HA UM TEMPO JБ TENHO ESSA DЪVIDA E NГO CONSEGUIA FAZER MUITO OBG SЙRIO!!!!!!!!!!!!!!!!!


Re: [AJUDA] Comando /admins - Cheleber_Pausini - 07.03.2017

Ahaha de nada, mas bom revive ai no tуpico de 2014...