26.10.2009, 21:10
i wanted to make a nice menu, but now it wont work.
It will go to DIALOG+3 with the BUY button, but it wont get any money off, or send me messages. how can i fix this?
Код:
if (strcmp("/wmenu", cmdtext, true, 10) == 0) { ShowPlayerDialog(playerid, DIALOGID, DIALOG_STYLE_LIST, "menu", "Enter\nBuy Points\nInformation", "Select", "Exit");// first i do select on the "Buy Points" return 1; } public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { new Quantity = strval(inputtext); new CurrMoney = GetPlayerMoney(playerid); gCheckout[playerid]= Quantity*Cost; if(dialogid == DIALOGID) { if(response) { if(listitem == 0) { SendClientMessage(playerid,COLOR_BLUE,"some message here"); } if(listitem == 1) { ShowPlayerDialog(playerid, DIALOGID+1, DIALOG_STYLE_INPUT, "Points", "", "Select", "Cancel");// then i put a number in the inputbox and do "select" } } return 1; } if(dialogid == DIALOGID+1) { new s[128]; format(s,sizeof(s),"Points: %i\n\nCost: %i$",Quantity,gCheckout[playerid]); ShowPlayerDialog(playerid, DIALOGID+3,0,"lolzzzz",s,"Buy","Cancel"); //then i do buy } else if(dialogid == DIALOGID+3 && CurrMoney >= gCheckout[playerid]) { new PointsStringbought[128]; format(PointsStringbought,sizeof(PointsStringbought),"You have bought %i Points for $%i",PointsQuantity,gCheckout[playerid]); GivePlayerMoney(playerid,-gCheckout[playerid]); return 1; } else if(dialogid == DIALOGID+3 && CurrMoney <= gCheckout[playerid]) { SendClientMessage(playerid,COLOR_BLUE,"You do not have enough money."); return 1; } return 0; }