Help with converting: simple dialog to y_dialog -
HeLiOn_PrImE - 01.06.2013
Hey guys, I am trying to understand ******' s dialog include, but so far I failed over and over again. If some of you have experience with the y_dialog include, please explain, and show me how to convert the code below, so I can understand, and get to work.
Код:
public OnDialogResponse(playerid)
if(!strcmp(cmdtext, "/drinks", true))
{
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "What is it that you want?", "Sprunk ($1)\nBeer ($2)\nWine ($3)", "Purchase", "Cancel");
return 1;
}
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(response)// They pressed the first button.
{
switch(dialogid)// If you only have one dialog, then this isn't required, but it's neater for when you implement more dialogs.
{
case 1:// Our dialog!
{
switch(listitem)// Checking which listitem was selected
{
case 0:// The first item listed
{
if(GetPlayerMoney(playerid) < 1) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
GivePlayerMoney(playerid, -1);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_SPRUNK);
}
case 1: // The second item listed
{
if(GetPlayerMoney(playerid) < 2) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
GivePlayerMoney(playerid, -2);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_BEER);
}
case 2: // The third item listed
{
if(GetPlayerMoney(playerid) < 3) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
GivePlayerMoney(playerid, -3);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_WINE);
}
}
}
}
}
return 1;
}
Re: Help with converting: simple dialog to y_dialog -
HeLiOn_PrImE - 01.06.2013
bump
Re: Help with converting: simple dialog to y_dialog -
HeLiOn_PrImE - 02.06.2013
bump
Re: Help with converting: simple dialog to y_dialog -
HeLiOn_PrImE - 02.06.2013
no one?
Re: Help with converting: simple dialog to y_dialog -
Scenario - 02.06.2013
Go read the forum rules before you receive an infraction.
Re: Help with converting: simple dialog to y_dialog -
HeLiOn_PrImE - 03.06.2013
Sorry about that, but this topic is going to the bottom really fast and I got no answer at all...
Re: Help with converting: simple dialog to y_dialog -
HeLiOn_PrImE - 03.06.2013
Quote:
Originally Posted by ******
This is on my list of things to get to, but I'm a little busy with something VERY important atm so can't write out the code.
|
Your help will be much appreciated.
Re: Help with converting: simple dialog to y_dialog -
Pottus - 03.06.2013
But y_inline/y_dialog is so easy to use you should be able to do it yourself with minimal effort I'd never make another dialog without it!
Re: Help with converting: simple dialog to y_dialog -
HeLiOn_PrImE - 04.06.2013
Then please post an example code here for a list dialog!!! That's all I need. A good example.
Re: Help with converting: simple dialog to y_dialog -
Scenario - 04.06.2013
Search for one..?