[Ajuda] Checar se o Player Possui conta bancбria Truck
#1

Fiz aqui um bбsico CMD para ver a senha do banco de um certo player.

Porйm nгo consigo achar a linha que mostra se o player tem ou nгo conta bancбria para que possa colocar no codigo...

Segue abaixo os code do Banco. "Nгo vou postar meu CMD , caso for precise fale".

pawn Код:
// Process the transfer option (player entered the name of the other player who must receive the money)
Dialog_BankTransferName(playerid, response, inputtext[])
{
    // Just close the dialog if the player clicked "Cancel"
    if(!response) return 1;

    // Setup local variables
    new file[100], File:BFile, LineForFile[100], ReceiverName[24], SenderName[24], Msg[128];
    new OtherPlayer, Day, Month, Year, Hour, Minute, Second, sDay[3], sMonth[3], sYear[5], sHour[3], sMinute[3];

    // Get the playername of the sender (the player who executes the transfer)
    format(SenderName, sizeof(SenderName), APlayerData[playerid][PlayerName]);

    // Check if there is a text entered
    if (strlen(inputtext) == 0)
    {
        // Let the player know he must enter a playername or playerid into the input field
        SendClientMessage(playerid, 0xFFFFFFFF, "{FFFF00}[ERRO] {FF0000}Vocк precisa digitar o Nick ou o ID do jogador.");
        return 1;
    }

    // Try to convert the given playername OR playerid to a playerid
    sscanf(inputtext, "u", OtherPlayer);

    // Check if an online player was found by sscanf
    if (OtherPlayer != INVALID_PLAYER_ID)
    {
        // Check if that other player is online (use online bank-transfer)
        if (APlayerData[OtherPlayer][LoggedIn] == true)
        {
            format(ReceiverName, sizeof(ReceiverName), APlayerData[OtherPlayer][PlayerName]); // Get the playername of the receiver
            format(file, sizeof(file), BankFile, ReceiverName); // Construct the complete filename for the receiver's bank-account

            // Check if the receiver has a bank account
            if (fexist(file))
            {
                // Transfer the money from your bank account to the other player's bank account
                APlayerData[OtherPlayer][BankMoney] = APlayerData[OtherPlayer][BankMoney] + APlayerData[playerid][UseMoney];
                // Take the money away from your own bank account
                APlayerData[playerid][BankMoney] = APlayerData[playerid][BankMoney] - APlayerData[playerid][UseMoney];
                // Save both bank accounts
                BankFile_Save(OtherPlayer);
                BankFile_Save(playerid);
                // Inform the receiver that money was transferred to his bank account
                format(Msg, 128, "{FFFF00}[INFO] {079100}Sua conta bancбria tem recebido uma transferкncia de R$%i recebida de \"%s\"", APlayerData[playerid][UseMoney], SenderName);
                SendClientMessage(OtherPlayer, 0xFFFFFFFF, Msg);
                // Inform the sender that money was transferred from his bank account to the receiver
                format(Msg, 128, "{FFFF00}[INFO] {079100}Vocк transferiu R$%i para a conta bancбria de \"%s\"", APlayerData[playerid][UseMoney], ReceiverName);
                SendClientMessage(playerid, 0xFFFFFFFF, Msg);
                // Exit the function (bank transfer was completed), skipping offline transfer
                return 1;
            }
            else // The target player is online, but has no bank account
            {
                format(Msg, 128, "{FFFF00}[ERRO] {FF0000}O jogador %s estб online, e nгo possui uma conta bancбria.", inputtext);
                SendClientMessage(playerid, 0xFFFFFFFF, Msg);
                // Exit the function (bank transfer failed as the target player has no bank account), skipping offline transfer
                return 1;
            }
        }
        else
        {
            // An online player was found here, but he hasn't logged in yet, so treat him as an offline player
            // The rest of the function will be executes to process offline bank transfers
        }
    }
Reply
#2

pawn Код:
new file[100], Name[24];
    format(Name, sizeof(Name), APlayerData[playerid][PlayerName]);
    format(file, sizeof(file), BankFile, Name);
    if (!fexist(file))// Sem conta
Era so usar o /banco como exemplo .
Reply
#3

Valeu mais uma vez chapadenhu.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)