Buy dialog
#1

hello i have made a /buy cmd' with a dialog, the dialog show's up, but when i select what to buy.

it doesn't "buy" it, means doesn't take the money from me.. he's the cmd + the dialog.

CMD:
Код:
//==================================================================================================
CMD:buy(playerid, params[])
{
    if(!IsPlayerInRangeOfPoint(playerid, 15.0, 6.091179,-29.271898,1003.549438)) return SendClientMessage(playerid, COLOR_GREY, "You are not inside of a 24/7");
    ShowPlayerDialog(playerid, DIALOG_BUY, DIALOG_STYLE_LIST, "Store:", "Chips ($15)\nBurger($10)", "Purchase", "Cancel");
    return 1;
}
//==================================================================================================
DIALOG:
Код:
if(dialogid == DIALOG_BUY)
   	       {
	          if(response)
	          {
	               if(listitem == 0)
	               {
                        if(GetPlayerMoney(playerid) < 15) return SendClientMessage(playerid, 0xAFAFAFAA, "You don't have enough cash.");
        	            GivePlayerMoney(playerid, -15);
  	        		    SetPlayerHealth(playerid, -50);
  	        	        SendClientMessage(playerid, COLOR_GREENYELLOW, "You have bought a chips");
	               }
	               if(listitem == 1)
	               {
                        if(GetPlayerMoney(playerid) < 10) return SendClientMessage(playerid, 0xAFAFAFAA, "You don't have enough cash.");
    		            GivePlayerMoney(playerid, -10);
        		        SendClientMessage(playerid, COLOR_GREENYELLOW, "You have bought a burger");
	               }
	           }
			   return 1;
			}
I also definded it as my 6 dialog
Код:
#define DIALOG_BUY 			6
Reply


Messages In This Thread
Buy dialog - by DannySnoopy - 20.03.2012, 15:39
Re: Buy dialog - by DannySnoopy - 20.03.2012, 17:16
Re: Buy dialog - by DannySnoopy - 20.03.2012, 19:26
Re: Buy dialog - by rpx - 20.03.2012, 19:30
Re: Buy dialog - by tyler12 - 20.03.2012, 19:38
Re: Buy dialog - by DannySnoopy - 20.03.2012, 19:48
Re: Buy dialog - by DannySnoopy - 20.03.2012, 20:10
Re: Buy dialog - by DannySnoopy - 20.03.2012, 22:48

Forum Jump:


Users browsing this thread: 1 Guest(s)