28.11.2014, 17:41
Hello i have problem with my bank dialog.. When i write the command the dialog opens but when i choose one option the dialog closes..
Код:
if(dialogid == BANKA) //deposit { new file[100],Name[MAX_PLAYER_NAME]; GetPlayerName(playerid,Name,sizeof(Name)); format(file,sizeof(file),PlayerFile,Name); if(!response) return ShowPlayerDialog(playerid,1125,DIALOG_STYLE_LIST,"Bank","Deposit\nWithdraw\nBalance\nTransfer","Select","Cancel"); else if(strval(inputtext) > GetPlayerMoney(playerid)) return SendClientMessage(playerid,COLOR_RED,"You Don't Have That Amount!"); else if(!IsNumeric(inputtext)) { new string[128]; format(string,sizeof(string),"Your Curret Balance Is : %d\nEnter The Amount You Want To Deposit Below :",pInfo[playerid][Deposit]); ShowPlayerDialog(playerid,1122,DIALOG_STYLE_INPUT,"Deposit",string,"Deposit","Back"); SendClientMessage(playerid,COLOR_RED,"Please Use Numbers"); } else { GivePlayerMoney(playerid,-strval(inputtext)); pInfo[playerid][Deposit] += strval(inputtext); new string[128]; format(string,sizeof(string),"You Have Deposited : %d$",strval(inputtext)); SendClientMessage(playerid,COLOR_YELLOW,string); dini_IntSet(file,"Deposit",pInfo[playerid][Deposit]); new string2[128]; format(string2,128,"Your New Balance Is : %d$",pInfo[playerid][Deposit]); SendClientMessage(playerid,COLOR_YELLOW,string2); ShowPlayerDialog(playerid,1125,DIALOG_STYLE_LIST,"Bank","Deposit\nWithdraw\nBalance\nTransfer","Select","Cancel"); } return 1; } if(dialogid == BANKA2) //withdraw { new file[100],Name[MAX_PLAYER_NAME]; GetPlayerName(playerid,Name,sizeof(Name)); format(file,sizeof(file),PlayerFile,Name); if(!response) return ShowPlayerDialog(playerid,1125,DIALOG_STYLE_LIST,"Bank","Deposit\nWithdraw\nBalance\nTransfer","Select","Cancel"); else if(strval(inputtext) > pInfo[playerid][Deposit]) return SendClientMessage(playerid,COLOR_RED,"You Don't Have That Amount In Bank!"); else if(!IsNumeric(inputtext)) { new string[128]; format(string,sizeof(string),"Your Current Balance Is :%d\nEnter The Amount You Want To Withdraw Below :",pInfo[playerid][Deposit]); ShowPlayerDialog(playerid,1123,DIALOG_STYLE_INPUT,"Withdraw",string,"Withdraw","Back"); SendClientMessage(playerid,COLOR_RED,"Please Use Numbers"); } else { GivePlayerMoney(playerid,strval(inputtext)); pInfo[playerid][Deposit] -= strval(inputtext); new string[128]; format(string,sizeof(string),"You Have Withdrawed : %d$",strval(inputtext)); SendClientMessage(playerid,COLOR_YELLOW,string); dini_IntSet(file,"Deposit",pInfo[playerid][Deposit]); new string2[128]; format(string2,128,"Your New Balance Is : %d$",pInfo[playerid][Deposit]); SendClientMessage(playerid,COLOR_YELLOW,string2); ShowPlayerDialog(playerid,1125,DIALOG_STYLE_LIST,"Bank","Deposit\nWithdraw\nBalance\nTransfer","Select","Cancel"); } return 1; } if(dialogid == BANKA3) { if(!response) return ShowPlayerDialog(playerid,1125,DIALOG_STYLE_LIST,"Bank","Deposit\nWithdraw\nBalance\nTransfer","Select","Cancel"); else { ShowPlayerDialog(playerid,1125,DIALOG_STYLE_LIST,"Bank","Deposit\nWithdraw\nBalance\nTransfer","Select","Cancel"); } return 1; } if(dialogid == BANKA) //transfer (choose playerid) { if(!response) return ShowPlayerDialog(playerid,1125,DIALOG_STYLE_LIST,"Bank","Deposit\nWithdraw\nBalance\nTransfer","Select","Cancel"); else if(strval(inputtext) == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_RED,"Player Not Online"); else if(!IsNumeric(inputtext)) { new string[128]; format(string,sizeof(string),"Your Current Balance Is :%d$\nEnter The Player ID You Want To Transfer To Below :",pInfo[playerid][Deposit]); ShowPlayerDialog(playerid,1130,DIALOG_STYLE_INPUT,"Transfer",string,"Next","Back"); SendClientMessage(playerid,COLOR_RED,"Please Use ID Not Name"); } else { chosenpid = strval(inputtext); new string[128]; format(string,sizeof(string),"Balance : %d\nChosen Player ID : %d\nNow Enter The Amount You Want To Transfer",pInfo[playerid][Deposit],chosenpid); ShowPlayerDialog(playerid,1131,DIALOG_STYLE_INPUT,"Transfer",string,"Transfer","Back"); } return 1; } if(dialogid == BANKA4) //transfer (choose amount) { new file[100],Name[MAX_PLAYER_NAME]; GetPlayerName(playerid,Name,sizeof(Name)); format(file,sizeof(file),PlayerFile,Name); if(!response) return ShowPlayerDialog(playerid,1125,DIALOG_STYLE_LIST,"Bank","Deposit\nWithdraw\nBalance\nTransfer","Select","Cancel"); else if(strval(inputtext) > pInfo[playerid][Deposit]) return SendClientMessage(playerid,COLOR_RED,"You Don't Have That Amount In Bank To Transfer"); else if(!IsNumeric(inputtext)) { new string[128]; format(string,sizeof(string),"Chosen Player ID : %d\nNow Enter The Amount You Want To Transfer",chosenpid); ShowPlayerDialog(playerid,1131,DIALOG_STYLE_INPUT,"Transfer",string,"Transfer","Back"); SendClientMessage(playerid,COLOR_RED,"Please Use Numbers"); } else { pInfo[playerid][Deposit] -= strval(inputtext); pInfo[chosenpid][Deposit] += strval(inputtext); new string[128]; format(string,sizeof(string),"You Transfered %d$ To ID %d Bank Account",strval(inputtext),chosenpid); SendClientMessage(playerid,COLOR_YELLOW,string); dini_IntSet(file,"Deposit",pInfo[playerid][Deposit]); new string2[128]; format(string2,128,"Your New Balance Is : %d$",pInfo[playerid][Deposit]); SendClientMessage(playerid,COLOR_YELLOW,string2); new string3[128]; format(string3,128,"ID : %d Transfered %d$ To Your Bank Account",playerid,strval(inputtext)); SendClientMessage(chosenpid,COLOR_YELLOW,string3); new string4[128]; format(string4,128,"Your New Balance : %d$",pInfo[chosenpid][Deposit]); SendClientMessage(chosenpid,COLOR_YELLOW,string4); ShowPlayerDialog(playerid,1125,DIALOG_STYLE_LIST,"Bank","Deposit\nWithdraw\nBalance\nTransfer","Select","Cancel"); } return 1; } if(dialogid == BANKA5 && response) // /bank { switch(listitem) { case 0: { new string[128]; format(string,sizeof(string),"Your Curret Balance Is : %d$\nEnter The Amount You Want To Deposit Below :",pInfo[playerid][Deposit]); ShowPlayerDialog(playerid,1122,DIALOG_STYLE_INPUT,"Deposit",string,"Deposit","Back"); } case 1: { new string[128]; format(string,sizeof(string),"Your Current Balance Is :%d\nEnter The Amount You Want To Withdraw Below :",pInfo[playerid][Deposit]); ShowPlayerDialog(playerid,1123,DIALOG_STYLE_INPUT,"Withdraw",string,"Withdraw","Back"); } case 2: { new string[128]; format(string,sizeof(string),"Your Balance Is %d$",pInfo[playerid][Deposit]); ShowPlayerDialog(playerid,1124,DIALOG_STYLE_MSGBOX,"Balance",string,"Ok","Back"); } case 3: { new string[128]; format(string,sizeof(string),"Your Current Balance Is :%d$\nEnter The Player ID You Want To Transfer To Below :",pInfo[playerid][Deposit]); ShowPlayerDialog(playerid,1130,DIALOG_STYLE_INPUT,"Transfer",string,"Next","Back"); } } return 1; }