SA-MP Forums Archive
[Ajuda] Como pegar o texto que se coloca numa 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] Como pegar o texto que se coloca numa dialog ? (/showthread.php?tid=220530)



[Ajuda] Como pegar o texto que se coloca numa dialog ? - Swat007forever - 03.02.2011

Boas.

Й o seguinte, eu tenho uma dialog que й para extrair dinheiro por exemplo.
O codigo que tenho para o comando /extrair й o seguinte:

pawn Код:
if(strcmp(cmd, "/extrair", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(IsPlayerInRangeOfPoint(playerid,5.0,BankPosition[X],BankPosition[Y],BankPosition[Z]))
            {
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    SendClientMessage(playerid, COLOR_WHITE, "/extrair [montante]");
                    return 1;
                }
                new cashdeposit = strval(tmp);
                if(!strlen(tmp))
                {
                    SendClientMessage(playerid, COLOR_WHITE, "/extrair [montante]");
                    return 1;
                }
                if(PlayerInfo[playerid][pBank] >= cashdeposit)
                {
                    GivePlayerCash(playerid,cashdeposit);
                    PlayerInfo[playerid][pBank]=PlayerInfo[playerid][pBank]-cashdeposit;
                    format(string, sizeof(string), "[INFO] Tu extraistes $%d, novo balanзo: $%d", cashdeposit,PlayerInfo[playerid][pBank]);
                    SendClientMessage(playerid, COLOR_WHITE, string);
                    PlayerActionMessage(playerid,15.0,"recebeu algum dinheiro do banqueiro");
                    OnPlayerDataSave(playerid);
                    return 1;
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GREY, "[Error:] You do not have that much in your bank");
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "[Error:] You are not at the bank");
            }
        }
        return 1;
    }
E eu quero meter isso na dialog....

Tipo eu tenho um comando que abre a seguinte dialog:

pawn Код:
ShowPlayerDialog(playerid,7735,DIALOG_STYLE_INPUT,"Extrair","Insere o valor que queres para extrair dinheiro","Selecionar","Cancelar");
Depois a dialog й a seguinte para quando se coloca o valor:

pawn Код:
if(dialogid == 7735)
    {
        if(response)
        {
            //So que eu nao sei o que tenho de por aqui para fazer a funзгo de extrair dinheiro, em vez de cashdeposit que tenho no comando /extrair, meto inputtext ?
        }
    }



Re: [Ajuda] Como pegar o texto que se coloca numa dialog ? - Macintosh - 03.02.2011

Nгo ai colocaras a funзгo de retirar dinheiro
cashretirar ou seja la como for...


Re: [Ajuda] Como pegar o texto que se coloca numa dialog ? - Swat007forever - 03.02.2011

Pois mas dб erro, a dizer "undefined symbol" do cashdeposit...

pawn Код:
GivePlayerCash(playerid,cashdeposit);
                    PlayerInfo[playerid][pBank]=PlayerInfo[playerid][pBank]-cashdeposit;



Re: [Ajuda] Como pegar o texto que se coloca numa dialog ? - Ricop522 - 03.02.2011

PlayerInfo[playerid][pBank] - cashdeposit;
GivePlayerCash(playerid,cashdeposit);