Dialogs
#4

This is my problem:
[ame]http://www.youtube.com/watch?v=Qby6UfPZUEk[/ame]

Source:
public OnPlayerCommandText(playerid, cmdtext[])
{
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;
}
if(!strcmp(cmdtext, "/relax", true))
{
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_MSGBOX, "are you sure?", "Are you sure you have time to relax?", "yes", "no");
return 1;
}
return 0;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(response)//they pressed the first button
{
switch(dialogid)//if your using only one dialog this isn't needed but you never know.
{
case 1://our dialog
{
switch(listitem)//wich listitem is chosen
{
case 0://the first item in the list
{
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:
{
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:
{
if(GetPlayerMoney(playerid) < 3) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
GivePlayerMoney(playerid, -3);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_WINE);
}
}
}
//from here we added things
case 2://the new dialog
{
ApplyAnimation(playerid,"BEACH","Lay_Bac_Loop",4.1 ,1,1,1,1,10);//this will let you relax for 10 seconds
}
//till here
}
}
return 1;
}
Reply


Messages In This Thread
Dialogs - by Th3Angel - 19.09.2010, 04:41
Re: Dialogs - by Kwarde - 19.09.2010, 05:51
Re: Dialogs - by Th3Angel - 19.09.2010, 06:44
Re: Dialogs - by Th3Angel - 19.09.2010, 18:16
Re: Dialogs - by Toni - 19.09.2010, 18:17
Re: Dialogs - by iggy1 - 19.09.2010, 18:19

Forum Jump:


Users browsing this thread: 3 Guest(s)