[Ajuda] /admins em Dialog
#1

Entгo, como diz o titulo, eu gostaria de colocar o meu comando de /admins em Dialog.
Para os administradores online, mostrar eles online mas em dialog.

pawn Код:
if(!strcmp(cmdtext, "/admins", true))
{
SendClientMessage(playerid,0x008000AA, "[»] Administradores Online:");
new count=0;
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i)){
if(admin[i]){
new str[256];
new pname[24];
GetPlayerName(i, pname, 24);
format(file2, sizeof(file2), PASTA_CONTAS, pname);
if(pAdmin[i] == 1){
format(str,sizeof(str),"%s (%d) » Administrador [Helper]", pname,i);
}
if(pAdmin[i] == 2){
format(str,sizeof(str),"%s (%d) » Administrador [Moderador]", pname,i);
}
if(pAdmin[i] == 3){
format(str,sizeof(str),"%s (%d) » Administrador [Geral]", pname,i);
}
if(pAdmin[i] == 4){
format(str,sizeof(str),"%s (%d) » Administrador [Master]", pname,i);
}
if(pAdmin[i] == 5){
format(str,sizeof(str),"%s (%d) » Administrador [Dono]", pname,i);
}
SendClientMessage(playerid, 0x0080FFAA, str);
count++;
}
}
}
if(count == 0)
{
SendClientMessage(playerid, Vermelho, "");
}
return 1;
}
Como coloco
Reply
#2

Eu acho que й isso:

ShowPlayerDialog(playerid,dialogid,DIALOG_STYLE_MS GBOX, "Administradores:",str,"Fechar","");

Reply
#3

https://sampwiki.blast.hk/wiki/Strcat
Reply
#4

Aqui estб o seu comando em dialog :


pawn Код:
if(!strcmp(cmdtext, "/admins", true))
    {
        new Count;
        new const Ranks[][] =
        {
            "Helper",
            "Moderador",
            "Geral",
            "Master",
            "Dono"
        };
        new STR[1400];
        for(new x = 0, y = GetMaxPlayers(); x != y; x++)
        {
            if(!IsPlayerConnected(x)) continue;
            if(admin[x])
            {
                new NickName[25];
                GetPlayerName(x, NickName, 25);
                if(pAdmin[x] >= 1 && pAdmin[x] <= 5)
                {
                    format(STR, 1400, "%s%s (%d) » Administrador [%s]\n", STR, NickName, x, Ranks[pAdmin[x] - 1]);
                }
                Count++;
            }
        }
        Count || strcat(STR, "Nenhum administrador online.\n");
        ShowPlayerDialog(playerid, 500, DIALOG_STYLE_MSGBOX, "Administradores Online", STR, "Fechar", "");
        return 1;
    }


Espero ter ajudado .
Reply
#5

Quote:
Originally Posted by rjjj
Посмотреть сообщение
Aqui estб o seu comando em dialog :


pawn Код:
if(!strcmp(cmdtext, "/admins", true))
    {
        new Count;
        new const Ranks[][] =
        {
            "Helper",
            "Moderador",
            "Geral",
            "Master",
            "Dono"
        };
        new STR[1400];
        for(new x = 0, y = GetMaxPlayers(); x != y; x++)
        {
            if(!IsPlayerConnected(x)) continue;
            if(admin[x])
            {
                new NickName[25];
                GetPlayerName(x, NickName, 25);
                if(pAdmin[x] >= 1 && pAdmin[x] <= 5)
                {
                    format(STR, 1400, "%s%s (%d) » Administrador [%s]\n", STR, NickName, x, Ranks[pAdmin[x] - 1]);
                }
                Count++;
            }
        }
        Count || strcat(STR, "Nenhum administrador online.\n");
        ShowPlayerDialog(playerid, 500, DIALOG_STYLE_MSGBOX, "Administradores Online", STR, "Fechar", "");
        return 1;
    }


Espero ter ajudado .
Muito obrigado, seu cуdigo deu certo aqui, mas ficou com o seguinte warning: warning 219: local variable "Count" shadows a variable at a preceding level

Pode dizer como tiro
Reply
#6

No topo do seu gamemode ja deve ter

pawn Код:
new Count;
troque o nome ou apague o new Count; do cmd /admins
Reply
#7

Quote:
Originally Posted by Murilo_sousa
Посмотреть сообщение
No topo do seu gamemode ja deve ter

pawn Код:
new Count;
troque o nome ou apague o new Count; do cmd /admins
Nгo nгo, olhei aqui e nгo tinha new Count; no topo do GM.

@Edit
Mas eu apaguei aqui, e saiu o warning. Obrigado.
Reply
#8

Quote:
Originally Posted by Hauo
Посмотреть сообщение
Nгo nгo, olhei aqui e nгo tinha new Count; no topo do GM.

@Edit
Mas eu apaguei aqui, e saiu o warning. Obrigado.
ele estava definido em outro local ja
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)