[Ajuda] Banco em Dialog
#1

Bom como disse ao meu antigo Tуpico, eu queria colocar o meu /sacar, depositar, /saldo e /transferir em dialog, eu tentei mais nгo consigo, й colocar todos eles juntos, em dialogs, se puderem me ajudar agradeзo deis de jб.

pawn Код:
if(strcmp(cmd, "/sacar", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(!PlayerToPoint(1.0, playerid, 2631.9336,-1265.4479,49.9428) && !PlayerToPoint(1.0, playerid, 1134.9240,-923.2976,43.3906)
            && !PlayerToPoint(1.0, playerid, 1929.3555,-1769.6917,13.5469) && !PlayerToPoint(1.0, playerid, 1508.3536,-1754.6677,13.5469)
            && !PlayerToPoint(1.0, playerid, 1103.0015,-1448.9043,15.7969) && !PlayerToPoint(20.0, playerid, 2308.7761,-13.4607,26.7422))
            {
                SendClientMessage(playerid, COLOR_GREY, "   Vocк nгo estб em um Banco !");
                return 1;
            }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USO: /sacar [quantia]");
                format(string, sizeof(string), "  Vocк tem R$ %d em sua conta.", PlayerInfo[playerid][pAccount]);
                SendClientMessage(playerid, COLOR_GRAD3, string);
                return 1;
            }
            new cashdeposit = strval(tmp);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USO: /sacar [quantia]");
                format(string, sizeof(string), "  Vocк tem R$ %d em sua conta", PlayerInfo[playerid][pAccount]);
                SendClientMessage(playerid, COLOR_GRAD3, string);
                return 1;
            }
            if (cashdeposit > PlayerInfo[playerid][pAccount] || cashdeposit < 1)
            {
                SendClientMessage(playerid, COLOR_GRAD2, "   Vocк nгo tem esse dinheiro !");
                return 1;
            }
            ConsumingMoney[playerid] = 1;
            GivePlayerGP(playerid,cashdeposit);
            PlayerInfo[playerid][pAccount]=PlayerInfo[playerid][pAccount]-cashdeposit;
            format(string, sizeof(string), "  Vocк sacou R$ %d de sua conta, Total: R$ %d", cashdeposit,PlayerInfo[playerid][pAccount]);
            SendClientMessage(playerid, COLOR_YELLOW, string);
            return 1;
        }
        return 1;
    }
    if(strcmp(cmd, "/depositar", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(!PlayerToPoint(1.0, playerid, 2631.9336,-1265.4479,49.9428) && !PlayerToPoint(1.0, playerid, 1134.9240,-923.2976,43.3906)
            && !PlayerToPoint(1.0, playerid, 1929.3555,-1769.6917,13.5469) && !PlayerToPoint(1.0, playerid, 1508.3536,-1754.6677,13.5469)
            && !PlayerToPoint(1.0, playerid, 1103.0015,-1448.9043,15.7969) && !PlayerToPoint(20.0, playerid, 2308.7761,-13.4607,26.7422))
            {
                SendClientMessage(playerid, COLOR_GREY, "   Vocк nгo estб em um Banco !");
                return 1;
            }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USO: /depositar [quantia]");
                format(string, sizeof(string), "  Vocк tem R$ %d em sua conta", PlayerInfo[playerid][pAccount]);
                SendClientMessage(playerid, COLOR_GRAD3, string);
                return 1;
            }
            new cashdeposit = strval(tmp);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USO: /depositar [amount]");
                format(string, sizeof(string), "  Vocк tem R$ %d em sua conta.", PlayerInfo[playerid][pAccount]);
                SendClientMessage(playerid, COLOR_GRAD3, string);
                return 1;
            }
            if (cashdeposit > GetPlayerGP(playerid) || cashdeposit < 1)
            {
                SendClientMessage(playerid, COLOR_GRAD2, "   Vocк nгo tem esse dinheiro.");
                return 1;
            }
            GivePlayerGP(playerid,-cashdeposit);
            new curfunds = PlayerInfo[playerid][pAccount];
            PlayerInfo[playerid][pAccount]=cashdeposit+PlayerInfo[playerid][pAccount];
            SendClientMessage(playerid, COLOR_WHITE, "|___ EXTRATO DO BANCO ___|");
            format(string, sizeof(string), "  Ъltimo balanзo: R$ %d", curfunds);
            SendClientMessage(playerid, COLOR_GRAD2, string);
            format(string, sizeof(string), "  Depуsito: R$ %d",cashdeposit);
            SendClientMessage(playerid, COLOR_GRAD4, string);
            SendClientMessage(playerid, COLOR_GRAD6, "|-----------------------------------------|");
            format(string, sizeof(string), "  Novo Saldo: R$ %d", PlayerInfo[playerid][pAccount]);
            SendClientMessage(playerid, COLOR_WHITE, string);
            return 1;
        }
        return 1;
    }
    if(strcmp(cmd, "/saldo", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(!PlayerToPoint(1.0, playerid, 2631.9336,-1265.4479,49.9428) && !PlayerToPoint(1.0, playerid, 1134.9240,-923.2976,43.3906)
            && !PlayerToPoint(1.0, playerid, 1929.3555,-1769.6917,13.5469) && !PlayerToPoint(1.0, playerid, 1508.3536,-1754.6677,13.5469)
            && !PlayerToPoint(1.0, playerid, 1103.0015,-1448.9043,15.7969) && !PlayerToPoint(20.0, playerid, 2308.7761,-13.4607,26.7422))
            {
                SendClientMessage(playerid, COLOR_GREY, "   Vocк nгo estб em um Banco !");
                return 1;
            }
            format(string, sizeof(string), "  Vocк tem R$ %d em sua Conta.",PlayerInfo[playerid][pAccount]);
            SendClientMessage(playerid, COLOR_YELLOW, string);
        }
        return 1;
    }
    if(strcmp(cmd, "/transferir", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pLevel] < 5)
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   Sгo necessбrios 5 Nнveis ao mнnimo !");
                return 1;
            }
            if(!PlayerToPoint(1.0, playerid, 2631.9336,-1265.4479,49.9428) && !PlayerToPoint(1.0, playerid, 1134.9240,-923.2976,43.3906)
            && !PlayerToPoint(1.0, playerid, 1929.3555,-1769.6917,13.5469) && !PlayerToPoint(1.0, playerid, 1508.3536,-1754.6677,13.5469)
            && !PlayerToPoint(1.0, playerid, 1103.0015,-1448.9043,15.7969) && !PlayerToPoint(20.0, playerid, 2308.7761,-13.4607,26.7422))
            {
                SendClientMessage(playerid, COLOR_GREY, "   Vocк nгo estб em um banco !");
                return 1;
            }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD1, "USO: /transferir [playerid/Parte-do-Nick] [quantia]");
                return 1;
            }
            giveplayerid = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD1, "USO: /transferir [playerid/Parte-do-Nick] [quantia]");
                return 1;
            }
            moneys = strval(tmp);
            if (IsPlayerConnected(giveplayerid))
            {
                if(giveplayerid != INVALID_PLAYER_ID)
                {
                    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                    GetPlayerName(playerid, sendername, sizeof(sendername));
                    playermoney = PlayerInfo[playerid][pAccount];
                    if (moneys > 0 && playermoney >= moneys)
                    {
                        PlayerInfo[playerid][pAccount] -= moneys;
                        PlayerInfo[giveplayerid][pAccount] += moneys;
                        format(string, sizeof(string), "   Vocк transferiu R$ %d para a conta de %s", moneys, giveplayer);
                        PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                        SendClientMessage(playerid, COLOR_GRAD1, string);
                        format(string, sizeof(string), "   Vocк recebeu R$ %d de %s (ID:%d)", moneys, sendername, playerid);
                        SendClientMessage(giveplayerid, COLOR_GRAD1, string);
                        format(string, sizeof(string), "%s transferiu R$ %d para %s", sendername, moneys, giveplayer);
                        if(moneys >= 500000)
                        {
                            ABroadCast(COLOR_YELLOW,string,1);
                        }
                        printf("%s", string);
                        PayLog(string);
                        PlayerPlaySound(giveplayerid, 1052, 0.0, 0.0, 0.0);
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_GRAD1, "   Quantia Invбlida");
                    }
                }
            }
            else
            {
                format(string, sizeof(string), "   %d nгo й um jogador ativo", giveplayerid);
                SendClientMessage(playerid, COLOR_GRAD1, string);
            }
        }
        return 1;
    }
Reply
#2

usa este:
https://sampforum.blast.hk/showthread.php?tid=204484

й o ъnico que achei.
Reply
#3

Sim, mais nгo й compativel com o meu e como disse ali, eu tentei mais nгo consegui arrumar o meu, imagina entгo o deu alguem, hahaha, Caroline tem MSN..
Reply
#4

nгo uso msn.
Reply
#5

[O.z]Caroline e Skype.
Reply
#6

kkkkk mlk lerdo...
Reply
#7

nгo gosto de skype tambйm.
Reply
#8

Pharrel Nгo sou lerdo, й que nunca tentei fazer isso.. Entгo ajudando vou comparar com do comando e com o que ajudou fez, assim eu vou aprendendo..
Reply
#9

Nгo to falando do codigo
Reply
#10

Quote:
Originally Posted by Pharrel
Посмотреть сообщение
Nгo to falando do codigo
kkk' eu ri,

@EDIT:
pawn Код:
//TOPO do GM
#define banco 12412
//OnPlayerKeyStateChange
if(!IsPlayerInAnyVehicle(playerid) && newkeys & KEY_SECONDARY_ATTACK)
    {
        if(IsPlayerInRangeOfPoint(playerid, 3,1958.3783, 1343.1572, 15.3746))
        {
            ShowPlayerDialog(playerid, banco, DIALOG_STYLE_LIST,"Caixa Eletrфnico","Sacar\r\nDepositar\r\nTransferir\r\nSaldo Corrente","Confirmar","Cancelar");
            return 1;
        }
    }
//OnDialogResponse
if(response)
    {
        switch(dialogid == banco)
        {
                case 1:
            {
                switch(listitem)
                {
                    case 0:
                    {
                        new
                            wDeposito = strval(inputtext);
                        if (wDeposito > PlayerInfo[playerid][pAccount] || wDeposito < 1)
                        {
                            SendClientMessage(playerid, COLOR_GRAD2, "   Vocк nгo tem esse dinheiro !");
                            return 1;
                        }
                        ConsumingMoney[playerid] = 1;
                        GivePlayerGP(playerid,wDeposito);
                        PlayerInfo[playerid][pAccount]=PlayerInfo[playerid][pAccount]-wDeposito;
                        format(string, sizeof(string), "  Vocк sacou R$ %d de sua conta, Total: R$ %d", wDeposito,PlayerInfo[playerid][pAccount]);
                        SendClientMessage(playerid, COLOR_YELLOW, string);
                        return 1;
                    }
                    case 1:
                    {
                        new
                            wDepositar = strval(inputtext);
                        if (wDepositar > GetPlayerGP(playerid) || wDepositar < 1)
                        {
                            SendClientMessage(playerid, COLOR_GRAD2, "   Vocк nгo tem esse dinheiro.");
                            return 1;
                        }
                        GivePlayerGP(playerid,-wDepositar);
                        new curfunds = PlayerInfo[playerid][pAccount];
                        PlayerInfo[playerid][pAccount]=wDepositar+PlayerInfo[playerid][pAccount];
                        SendClientMessage(playerid, COLOR_WHITE, "|___ EXTRATO DO BANCO ___|");
                        format(string, sizeof(string), "  Ъltimo balanзo: R$ %d", curfunds);
                        SendClientMessage(playerid, COLOR_GRAD2, string);
                        format(string, sizeof(string), "  Depуsito: R$ %d",wDepositar);
                        SendClientMessage(playerid, COLOR_GRAD4, string);
                        SendClientMessage(playerid, COLOR_GRAD6, "|-----------------------------------------|");
                        format(string, sizeof(string), "  Novo Saldo: R$ %d", PlayerInfo[playerid][pAccount]);
                        SendClientMessage(playerid, COLOR_WHITE, string);
                        return 1;
                    }
                    case 2:
                    {
                        format(string, sizeof(string), "  Vocк tem R$ %d em sua Conta.",PlayerInfo[playerid][pAccount]);
                        SendClientMessage(playerid, COLOR_YELLOW, string);
                        return 1;
                    }
                }
            }
        }
    }
}
Olha esse, e Olha aquele seu que nгo й em Dialog, e tenta se basear. Fiz um exemplo com aquilo apenas,
entгo vocк terб que aperfeiзoar ai Let's Work.
Qualquer coisa volte aqui e fale. Mais tente fazer, nгo peзa sem antes tentar.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)