[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.0playerid2631.9336,-1265.4479,49.9428) && !PlayerToPoint(1.0playerid1134.9240,-923.2976,43.3906)
            && !
PlayerToPoint(1.0playerid1929.3555,-1769.6917,13.5469) && !PlayerToPoint(1.0playerid1508.3536,-1754.6677,13.5469)
            && !
PlayerToPoint(1.0playerid1103.0015,-1448.9043,15.7969) && !PlayerToPoint(20.0playerid2308.7761,-13.4607,26.7422))
            {
                
SendClientMessage(playeridCOLOR_GREY"   Vocк nгo estб em um Banco !");
                return 
1;
            }
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_GRAD2"USO: /sacar [quantia]");
                
format(stringsizeof(string), "  Vocк tem R$ %d em sua conta."PlayerInfo[playerid][pAccount]);
                
SendClientMessage(playeridCOLOR_GRAD3string);
                return 
1;
            }
            new 
cashdeposit strval(tmp);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_GRAD2"USO: /sacar [quantia]");
                
format(stringsizeof(string), "  Vocк tem R$ %d em sua conta"PlayerInfo[playerid][pAccount]);
                
SendClientMessage(playeridCOLOR_GRAD3string);
                return 
1;
            }
            if (
cashdeposit PlayerInfo[playerid][pAccount] || cashdeposit 1)
            {
                
SendClientMessage(playeridCOLOR_GRAD2"   Vocк nгo tem esse dinheiro !");
                return 
1;
            }
            
ConsumingMoney[playerid] = 1;
            
GivePlayerGP(playerid,cashdeposit);
            
PlayerInfo[playerid][pAccount]=PlayerInfo[playerid][pAccount]-cashdeposit;
            
format(stringsizeof(string), "  Vocк sacou R$ %d de sua conta, Total: R$ %d"cashdeposit,PlayerInfo[playerid][pAccount]);
            
SendClientMessage(playeridCOLOR_YELLOWstring);
            return 
1;
        }
        return 
1;
    }
    if(
strcmp(cmd"/depositar"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            if(!
PlayerToPoint(1.0playerid2631.9336,-1265.4479,49.9428) && !PlayerToPoint(1.0playerid1134.9240,-923.2976,43.3906)
            && !
PlayerToPoint(1.0playerid1929.3555,-1769.6917,13.5469) && !PlayerToPoint(1.0playerid1508.3536,-1754.6677,13.5469)
            && !
PlayerToPoint(1.0playerid1103.0015,-1448.9043,15.7969) && !PlayerToPoint(20.0playerid2308.7761,-13.4607,26.7422))
            {
                
SendClientMessage(playeridCOLOR_GREY"   Vocк nгo estб em um Banco !");
                return 
1;
            }
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_GRAD2"USO: /depositar [quantia]");
                
format(stringsizeof(string), "  Vocк tem R$ %d em sua conta"PlayerInfo[playerid][pAccount]);
                
SendClientMessage(playeridCOLOR_GRAD3string);
                return 
1;
            }
            new 
cashdeposit strval(tmp);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_GRAD2"USO: /depositar [amount]");
                
format(stringsizeof(string), "  Vocк tem R$ %d em sua conta."PlayerInfo[playerid][pAccount]);
                
SendClientMessage(playeridCOLOR_GRAD3string);
                return 
1;
            }
            if (
cashdeposit GetPlayerGP(playerid) || cashdeposit 1)
            {
                
SendClientMessage(playeridCOLOR_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(playeridCOLOR_WHITE"|___ EXTRATO DO BANCO ___|");
            
format(stringsizeof(string), "  Ъltimo balanзo: R$ %d"curfunds);
            
SendClientMessage(playeridCOLOR_GRAD2string);
            
format(stringsizeof(string), "  Depуsito: R$ %d",cashdeposit);
            
SendClientMessage(playeridCOLOR_GRAD4string);
            
SendClientMessage(playeridCOLOR_GRAD6"|-----------------------------------------|");
            
format(stringsizeof(string), "  Novo Balanзo: R$ %d"PlayerInfo[playerid][pAccount]);
            
SendClientMessage(playeridCOLOR_WHITEstring);
            return 
1;
        }
        return 
1;
    }
    if(
strcmp(cmd"/balanco"true) == || strcmp(cmd"/saldo"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            if(!
PlayerToPoint(1.0playerid2631.9336,-1265.4479,49.9428) && !PlayerToPoint(1.0playerid1134.9240,-923.2976,43.3906)
            && !
PlayerToPoint(1.0playerid1929.3555,-1769.6917,13.5469) && !PlayerToPoint(1.0playerid1508.3536,-1754.6677,13.5469)
            && !
PlayerToPoint(1.0playerid1103.0015,-1448.9043,15.7969) && !PlayerToPoint(20.0playerid2308.7761,-13.4607,26.7422))
            {
                
SendClientMessage(playeridCOLOR_GREY"   Vocк nгo estб em um Banco !");
                return 
1;
            }
            
format(stringsizeof(string), "  Vocк tem R$ %d em sua Conta.",PlayerInfo[playerid][pAccount]);
            
SendClientMessage(playeridCOLOR_YELLOWstring);
        }
        return 
1;
    }
    if(
strcmp(cmd"/transferir"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            if(
PlayerInfo[playerid][pLevel] < 5)
            {
                
SendClientMessage(playeridCOLOR_GRAD1"   Sгo necessбrios 5 Nнveis ao mнnimo !");
                return 
1;
            }
            if(!
PlayerToPoint(1.0playerid2631.9336,-1265.4479,49.9428) && !PlayerToPoint(1.0playerid1134.9240,-923.2976,43.3906)
            && !
PlayerToPoint(1.0playerid1929.3555,-1769.6917,13.5469) && !PlayerToPoint(1.0playerid1508.3536,-1754.6677,13.5469)
            && !
PlayerToPoint(1.0playerid1103.0015,-1448.9043,15.7969) && !PlayerToPoint(20.0playerid2308.7761,-13.4607,26.7422))
            {
                
SendClientMessage(playeridCOLOR_GREY"   Vocк nгo estб em um banco !");
                return 
1;
            }
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_GRAD1"USO: /transferir [playerid/Parte-do-Nick] [quantia]");
                return 
1;
            }
            
giveplayerid ReturnUser(tmp);
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_GRAD1"USO: /transferir [playerid/Parte-do-Nick] [quantia]");
                return 
1;
            }
            
moneys strval(tmp);
            if (
IsPlayerConnected(giveplayerid))
            {
                if(
giveplayerid != INVALID_PLAYER_ID)
                {
                    
GetPlayerName(giveplayeridgiveplayersizeof(giveplayer));
                    
GetPlayerName(playeridsendernamesizeof(sendername));
                    
playermoney PlayerInfo[playerid][pAccount];
                    if (
moneys && playermoney >= moneys)
                    {
                        
PlayerInfo[playerid][pAccount] -= moneys;
                        
PlayerInfo[giveplayerid][pAccount] += moneys;
                        
format(stringsizeof(string), "   Vocк transferiu R$ %d para a conta de %s"moneysgiveplayer);
                        
PlayerPlaySound(playerid10520.00.00.0);
                        
SendClientMessage(playeridCOLOR_GRAD1string);
                        
format(stringsizeof(string), "   Vocк recebeu R$ %d de %s (ID:%d)"moneyssendernameplayerid);
                        
SendClientMessage(giveplayeridCOLOR_GRAD1string);
                        
format(stringsizeof(string), "%s transferiu R$ %d para %s"sendernamemoneysgiveplayer);
                        if(
moneys >= 500000)
                        {
                            
ABroadCast(COLOR_YELLOW,string,1);
                        }
                        
printf("%s"string);
                        
PayLog(string);
                        
PlayerPlaySound(giveplayerid10520.00.00.0);
                    }
                    else
                    {
                        
SendClientMessage(playeridCOLOR_GRAD1"   Quantia Invбlida");
                    }
                }
            }
            else
            {
                
format(stringsizeof(string), "   %d nгo й um jogador ativo"giveplayerid);
                
SendClientMessage(playeridCOLOR_GRAD1string);
            }
        }
        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: 1 Guest(s)