[Ajuda] Banco
#1

Ola queria saber como por cada um desses Comando Em 1 Dialogo pro player clicar e nao digitar Ex :
Sacar
Depositar
Transferir
Balanco <<.
Codigo logo abaixo Quem ajudar eu agradeзo
PHP код:
 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 Balanзo: R$ %d", PlayerInfo[playerid][pAccount]);
            
SendClientMessage(playerid, COLOR_WHITE, string);
            return 
1;
        }
        return 
1;
    }
    if(
strcmp(cmd, "/balanco", true) == 0 || 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

use dialog input
estude na wiki
Reply
#3

Manda o link ai por favor
Reply
#4

https://sampwiki.blast.hk/wiki/ShowPlayerDialog
https://sampwiki.blast.hk/wiki/OnDialogResponse
Reply
#5

obrigado.
Reply


Forum Jump:


Users browsing this thread: