dialog problem
#1

Hey. i have a dialog DIALOG_STYLE_MSGBOX.
but when i click yes, nothing happens. but when i click no, it works
it doesn't say any messages when you click yes
here is the code
Код:
			format(string,sizeof(string), "Do you really want to buy %s for $%d?", AccessNames[listitem][modname], AccessNames[listitem][modprice]);
            ShowPlayerDialog(playerid, 283, DIALOG_STYLE_MSGBOX, "Buy Accessories", string, "Yes", "No");
Код:
    if(dialogid == 283) // ID is Buying Accessories
    {
        if(response)
        {
	        if(!IsAtClothShop(playerid)) {
	        TextDrawHideForPlayer(playerid, centerMHUDInfo[playerid]);
	        isplayerumtd[playerid] = 0;
			return SendClientMessage(playerid,COLOR_GREY,"   You are not at a clothes shop.");
			}
            new biz = GetPlayerVirtualWorld(playerid);
			if(GetMoney(playerid) < AccessNames[listitem][modprice]) {
			isplayerumtd[playerid] = 0;
			TextDrawHideForPlayer(playerid, centerMHUDInfo[playerid]);
			return SendClientMessage(playerid, COLOR_GRAD1, "   You don't have enough money!");
			}
			new freeslot = -1;
			for(new i = 0; i < 7; i++)
			{
			    if(Accessories[playerid][i] == 0)
			    {
			        freeslot = i;
					break;
				}
			}
			if(freeslot == -1) {
			TextDrawHideForPlayer(playerid, centerMHUDInfo[playerid]);
			isplayerumtd[playerid] = 0;
			return SendClientMessage(playerid, COLOR_GRAD1, "  You don't have an empty slot!");
			}
			Accessories[playerid][freeslot] = AccessNames[listitem][modid];
			AccessoriesB[playerid][freeslot] = 1;
			AccessoriessX[playerid][freeslot] = 1;
			AccessoriessY[playerid][freeslot] = 1;
			AccessoriessZ[playerid][freeslot] = 1;
			BizInfo[biz][bTill] += AccessNames[listitem][modprice];
			BizInfo[biz][bProducts] -= 1;
			GiveMoney(playerid, -AccessNames[listitem][modprice]);
			SendClientMessage(playerid, COLOR_GRAD1, "  Tajhiz kharide shod! /inventory ra baraye estefade bezanid!");
            TextDrawHideForPlayer(playerid, centerMHUDInfo[playerid]);
            isplayerumtd[playerid] = 0;
		}
		else
		{
		        isplayerumtd[playerid] = 0;
		   		TextDrawHideForPlayer(playerid, centerMHUDInfo[playerid]);
  				new hugestring[4048];
			    for(new i = 0; i < sizeof(AccessNames); i++)
			    {
			        format(hugestring, sizeof(hugestring), "%s\n%s ($%d)", hugestring, AccessNames[i][modname], AccessNames[i][modprice]);
				}
				ShowPlayerDialog(playerid, 2420, DIALOG_STYLE_LIST, "Accessories", hugestring, "Buy", "Cancel");
		}
	}
Reply
#2

Then change the "Yes" to "No", vice versa.
Reply
#3

No, the no works perfectly
but the yes doesn't work at all
Reply
#4

PHP код:
 if(dialogid == 283// ID is Buying Accessories
    
{
        if(
response)
        {
            new 
biz GetPlayerVirtualWorld(playerid);
            if(
GetMoney(playerid) < AccessNames[listitem][modprice]) {
            
isplayerumtd[playerid] = 0;
            
TextDrawHideForPlayer(playeridcenterMHUDInfo[playerid]);
            return 
SendClientMessage(playeridCOLOR_GRAD1"   You don't have enough money!");
            }
            new 
freeslot = -1;
            for(new 
07i++)
            {
                if(
Accessories[playerid][i] == 0)
                {
                    
freeslot i;
                    break;
                }
            }
            if(
freeslot == -1) {
            
TextDrawHideForPlayer(playeridcenterMHUDInfo[playerid]);
            
isplayerumtd[playerid] = 0;
            return 
SendClientMessage(playeridCOLOR_GRAD1"  You don't have an empty slot!");
            }
            
Accessories[playerid][freeslot] = AccessNames[listitem][modid];
            
AccessoriesB[playerid][freeslot] = 1;
            
AccessoriessX[playerid][freeslot] = 1;
            
AccessoriessY[playerid][freeslot] = 1;
            
AccessoriessZ[playerid][freeslot] = 1;
            
BizInfo[biz][bTill] += AccessNames[listitem][modprice];
            
BizInfo[biz][bProducts] -= 1;
            
GiveMoney(playerid, -AccessNames[listitem][modprice]);
            
SendClientMessage(playeridCOLOR_GRAD1"  Tajhiz kharide shod! /inventory ra baraye estefade bezanid!");
            
TextDrawHideForPlayer(playeridcenterMHUDInfo[playerid]);
            
isplayerumtd[playerid] = 0;
        }
        else
        {
                
isplayerumtd[playerid] = 0;
                   
TextDrawHideForPlayer(playeridcenterMHUDInfo[playerid]);
                  new 
hugestring[4048];
                for(new 
0sizeof(AccessNames); i++)
                {
                    
format(hugestringsizeof(hugestring), "%s\n%s ($%d)"hugestringAccessNames[i][modname], AccessNames[i][modprice]);
                }
                
ShowPlayerDialog(playerid2420DIALOG_STYLE_LIST"Accessories"hugestring"Buy""Cancel");
        }
    } 
Reply
#5

Doesn't work.
i said if you click yes, it doesn't give you any errors.
Reply
#6

oh, i found out the problem.
the problem was that in the dialog_style_msgbox there is no listitem.
so i saved it in a variable.
and used it on the dialog 283.
thanks anyways.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)