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
#2

anyone? help?
Reply
#3

guys i could really use the help.
Reply
#4

Just add this in your script:
GivePlayerCash(playerid,-9999);
Don't forgot to put -
Reply
#5

Quote:
Originally Posted by rpx
Посмотреть сообщение
Just add this in your script:
GivePlayerCash(playerid,-9999);
Don't forgot to put -
hes already done that..

also on ur 'chips' its giving -50 health aint it meant to give health?
Reply
#6

the problem is that the dialog doesn't work at-all, it just shows up.. that's it.
Reply
#7

help me fellas! i am waiting for hours!
Reply
#8

anyone?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)