Here Work Off Mine It works.. I dont use SwitchList Either or case: 0 I used If(response) and my Dialogs are Defined Easier for me to remember What im doing Hope it helps Just use What I have Change the PlayerInfo pbank Etc u can remove some of the Client Messages
pawn Код:
case DIALOG_BANKWITHDRAW: // when the dialog is DIALOG_BANKWITHDRAW (6)
{
if( response )
{
if( !IsNumeric( inputtext ) ) return SendClientMessage(playerid, RED, "Error Numbers Only "); // this will check if the inputtext contains numbers
if( strval( inputtext ) > PlayerInfo[playerid][pBank] ) return SendClientMessage( playerid, RED, "You dont have that amount of money on your bank! " ), ShowPlayerDialog( playerid, DIALOG_BANKWITHDRAW, DIALOG_STYLE_INPUT, "Bank Withdraw", "Please enter the amount of money you want to withdraw.", "Ok", "Back" ); // if the inputtext is higher then you have on your bank, it will show an error message
PlayerInfo[playerid][pBank] = ( PlayerInfo[playerid][pBank] - strval( inputtext ) ); // this will remove the money from your bank account
GivePlayerMoney( playerid, strval( inputtext ) ); // this will add the money from the bank account to your own money
new String[128];
format( String, sizeof String, "You withdrew $%i from your bank, and now got $%i on your bank left. ", strval( inputtext ), PlayerInfo[playerid][pBank] ); // formatting amessage which shows the amount you withdrew, and the money you have left
SendClientMessage( playerid, YELLOW, String ); // sending the message
ShowPlayerDialog( playerid, DIALOG_BANKHOME, DIALOG_STYLE_LIST, "Apocalypse Bank N Trust", "Balance\nWithdraw\nDeposit", "Select", "Close" ); // showing the dialog again, so you dont have to do /bankhome
}
else if( !response )
{
ShowPlayerDialog( playerid, DIALOG_BANKHOME, DIALOG_STYLE_LIST, "Apocalypse Bank N Trust", "Balance\nWithdraw\nDeposit", "Select", "Close" ); // when you press the button 'Back', it will go to /bankhome
}
}
case DIALOG_BANKDEPOSIT: // when the dialog is DIALOG_BANKDEPOSIT (7)
{
if( response )
{
if( !IsNumeric( inputtext ) ) return SendClientMessage(playerid, RED, "Numbers only! "); // this will check if the inputtext contains numbers
if( GetPlayerMoney( playerid ) < strval( inputtext ) ) return SendClientMessage( playerid, RED, "You dont have that much money. "), ShowPlayerDialog( playerid, DIALOG_BANKDEPOSIT, DIALOG_STYLE_INPUT, "Bank Deposit", "Please enter the amoutn of money you want to deposit. ", "Ok", "Back" ); // if your money is lower as the amount you entered, it will give you an error message and show the same dialog
PlayerInfo[playerid][pBank] = ( PlayerInfo[playerid][pBank] + strval( inputtext ) ); // adding the amount of money to your bank account
GivePlayerMoney( playerid, - strval( inputtext) ); // removing the money from 'pocket'
new String[128];
format( String, sizeof String, "You Deposited $%i in your account, and now got $%i on your bank account. ", strval( inputtext ), PlayerInfo[playerid][pBank] ); // formatting the message which howmutch you depositted, and the amount you now got on your bank
SendClientMessage( playerid, YELLOW, String ); // sending the message
ShowPlayerDialog( playerid, DIALOG_BANKHOME, DIALOG_STYLE_LIST, "Apocalypse Bank N Trust", "Balance\nWithdraw\nDeposit", "Select", "Close" ); // showing /bankhome dialog again
}
else if( !response )
{
ShowPlayerDialog( playerid, DIALOG_BANKHOME, DIALOG_STYLE_LIST, "Apocalypse Bank N Trust", "Balance\nWithdraw\nDeposit", "Select", "Close" ); // when you press the button 'Back', it will go to /bankhome
}
}
}