dialog doesn't respond
#1

Код:
    if(pickupid == bank)
    {
	  ShowPlayerDialog (playerid, DIALOG_BANK, DIALOG_STYLE_LIST, "Bank", "Deposit - control \nWithdraw -     Remove \nBalance - Balance " , "Cancel" , "Select " ) ;
      return 1;
	}
and then it doesn't respond to this:

Код:
	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 " ) ;
		}
	}
Reply
#2

https://sampwiki.blast.hk/wiki/OnDialogResponse

listitem is start at 0 as frist text line

and "Cancel" , "Select " are wrong cause
https://sampwiki.blast.hk/wiki/ShowPlayerDialog

left button is mean response

so in your case:

PHP код:
"Deposit - control \nWithdraw -     Remove \nBalance - Balance " "Cancel" "Select "
//Deposit - 0
//Withdraw - 1
//Balance - 2
//Cancel - response
//Select - !response 
so will not call to

PHP код:
switch (listitem)
            {
                case 
1ShowPlayerDialog (playeridDIALOG_DEPOSITDIALOG_STYLE_INPUT"Deposit"" Please enter the amount " "Cancel" " control " ) ;
                case 
2ShowPlayerDialog (playeridDIALOG_WITHDRAWDIALOG_STYLE_INPUT"Withdraw"" Please enter the amount " "Cancel" " pull " ) ;
                case 
:
                {
                    
format (szString50"Your Balance:% d"PlayerInfo [playerid] [pBankAccount]);
                    
ShowPlayerDialog (playerid123DIALOG_STYLE_MSGBOX"Balance"szString" Cancel" "OK " ) ;
                }
            } 
Reply
#3

still doesn't respond ;/

Код:
if (dialogid == DIALOG_BANK)
	{
		if ( ! response ) return 0;
		if ( response )
		{
			switch (listitem)
			{
				case 0: ShowPlayerDialog (playerid, DIALOG_DEPOSIT, DIALOG_STYLE_INPUT, "Deposit", " Please enter the amount " , "Cancel" , " control " ) ;
				case 1: ShowPlayerDialog (playerid, DIALOG_WITHDRAW, DIALOG_STYLE_INPUT, "Withdraw", " Please enter the amount " , "Cancel" , " pull " ) ;
				case 2 :
				{
					format (szString, 50, "Your Balance:% d", PlayerInfo [playerid] [pBankAccount]);
					ShowPlayerDialog (playerid, 123, DIALOG_STYLE_MSGBOX, "Balance", szString, " Cancel" , "OK " ) ;
				}
			}
		}
	}
if i select for ex. withdraw or deposit it doesnt show any dialog at all
Reply
#4

Quote:
Originally Posted by Lukasz56
Посмотреть сообщение
still doesn't respond ;/

if i select for ex. withdraw or deposit it doesnt show any dialog at all
umm... i guess that
PHP код:
 ShowPlayerDialog (playeridDIALOG_BANKDIALOG_STYLE_LIST"Bank""Deposit - control \nWithdraw -     Remove \nBalance - Balance " "Cancel" "Select " ) ; 
you still not change that Parameters :
Код:
button1[]	The text on the left button.
button2[]	The text on the right button. Leave it blank ( "" ) to hide it.
https://sampwiki.blast.hk/wiki/ShowPlayerDialog


so when you click "select" it will call to OnDialogResponse
but response is 0
https://sampwiki.blast.hk/wiki/OnDialogResponse

so will stop at
PHP код:
if ( ! response ) return 0
to fix , change
PHP код:
 ShowPlayerDialog (playeridDIALOG_BANKDIALOG_STYLE_LIST"Bank""Deposit - control \nWithdraw -     Remove \nBalance - Balance " "Select" "Cancel " ) ;
// button 1 and 2  , "Select" , "Cancel " 
Reply
#5

Try this
PHP код:
if (dialogid == DIALOG_BANK)
    {
        if ( ! 
response ) return 1;
        if ( 
response )
        {
            switch (
listitem)
            {
                case 
1ShowPlayerDialog (playeridDIALOG_DEPOSITDIALOG_STYLE_INPUT"Deposit"" Please enter the amount " "Cancel" " control " ) ;
                case 
2ShowPlayerDialog (playeridDIALOG_WITHDRAWDIALOG_STYLE_INPUT"Withdraw"" Please enter the amount " "Cancel" " pull " ) ;
                case 
:
                {
                    
format (szString50"Your Balance:% d"PlayerInfo [playerid] [pBankAccount]);
                    
ShowPlayerDialog (playerid123DIALOG_STYLE_MSGBOX"Balance"szString" Cancel" "OK " );
                    return 
1;
                }
            }
        }
    }
    if (
dialogid == DIALOG_DEPOSIT)
    {
        if ( ! 
response ) return 1;
        if ( 
response )
        {
            if (! 
strlen (inputtext)) return ShowPlayerDialog (playeridDIALOG_DEPOSITDIALOG_STYLE_INPUT"Deposit"" Please enter the amount " "Cancel" " control " ) ;
            if (
GetPlayerMoney (playerid) <strval (inputtext)) return ShowPlayerDialog (playeridDIALOG_DEPOSITDIALOG_STYLE_INPUT"Deposit"" you do not have the amount requested , please type a new amount " "Cancel" " control " ) ;
            
format (szString256" You can deposit up to % d"MAX_DEPOSIT);
            if (
strval (inputtext)> MAX_DEPOSIT) return ShowPlayerDialog (playeridDIALOG_DEPOSITDIALOG_STYLE_INPUT"Deposit"szString" Cancel" " control " ) ;
            
GivePlayerMoney (playerid,-strval (inputtext));
            
PlayerInfo[playerid][pBankAccount] += strval(inputtext);
            
SendClientMessage (playerid, -1" Deposition successfully " ) ;
            return 
1;
        }
    }
    if (
dialogid == DIALOG_WITHDRAW && response)
    {
        if ( ! 
response ) return 1;
        if ( 
response )
        {
            if (! 
strlen (inputtext)) return ShowPlayerDialog (playeridDIALOG_WITHDRAWDIALOG_STYLE_INPUT"Withdraw"" Please enter the amount " "Cancel" " pull " ) ;
            if(
PlayerInfo[playerid][pBankAccount]>=strval(inputtext))return ShowPlayerDialog(playeridDIALOG_WITHDRAWDIALOG_STYLE_INPUT"Withdraw""you do not have the amount requested , please type a new amount""Cancel""pull " ) ;
            
format (szString256" You can pull up to % d"MAX_WITHDRAW);
            if (
strval (inputtext)> MAX_WITHDRAW) return ShowPlayerDialog (playeridDIALOG_WITHDRAWDIALOG_STYLE_INPUT"Deposit"szString" Cancel" " pull " ) ;
            
GivePlayerMoney (playeridstrval (inputtext));
            
PlayerInfo [playerid] [pBankAccount]-= strval (inputtext);
            
SendClientMessage (playerid, -1" You pulled successfully " ) ;
            return 
1;
        }
    } 
Don't trust me but at least try
Reply
#6

still doesn't work :/ tried Mick123's solution also but it didn't work as well
Reply
#7

ok..umm

so if that you dont want to change button string,

then try this,

PHP код:
if(pickupid == bank)
{
    
ShowPlayerDialog (playeridDIALOG_BANKDIALOG_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 
0ShowPlayerDialog (playeridDIALOG_DEPOSITDIALOG_STYLE_INPUT"Deposit"" Please enter the amount " "Cancel" " control " ) ;
            case 
1ShowPlayerDialog (playeridDIALOG_WITHDRAWDIALOG_STYLE_INPUT"Withdraw"" Please enter the amount " "Cancel" " pull " ) ;
            case 
2:
            {
                
format (szString50"Your Balance:% d"PlayerInfo [playerid] [pBankAccount]);
                
ShowPlayerDialog (playerid123DIALOG_STYLE_MSGBOX"Balance"szString" Cancel" "OK " ) ;
            }
        }
    }
}
if (
dialogid == DIALOG_DEPOSIT)
{
    if ( 
response ) return 0;
    if ( !
response )
    {
        if (! 
strlen (inputtext)) return ShowPlayerDialog (playeridDIALOG_DEPOSITDIALOG_STYLE_INPUT"Deposit"" Please enter the amount " "Cancel" " control " ) ;
        if (
GetPlayerMoney (playerid) <strval (inputtext)) return ShowPlayerDialog (playeridDIALOG_DEPOSITDIALOG_STYLE_INPUT"Deposit"" you do not have the amount requested , please type a new amount " "Cancel" " control " ) ;
        
format (szString256" You can deposit up to % d"MAX_DEPOSIT);
        if (
strval (inputtext)> MAX_DEPOSIT) return ShowPlayerDialog (playeridDIALOG_DEPOSITDIALOG_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 (playeridDIALOG_WITHDRAWDIALOG_STYLE_INPUT"Withdraw"" Please enter the amount " "Cancel" " pull " ) ;
        if(
PlayerInfo[playerid][pBankAccount]>=strval(inputtext))return ShowPlayerDialog(playeridDIALOG_WITHDRAWDIALOG_STYLE_INPUT"Withdraw""you do not have the amount requested , please type a new amount""Cancel""pull " ) ;
        
format (szString256" You can pull up to % d"MAX_WITHDRAW);
        if (
strval (inputtext)> MAX_WITHDRAW) return ShowPlayerDialog (playeridDIALOG_WITHDRAWDIALOG_STYLE_INPUT"Deposit"szString" Cancel" " pull " ) ;
        
GivePlayerMoney (playeridstrval (inputtext));
        
PlayerInfo [playerid] [pBankAccount]-= strval (inputtext);
        
SendClientMessage (playerid, -1" You pulled successfully " ) ;
    }

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)