Dialog dont open
#1

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;
	}
Reply
#2

Help please?
Reply
#3

Please help?
Reply
#4

Show code where you show dialog to player.
Reply
#5

This?

Код:
	if (strcmp("/Bank", cmdtext, true, 10) == 0)
	{
		if(IsPlayerInRangeOfPoint(playerid,15.0,2313,-4, 27))
		{
		ShowPlayerDialog(playerid,1125,DIALOG_STYLE_LIST,"BGW BANK","Депозит\nИзтегляне\nСметка\nТрансфер","Избери","Откажи");
		}
		else
		{
		SendClientMessage(playerid,COLOR_RED,"Трябва да бъдеш в банката!");
		}
		return 1;
	}
Reply
#6

Yea, in this you enter dialogid as 1125.
In OnDialogResponse you enter if(dialogid == BANKA5 && response).
You sure BANKA5 is define as 1125?
Reply
#7

Код:
#define BANKA5 40245
Reply
#8

Change it to:
Код:
#define BANKA5 1125
Or change all:
Код:
ShowPlayerDialog(playerid,1125,DIALOG_STYLE_LIST,"BGW BANK","Депозит\nИзтегляне\nСметка\nТрансфер","Избери","Откажи");
To:
Код:
ShowPlayerDialog(playerid,BANKA5,DIALOG_STYLE_LIST,"BGW BANK","Депозит\nИзтегляне\nСметка\nТрансфер","Избери","Откажи");
And try now.
Reply
#9

I tried 2 ways but dont work.. The bank it's in one filterscript with my jobs and they dont work. I think the problem is in the script. All dialogs dont work.
Reply
#10

Show us how you have defined the dialogs
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)