[REQUEST] Please help me how to add menu for drinks?
#3

Quote:
Originally Posted by pmk1
Посмотреть сообщение
go on wiki, search the simple menu tutorial and how to create a dialog tutorial, everything will be in it ;P
Yes its easy to say go on wiki and search for simple menu

Код:
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 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);
        	    }
        	}
    	    }
	}
    }
    return 1;
}
But how to add a CORDINATES(CORDS)
X,Y,Z for command to work only on that place where i will add a pickup?
Reply


Messages In This Thread
[REQUEST] Please help me how to add menu for drinks? - by GBLTeam - 06.09.2010, 14:04
Re: [REQUEST] Please help me how to add menu for drinks? - by pmk1 - 06.09.2010, 14:39
Re: [REQUEST] Please help me how to add menu for drinks? - by GBLTeam - 06.09.2010, 15:43
Re: [REQUEST] Please help me how to add menu for drinks? - by Mike_Peterson - 06.09.2010, 17:19
Re: [REQUEST] Please help me how to add menu for drinks? - by GBLTeam - 06.09.2010, 17:57
Re: [REQUEST] Please help me how to add menu for drinks? - by Mike_Peterson - 06.09.2010, 18:05

Forum Jump:


Users browsing this thread: 1 Guest(s)