27.11.2016, 08:40
Код:
if(pickupid == bank) { ShowPlayerDialog (playerid, DIALOG_BANK, DIALOG_STYLE_LIST, "Bank", "Deposit - control \nWithdraw - Remove \nBalance - Balance " , "Cancel" , "Select " ) ; return 1; }
Код:
if (dialogid == DIALOG_BANK) { if ( ! response ) return 0; if ( response ) { switch (listitem) { case 1: ShowPlayerDialog (playerid, DIALOG_DEPOSIT, DIALOG_STYLE_INPUT, "Deposit", " Please enter the amount " , "Cancel" , " control " ) ; case 2: ShowPlayerDialog (playerid, DIALOG_WITHDRAW, DIALOG_STYLE_INPUT, "Withdraw", " Please enter the amount " , "Cancel" , " pull " ) ; case 3 : { format (szString, 50, "Your Balance:% d", PlayerInfo [playerid] [pBankAccount]); ShowPlayerDialog (playerid, 123, DIALOG_STYLE_MSGBOX, "Balance", szString, " Cancel" , "OK " ) ; } } } } if (dialogid == DIALOG_DEPOSIT) { if ( ! response ) return 0; if ( response ) { if (! strlen (inputtext)) return ShowPlayerDialog (playerid, DIALOG_DEPOSIT, DIALOG_STYLE_INPUT, "Deposit", " Please enter the amount " , "Cancel" , " control " ) ; if (GetPlayerMoney (playerid) <strval (inputtext)) return ShowPlayerDialog (playerid, DIALOG_DEPOSIT, DIALOG_STYLE_INPUT, "Deposit", " you do not have the amount requested , please type a new amount " , "Cancel" , " control " ) ; format (szString, 256, " You can deposit up to % d", MAX_DEPOSIT); if (strval (inputtext)> MAX_DEPOSIT) return ShowPlayerDialog (playerid, DIALOG_DEPOSIT, DIALOG_STYLE_INPUT, "Deposit", szString, " Cancel" , " control " ) ; GivePlayerMoney (playerid,-strval (inputtext)); PlayerInfo[playerid][pBankAccount] += strval(inputtext); SendClientMessage (playerid, -1, " Deposition successfully " ) ; } } if (dialogid == DIALOG_WITHDRAW && response) { if ( ! response ) return 0; if ( response ) { if (! strlen (inputtext)) return ShowPlayerDialog (playerid, DIALOG_WITHDRAW, DIALOG_STYLE_INPUT, "Withdraw", " Please enter the amount " , "Cancel" , " pull " ) ; if(PlayerInfo[playerid][pBankAccount]>=strval(inputtext))return ShowPlayerDialog(playerid, DIALOG_WITHDRAW, DIALOG_STYLE_INPUT, "Withdraw", "you do not have the amount requested , please type a new amount", "Cancel", "pull " ) ; format (szString, 256, " You can pull up to % d", MAX_WITHDRAW); if (strval (inputtext)> MAX_WITHDRAW) return ShowPlayerDialog (playerid, DIALOG_WITHDRAW, DIALOG_STYLE_INPUT, "Deposit", szString, " Cancel" , " pull " ) ; GivePlayerMoney (playerid, strval (inputtext)); PlayerInfo [playerid] [pBankAccount]-= strval (inputtext); SendClientMessage (playerid, -1, " You pulled successfully " ) ; } }