Small Help
#6

This is the whole transfer code:

pawn Код:
if(dialogid == TRANSFER_1)
    {
        if(!strlen(inputtext)) return SendClientMessage(playerid, COLOR_RED, "Error: You didn't enter a player name to transfer money to!");
        new file2[50];
        format(file2, sizeof(file2), BANK_FILE, inputtext);
        if(!dini_Exists(file2)) return SendClientMessage(playerid, COLOR_RED, "Error: Invalid name; or the player does not have a bank account.");
        SetPVarString(playerid, "transfer_name", inputtext);
        ShowPlayerDialog(playerid, TRANSFER_2, DIALOG_STYLE_INPUT, "Advanced Bank - Transfer (Step 2)", "Insert the amount of money you would like to transfer:", "Submit", "Cancel");
    }
    if(dialogid == TRANSFER_2)
    {
        if(!strlen(inputtext))
        {
            SendClientMessage(playerid, COLOR_RED, "Error: You didn't enter an amount to send to the player.");
            SetPVarString(playerid, "transfer_name", " ");
            ShowPlayerBankDialog(playerid);
            return 1;
        }
        if(strval(inputtext) > dini_Int(file, "Balance"))
        {
            SendClientMessage(playerid, COLOR_RED, "Error: You're trying to transfer more money than you have!");
            SetPVarString(playerid, "transfer_name", " ");
            ShowPlayerBankDialog(playerid);
            ShowPlayerBankDialog(playerid);
            return 1;
        }
        new file2[50], string2[MAX_PLAYER_NAME],N[MAX_PLAYERS],sname[MAX_PLAYER_NAME],player;
        GetPVarString(playerid, "transfer_name", string2, sizeof(string2));
        format(file2, sizeof(file2), BANK_FILE, string2);
        dini_IntSet(file, "Balance", dini_Int(file, "Balance")-strval(inputtext));
        dini_IntSet(file2, "Balance", dini_Int(file2, "Balance")+strval(inputtext));
        format(string, sizeof(string), "Success: You have transfered $%d to %s's account.", strval(inputtext), string2, player);
        SendClientMessage(playerid, COLOR_GREEN, string);
        {
        GetPlayerName(player, sname, sizeof(sname));
        format(string, sizeof(string), "$%d has been wired to your account by %s.",strval(inputtext),sname,playerid);
        }SendClientMessage(player,0xFFD7C4FF,string);
        SetPVarString(playerid, "transfer_name", " ");
        ShowPlayerBankDialog(playerid);
But the problem is with this:
pawn Код:
new file2[50], string2[MAX_PLAYER_NAME],N[MAX_PLAYERS],sname[MAX_PLAYER_NAME],player;
        GetPVarString(playerid, "transfer_name", string2, sizeof(string2));
        format(file2, sizeof(file2), BANK_FILE, string2);
        dini_IntSet(file, "Balance", dini_Int(file, "Balance")-strval(inputtext));
        dini_IntSet(file2, "Balance", dini_Int(file2, "Balance")+strval(inputtext));
        format(string, sizeof(string), "Success: You have transfered $%d to %s's account.", strval(inputtext), string2);
        SendClientMessage(playerid, COLOR_GREEN, string);
        {
        GetPlayerName(player, sname, sizeof(sname));
        format(string, sizeof(string), "$%d has been wired to your account by %s.",strval(inputtext),sname);
        }SendClientMessage(player,0xFFD7C4FF,string);
        SetPVarString(playerid, "transfer_name", " ");
        ShowPlayerBankDialog(playerid);
Reply


Messages In This Thread
Small Help - by zack3021 - 27.10.2010, 23:08
Re: Small Help - by zack3021 - 27.10.2010, 23:33
Re: Small Help - by Crayon - 27.10.2010, 23:56
Re: Small Help - by zack3021 - 28.10.2010, 01:18
Re: Small Help - by Scenario - 28.10.2010, 02:32
Re: Small Help - by zack3021 - 28.10.2010, 02:41
Re: Small Help - by Scenario - 28.10.2010, 02:47
Re: Small Help - by Simon - 28.10.2010, 03:00

Forum Jump:


Users browsing this thread: 2 Guest(s)