SA-MP Forums Archive
[Ajuda] Sacar no banco - 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] Sacar no banco (/showthread.php?tid=407227)



Sacar no banco - joeyleone - 13.01.2013

Olб, estou precisando de ajuda. Consegui arrumar o /depositar mas o /sacar ainda nгo estб certo.
Й o seguinte, a pessoa vai lб e dб /sacar 100000000000 e buga a conta e fica com muita grana aн no /depositar limitei pra depуsitos de 999kk agora o bug nгo funciona em depуsitos, mas em saques esse bug permanece e nгo consigo tirar isso '-'

pawn Код:
if(strcmp(cmd, "/sacar", true) == 0)
{
    if(!IsPlayerInRangeOfPoint(playerid, 2.0, 2308.8374,-13.2480,26.7422)) return SendClientMessage(playerid, 0xFFFF00AA, "[ERRO] Vocк nгo estб no Banco Revolution!");
    {
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp)) return SendClientMessage(playerid, 0xFFFF00AA,"USE: /sacar [quantia de GP]");
        RealBanc = strval(tmp);
        {
            new n[MAX_PLAYER_NAME];
            GetPlayerName(playerid, n, sizeof(n));
            format(Arquivo, sizeof(Arquivo), "Arquivos/Banco/%s.cfg", n);
            if(DOF2_FileExists(Arquivo))
            {
                if(DOF2_GetInt(Arquivo, "Saldo")<RealBanc) return SendClientMessage(playerid, 0xFFFFFFAA, "[ERRO] Vocк nгo tem estб quantia!");
                else if(DOF2_GetInt(Arquivo, "Saldo") >= RealBanc)
                {
                    DOF2_SetInt(Arquivo, "Saldo", DOF2_GetInt(Arquivo, "Saldo") -RealBanc);
                    format(string, sizeof(string), "[BANCO REVOLUTION] Vocк retirou %d GP. de sua conta do Banco Revolution. Saldo atual %d GP.", RealBanc, DOF2_GetInt(Arquivo, "Saldo"));
                    SendClientMessage(playerid, 0x5EAF03FF, string);
                    GivePlayerReal(playerid, RealBanc);
                }
            }
        }
        return 1;
    }
}
Se nгo entendeu, quero que a pessoa saque no mбximo 999 milhхes da conta, entende? Por favor, dou + se vocкs me ajudarem
Obrigado


Re: Sacar no banco - Gii - 13.01.2013

pawn Код:
if ( RealBanc > 99999999) return SendClientMessage(playerid, 0xFF000, "Valor limite exedido!");



Re: Sacar no banco - joeyleone - 13.01.2013

Onde ponho isso? Coloquei aqui e nгo funcionou...


Re: Sacar no banco - Cйrebro - 13.01.2013

pawn Код:
if(strcmp(cmd, "/sacar", true) == 0)
{
    if(!IsPlayerInRangeOfPoint(playerid, 2.0, 2308.8374,-13.2480,26.7422)) return SendClientMessage(playerid, 0xFFFF00AA, "[ERRO] Vocк nгo estб no Banco Revolution!");
    {
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp)) return SendClientMessage(playerid, 0xFFFF00AA,"USE: /sacar [quantia de GP]");
        RealBanc = strval(tmp);
        {
            new n[MAX_PLAYER_NAME];
            GetPlayerName(playerid, n, sizeof(n));
            format(Arquivo, sizeof(Arquivo), "Arquivos/Banco/%s.cfg", n);
            if(DOF2_FileExists(Arquivo))
            {
                if(DOF2_GetInt(Arquivo, "Saldo")<RealBanc) return SendClientMessage(playerid, 0xFFFFFFAA, "[ERRO] Vocк nгo tem estб quantia!");
    if ( RealBanc > 99999999) return SendClientMessage(playerid, 0xFF000FF, "Valor limite exedido!");
                else if(DOF2_GetInt(Arquivo, "Saldo") >= RealBanc)
                {
                    DOF2_SetInt(Arquivo, "Saldo", DOF2_GetInt(Arquivo, "Saldo") -RealBanc);
                    format(string, sizeof(string), "[BANCO REVOLUTION] Vocк retirou %d GP. de sua conta do Banco Revolution. Saldo atual %d GP.", RealBanc, DOF2_GetInt(Arquivo, "Saldo"));
                    SendClientMessage(playerid, 0x5EAF03FF, string);
                    GivePlayerReal(playerid, RealBanc);
                }
            }
        }
        return 1;
    }
}



Re: Sacar no banco - joeyleone - 13.01.2013

Ainda nгo deu
Posso sacar 1000000000000000000000 e buga a grana, fico com muita grana...


Re: Sacar no banco - Schocc - 13.01.2013

Tente
pawn Код:
if( strval( tmp ) <= 99999999 ) return SendClientMessage( playerid, -1, "Valor limite excedido!");



Re: Sacar no banco - joeyleone - 13.01.2013

Quote:
Originally Posted by Schocc
Посмотреть сообщение
Tente
pawn Код:
if( strval( tmp ) <= 99999999 ) return SendClientMessage( playerid, -1, "Valor limite excedido!");
Valeu cara, funcionou certinho. Dei REP+ pra vocк