SA-MP Forums Archive
[AJUDA] Kick por dialog - 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] Kick por dialog (/showthread.php?tid=197509)



[AJUDA] Kick por dialog - steki. - 09.12.2010

Tipo, eu tava fazendo um kick por dialog e entгo percebi que meus conhecimentos sгo cof uma merda cof.

Entгo. Й assim.

O Adm digita /kick e vem um dialog perguntando o nome do kickado e o motivo, sу que eu nгo sei como que faz pra pegar essas duas str. nгo precisa postar o codigo, mas alguйm ajuda? rs

EDIT: Como tб agora

pawn Код:
if(listitem == 0){
                ShowPlayerDialog(playerid,APAINEL_KICK_1,DIALOG_STYLE_MSGBOX,"Aviso!","Aviso!\tVocк selecionou a opзгo {FF0000}KICKAR{FFFFFF}\n\tVocк tem certeza disso?","Sim","Nгo");}
                    if(dialogid == APAINEL_KICK_1)
                    {
                        if(response)
                        {
                            SendClientMessage(playerid,COLOR_ORANGE, "Agora digite o nome do jogador.");
                            ShowPlayerDialog(playerid,APANEL_KICK_2,DIALOG_STYLE_INPUT,"Digite o nome do jogador.", "Digita aew","Ok","Cancelar"); //Aн, quero pegar o nome e o motivo do kick
                        }
                        else
                        {
                            SendClientMessage(playerid, COLOR_RED, "Cancelado");
                        }
                    }



Re: [AJUDA] Kick por dialog - CyNiC - 09.12.2010

Fiz pra vocк, sу nгo tive como testar:

http://pastebin.com/nGWraeGA


Re: [AJUDA] Kick por dialog - rjjj - 09.12.2010

Isto deve resolver o seu problema, se nгo resolver, vai ajudб-lo :


Coloque:


pawn Код:
//No Topo do GM:

static DialogText1[256];
static DialogText2[256];




//No OnPlayerCommandText:


if (strcmp(cmd, "/DialogKick", true) == 0)
    {
        ShowPlayerDialog(playerid,2222,DIALOG_STYLE_INPUT,"Nome do Jogador.","Digite-o","Cancelar","Ok");
        return 1;
    }





//No OnDialogResponse


if(dialogid == 2222)
        {
            if(response == 0)
            {
                ShowPlayerDialog(playerid,2222,DIALOG_STYLE_INPUT,"Nome do Jogador.","Digite-o","Cancelar","Ok");
                return 1;
            }
            if(response == 1)
            {
                format(DialogText1, sizeof(DialogText1), "%s", inputtext);
                ShowPlayerDialog(playerid,3333,DIALOG_STYLE_INPUT,"Motivo.","Digite-o","Cancelar","Ok");
                return 1;
            }
            return 1;
        }
        if(dialogid == 3333)
        {
            if(response == 0)
            {
                ShowPlayerDialog(playerid,2222,DIALOG_STYLE_INPUT,"Nome do Jogador.","Digite-o","Cancelar","Ok");
                return 1;
            }
            if(response == 1)
            {
                format(DialogText2, sizeof(DialogText2), "%s", inputtext);
                format(string, sizeof(string), "/kick %s %s", DialogText1, DialogText2);
                OnPlayerCommandText(playerid,string);
                return 1;
            }
            return 1;
        }


Para o cуdigo acima, nгo delete o comando /kick do seu GM. Use /DialogKick para Kickar em Dialog



Espero ter ajudado