23.07.2013, 01:28
try this form
pawn Код:
if(dialogid == DIALOG_BANK)
{
if(response)
{
switch(listitem)
{
case 0:
{
new string[128];
format(string, sizeof(string), "{3BB9FF}You have {008000}$%i {3BB9FF}in your bank.", PlayerInfo[playerid][pBank]);
strcat(string, "\nHow much would you like to withdraw?");
ShowPlayerDialog(playerid, DIALOG_WITHDRAW, DIALOG_STYLE_INPUT, "Withdrawal", string, "Confirm", "Cancel");
}
case 1:
{
ShowPlayerDialog(playerid, DIALOG_DEPOSIT, DIALOG_STYLE_INPUT, "Deposit", "How much would you like to deposit?", "Confirm", "Cancel");
}
case 2:
{
SendClientMessage(playerid, COLOR_GREY, "This feature is currently being developed.");
}
}
}
}
if(dialogid == DIALOG_WITHDRAW)
{
if(response)
{
if(!IsNumeric(inputtext))
{
new cash;
cash = strval(inputtext);
if(cash <= PlayerInfo[playerid][pBank])
{
PlayerInfo[playerid][pBank] = PlayerInfo[playerid][pBank] - cash;
GivePlayerCash(playerid, cash);
}
else SendClientMessage(playerid, COLOR_GREY, "You don't have enough money in your bank account.");
}
else SendClientMessage(playerid, COLOR_GREY, "The amount entered is not numeric!");
}
}
if(dialogid == DIALOG_DEPOSIT)
{
if(response)
{
if(!IsNumeric(inputtext))
{
new cash;
cash = strval(inputtext);
if(cash <= PlayerInfo[playerid][pCash])
{
GivePlayerCash(playerid, -cash);
PlayerInfo[playerid][pBank] = PlayerInfo[playerid][pBank] + cash;
}
else SendClientMessage(playerid, COLOR_GREY, "You don't have that much money on you.");
}
else SendClientMessage(playerid, COLOR_GREY, "The amount entered is not numeric!");
}
}