Dialog not showing
#1

Hello i am trying to make a dialog which will show the businesses i own but whenever i try to open the dialog nothing happens i tried crashdetect but not showing any errors this is my code:

Код:
case 2:
{
	new string4[128], string5[228];
	if(PlayerInfo[playerid][pBusinessID][0] > 0)
	{
		format(string4, sizeof(string4), "BusinessID\tBusiness Name\tBusiness Earnings\n%d\t%s\t$%d", PlayerInfo[playerid][pBusinessID][0], BusInfo[PlayerInfo[playerid][pBusinessID][0]][bName], BusInfo[PlayerInfo[playerid][pBusinessID][0]][bEarning]);
	}
	if(PlayerInfo[playerid][pBusinessID][0] == 0)
	{
		format(string4, sizeof(string4), "BusinessID\tBusiness Name\tBusiness Earnings\n-1\tNone\t$0");
	}
	if(PlayerInfo[playerid][pBusinessID][1] > 0)
	{
		format(string5, sizeof(string5), "%s\n%d\t%s\t%d", string4, PlayerInfo[playerid][pBusinessID][1], BusInfo[PlayerInfo[playerid][pBusinessID][1]][bName],BusInfo[PlayerInfo[playerid][pBusinessID][1]][bEarning]);
	}
	if(PlayerInfo[playerid][pBusinessID][1] == 0)
	{
		format(string5, sizeof(string5), "%s\n-1\tNone\t$0", string4);
	}

	ShowPlayerDialog(playerid, DIALOG_MY_BUSINESSES, DIALOG_STYLE_TABLIST_HEADERS, "My Businesses", string5, "Locate", "Back");
}
Reply
#2

PHP код:
case 2:
{
    new 
string4[128], string5[228];
    if(
PlayerInfo[playerid][pBusinessID][0] > 0)
    {
        
format(string4sizeof(string4), "BusinessID\tBusiness Name\tBusiness Earnings\n%d\t%s\t$%d"PlayerInfo[playerid][pBusinessID][0], BusInfo[PlayerInfo[playerid][pBusinessID][0]][bName], BusInfo[PlayerInfo[playerid][pBusinessID][0]][bEarning]);
    }
    else if(
PlayerInfo[playerid][pBusinessID][0] == 0)
    {
        
format(string4sizeof(string4), "BusinessID\tBusiness Name\tBusiness Earnings\n-1\tNone\t$0");
    }
    if(
PlayerInfo[playerid][pBusinessID][1] > 0)
    {
        
format(string5sizeof(string5), "%s\n%d\t%s\t%d"string4PlayerInfo[playerid][pBusinessID][1], BusInfo[PlayerInfo[playerid][pBusinessID][1]][bName],BusInfo[PlayerInfo[playerid][pBusinessID][1]][bEarning]);
    }
    else if(
PlayerInfo[playerid][pBusinessID][1] == 0)
    {
        
format(string5sizeof(string5), "%s\n-1\tNone\t$0"string4);
    }
    
ShowPlayerDialog(playeridDIALOG_MY_BUSINESSESDIALOG_STYLE_TABLIST_HEADERS"My Businesses"string5"Locate""Back");

Reply
#3

its the same i already tried else if
Reply
#4

Are you sure that 'case 2:' is done? If no, you can try with 'printf'
Reply
#5

Код:
				case 2:
				{
                    printf("before if statment");
				    new string4[128], string5[228];
                    printf("after variable creations");
				    if(PlayerInfo[playerid][pBusinessID][0] > 0)
				    {
				        format(string4, sizeof(string4), "BusinessID\tBusiness Name\tBusiness Earnings\n%d\t%s\t$%d", PlayerInfo[playerid][pBusinessID][0], BusInfo[PlayerInfo[playerid][pBusinessID][0]][bName], BusInfo[PlayerInfo[playerid][pBusinessID][0]][bEarning]);
				    }
				    else if(PlayerInfo[playerid][pBusinessID][0] == 0)
				    {
				        format(string4, sizeof(string4), "BusinessID\tBusiness Name\tBusiness Earnings\n-1\tNone\t$0");
				    }
				    if(PlayerInfo[playerid][pBusinessID][1] > 0)
				    {
				        format(string5, sizeof(string5), "%s\n%d\t%s\t%d", string4, PlayerInfo[playerid][pBusinessID][1], BusInfo[PlayerInfo[playerid][pBusinessID][1]][bName],BusInfo[PlayerInfo[playerid][pBusinessID][1]][bEarning]);
				    }
				    else if(PlayerInfo[playerid][pBusinessID][1] == 0)
				    {
				        format(string5, sizeof(string5), "%s\n-1\tNone\t$0", string4);
				    }
                    printf("After if statment");
				    ShowPlayerDialog(playerid, DIALOG_MY_BUSINESSES, DIALOG_STYLE_TABLIST_HEADERS, "My Businesses", string5, "Locate", "Back");
                    printf("After showdialog");
				}
yes case 2 is called this is the output
Код:
before if statment
after variable creations
After if statment
After showdialog
Reply
#6

Show DIALOG_MY_BUSINESSES definition.
Reply
#7

Quote:
Originally Posted by iKarim
Посмотреть сообщение
Show DIALOG_MY_BUSINESSES definition.
Код:
enum
{
	DIALOG_REGISTER,
	DIALOG_LOGIN,
 	DIALOG_MY_BUSINESSES
}
i dont think this has anything to do with the problem
Reply
#8

You could be formatting string4 but showing string5 which is empty. I think it does not show dialogs with empty content.
Reply
#9

Quote:
Originally Posted by MadeMan
Посмотреть сообщение
You could be formatting string4 but showing string5 which is empty. I think it does not show dialogs with empty content.
no i am not doing that take a look at the code
Reply
#10

Print the values of pBusinessID, string4, string5 before showing the dialog.
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)