Inputtext closing dialog box?
#6

pawn Код:
#define DBANKQ 2064
#define DBANKW 2065
#define DBANKD 2066
pawn Код:
if (dialogid == DBANKQ)
  {
    if (response == 1) // Withdraw
    {
      format(string, sizeof(string), "You have $%d in your account, and $%d in your wallet.\n\nHow much do you want to withdraw from your bank account:", PlayerInfo[playerid][pAccount],GetPlayerMoney(playerid));
      ShowPlayerDialog(playerid,DBANKW,DIALOG_STYLE_INPUT,"Q:RP - Bank Question",string,"Ok","Cancel");
    }
    else // Deposit
    {
      format(string, sizeof(string), "You have $%d in your account, and $%d in your wallet.\n\nHow much do you want to deposit into your bank account:", PlayerInfo[playerid][pAccount],GetPlayerMoney(playerid));
      ShowPlayerDialog(playerid,DBANKD,DIALOG_STYLE_INPUT,"Q:RP - Bank Question",string,"Ok","Cancel");
    }
    }
  if (dialogid == DBANKD) // BANK / DEPOSIT
  {
    if (response == 1) // OK
    {
      if(IsNull(inputtext))
      {
        format(string, sizeof(string), "You have $%d in your account, and $%d in your wallet.\n\nHow much do you want to deposit into your bank account:", PlayerInfo[playerid][pAccount],GetPlayerMoney(playerid));
        ShowPlayerDialog(playerid,DBANKD,DIALOG_STYLE_INPUT,"Q:RP - Bank Question",string,"Ok","Cancel");
        return 1;
            }
            if (strval(inputtext) > GetPlayerMoney(playerid) || strval(inputtext) < 1)
            {
              format(string, sizeof(string), "You have $%d in your account, and $%d in your wallet.\n\nHow much do you want to deposit into your bank account:", PlayerInfo[playerid][pAccount],GetPlayerMoney(playerid));
        ShowPlayerDialog(playerid,DBANKD,DIALOG_STYLE_INPUT,"Q:RP - Bank Question",string,"Ok","Cancel");
                return 1;
            }
            SafeGivePlayerMoney(playerid, (0 - strval(inputtext)));
            PlayerInfo[playerid][pCash] -= strval(inputtext);
            PlayerInfo[playerid][pAccount]=strval(inputtext)+PlayerInfo[playerid][pAccount];
    }
    else // CANCEL
    {

    }
        return 1;
  }
  if (dialogid == DBANKW) // WITHDRAW
  {
    if (response == 1) // OK
    {
      if(IsNull(inputtext))
      {
        format(string, sizeof(string), "You have $%d in your account, and $%d in your wallet.\n\nHow much do you want to withdraw from your bank account:", PlayerInfo[playerid][pAccount],GetPlayerMoney(playerid));
            ShowPlayerDialog(playerid,DBANKW,DIALOG_STYLE_INPUT,"Q:RP - Bank Question",string,"Ok","Cancel");
        return 1;
            }
      if (strval(inputtext) > PlayerInfo[playerid][pAccount] || strval(inputtext) < 1)
            {
              format(string, sizeof(string), "You have $%d in your account, and $%d in your wallet.\n\nHow much do you want to withdraw from your bank account:", PlayerInfo[playerid][pAccount],GetPlayerMoney(playerid));
        ShowPlayerDialog(playerid,DBANKW,DIALOG_STYLE_INPUT,"Q:RP - Bank Question",string,"Ok","Cancel");
                return 1;
            }
            SafeGivePlayerMoney(playerid,strval(inputtext));
            PlayerInfo[playerid][pCash] += strval(inputtext);
            PlayerInfo[playerid][pAccount]=PlayerInfo[playerid][pAccount]-strval(inputtext);
    }
    else // CANCEL
    {

    }
        return 1;
  }
pawn Код:
if(strcmp(cmd, "/withdraw", true) == 0)
    {
      if(IsPlayerConnected(playerid))
      {
        if(IsPlayerInRangeOfPoint(playerid, 50, -2158.8682,643.0779,1052.3750))
        {
                format(string, sizeof(string), "You have $%d in your account, and $%d in your wallet.\n\nHow much do you want to withdraw from your bank account:", PlayerInfo[playerid][pAccount],GetPlayerMoney(playerid));
        ShowPlayerDialog(playerid,DBANKW,DIALOG_STYLE_INPUT,"Q:RP - Bank Question",string,"Ok","Cancel");
                return 1;
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "  You are not at the Bank !");
          return 1;
            }
        }
        return 1;
    }
if(strcmp(cmd, "/bank", true) == 0 || strcmp(cmd, "/deposit", true) == 0)
    {
      if(IsPlayerConnected(playerid))
      {
        if(!IsPlayerInRangeOfPoint(playerid, 50, -2158.8682,643.0779,1052.3750))
        {
          SendClientMessage(playerid, COLOR_GREY, "  You are not at the Bank !");
          return 1;
        }
            format(string, sizeof(string), "You have $%d in your account, and $%d in your wallet.\n\nHow much do you want to deposit into your bank account:", PlayerInfo[playerid][pAccount],GetPlayerMoney(playerid));
      ShowPlayerDialog(playerid,DBANKD,DIALOG_STYLE_INPUT,"Q:RP - Bank Question",string,"Ok","Cancel");
            return 1;
        }
        return 1;
    }
Reply


Messages In This Thread
Inputtext closing dialog box? - by Antonio [G-RP] - 01.06.2010, 21:30
Re: Inputtext closing dialog box? - by Conroy - 01.06.2010, 21:52
Re: Inputtext closing dialog box? - by Conroy - 01.06.2010, 21:52
Re: Inputtext closing dialog box? - by Antonio [G-RP] - 01.06.2010, 22:05
Re: Inputtext closing dialog box? - by Antonio [G-RP] - 01.06.2010, 23:18
Re: Inputtext closing dialog box? - by [NYRP]Mike. - 01.06.2010, 23:29
Re: Inputtext closing dialog box? - by Antonio [G-RP] - 01.06.2010, 23:35
Re: Inputtext closing dialog box? - by [NYRP]Mike. - 01.06.2010, 23:36
Re: Inputtext closing dialog box? - by Antonio [G-RP] - 01.06.2010, 23:59
Re: Inputtext closing dialog box? - by [NYRP]Mike. - 02.06.2010, 00:01
Re: Inputtext closing dialog box? - by Antonio [G-RP] - 02.06.2010, 00:31
Re: Inputtext closing dialog box? - by [NYRP]Mike. - 02.06.2010, 00:32
Re: Inputtext closing dialog box? - by Antonio [G-RP] - 02.06.2010, 00:51
Re: Inputtext closing dialog box? - by Antonio [G-RP] - 02.06.2010, 02:23
Re: Inputtext closing dialog box? - by Antonio [G-RP] - 02.06.2010, 20:20
Re: Inputtext closing dialog box? - by Conroy - 02.06.2010, 21:22
Re: Inputtext closing dialog box? - by Antonio [G-RP] - 02.06.2010, 22:41
Re: Inputtext closing dialog box? - by aircombat - 02.06.2010, 23:37
Re: Inputtext closing dialog box? - by Antonio [G-RP] - 02.06.2010, 23:42
Re: Inputtext closing dialog box? - by aircombat - 03.06.2010, 00:13
Re: Inputtext closing dialog box? - by Antonio [G-RP] - 03.06.2010, 00:23
Re: Inputtext closing dialog box? - by Antonio [G-RP] - 03.06.2010, 00:35
Re: Inputtext closing dialog box? - by Calgon - 03.06.2010, 00:41
Re: Inputtext closing dialog box? - by Antonio [G-RP] - 03.06.2010, 01:41
Re: Inputtext closing dialog box? - by Calgon - 03.06.2010, 02:02
Re: Inputtext closing dialog box? - by Antonio [G-RP] - 03.06.2010, 02:29
Re: Inputtext closing dialog box? - by Antonio [G-RP] - 03.06.2010, 06:17
Re: Inputtext closing dialog box? - by Backwardsman97 - 03.06.2010, 06:32
Re: Inputtext closing dialog box? - by aircombat - 03.06.2010, 12:08
Re: Inputtext closing dialog box? - by Antonio [G-RP] - 03.06.2010, 21:51
Re: Inputtext closing dialog box? - by aircombat - 03.06.2010, 22:09
Re: Inputtext closing dialog box? - by Antonio [G-RP] - 03.06.2010, 22:35
Re: Inputtext closing dialog box? - by aircombat - 03.06.2010, 23:47
Re: Inputtext closing dialog box? - by Antonio [G-RP] - 03.06.2010, 23:51

Forum Jump:


Users browsing this thread: 2 Guest(s)