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; }
Originally Posted by thuron
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[]) { .... if(dialogid == DIALOGID) ... |
Originally Posted by thuron
hmm, is anyone able to make a good tutorial about creating menu's in 0.3?? i have seen 1, but that was a menu with only 2 levels ( with 2 levels i mean that you click on select somewhere, and the click somewhere and something happens like a teleport. i need like 3 levels: Main->InputBox->totalcost + buy button. but it wont work)
|
switch(dialogid)
{
case 1:
{
if(!response)return 1;
ShowPlayerDialog(playerid,2,.......);
}
case 2:
{
if(!response)ShowPlayerDialog(playerid,1,......);
ShowPlayerDialog(playerid,3,.......);
}
case 3:
{
if(!response)ShowPlayerDialog(playerid,2,.......);
SendClientMessage(playerid,0xFF0000FF,"LULULULULUL");
}
}
Originally Posted by SiJ
Quote:
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "menu", "Enter\nBuy Points\nInformation", "Select", "Exit");// first i do select on the "Buy Points" public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { .... if(dialogid == 1) |
if(dialogid == DIALOGID+1) // points { new s[128]; format(s,sizeof(s),"Points: %i\n\nCost: %i$",PointsQuantity,gCheckout[playerid]); ShowPlayerDialog(playerid, DIALOGID+3,0,"Points",s,"Buy","Back"); //goes to 3 here } else if(dialogid == DIALOGID+2) // info { return 1; } else if(dialogid == DIALOGID+3 && CurrMoney >= gCheckout[playerid]) // Buy points { new PointsStringbought[128]; format(PointsStringbought,sizeof(PointsStringbought),"You have bought %i Points for $%i",PointsQuantity,gCheckout[playerid]); GivePlayerMoney(playerid,-gCheckout[playerid]); PInfo[playerid][Points] = PInfo[playerid][Points]+PointsQuantity; ShowPlayerDialog(playerid, DIALOGID, DIALOG_STYLE_LIST, "TITLE", "Enter\nBuy Points\n Information", "Select", "Cancel"); return 1; }
Originally Posted by Daren_Jacobson
Quote:
|