[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


Messages In This Thread
[Ajuda] Banco em Dialog - by Sr.Pekeno - 14.09.2011, 01:44
Re: [Ajuda] Banco em Dialog - by [O.z]Caroline - 14.09.2011, 01:47
Re: [Ajuda] Banco em Dialog - by Sr.Pekeno - 14.09.2011, 01:49
Re: [Ajuda] Banco em Dialog - by [O.z]Caroline - 14.09.2011, 01:51
Re: [Ajuda] Banco em Dialog - by Sr.Pekeno - 14.09.2011, 01:53
Re: [Ajuda] Banco em Dialog - by Pharrel - 14.09.2011, 01:58
Re: [Ajuda] Banco em Dialog - by [O.z]Caroline - 14.09.2011, 02:03
Re: [Ajuda] Banco em Dialog - by Sr.Pekeno - 14.09.2011, 02:03
Re: [Ajuda] Banco em Dialog - by Pharrel - 14.09.2011, 02:29
Re: [Ajuda] Banco em Dialog - by WLSF - 14.09.2011, 02:30

Forum Jump:


Users browsing this thread: 2 Guest(s)