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

So i have saw this in some servers in some places out from burg not in interrior there have create map in mta and there have a drinks in dialog when you go to the pickup he shows you a drinks to chouse like Wine Beer CocaCola Pepsi and it have prices and it gives you a heal. But when you get ciggarete you get a real animation with cigg and with other drinks with wine you get a wine and with beer you get beer animations with object...

In old samp forum i have saw that Drinks Bar but i cant find now i was searching but nothing.
And i found a one command like to get /ciggarete


Код:
	if (strcmp("/cigarette", cmdtext, true, 10) == 0)
	{
		SetPlayerSpecialAction(playerid,SPECIAL_ACTION_SMOKE_CIGGY);
		SendClientMessage(playerid, COLOR_GREY, "You are smoking now!");
		SendClientMessage(playerid, COLOR_GREY, "To stop smoking pull ENTER.");
		return 1;
	}
	return 0;
}
So can you help me to make a menu system when i type like /drinks to show me a drinks in dialog and to can chouse what drink or cigarette i want. But to make that command in some place i know how to find cords X ,Y,Z.. Please help me ! Thanks
Reply
#2

go on wiki, search the simple menu tutorial and how to create a dialog tutorial, everything will be in it ;P
Reply
#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
#4

IfPlayerIsInRangeOfPoint or if you want /drinks when enter a pickup OnPlayerEnterPickup or sumthing.
Reply
#5

Quote:
Originally Posted by Mike_Peterson
Посмотреть сообщение
IfPlayerIsInRangeOfPoint or if you want /drinks when enter a pickup OnPlayerEnterPickup or sumthing.
can you give me a example from this?
Reply
#6

Код:
if(!strcmp(cmdtext, "/drinks", true))
{
if(IsPlayerInRangeOfPoint(playerid, 10, X,Y,Z)) // replace X,Y,Z, with the co-ordinates u want
{
    ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "What is it that you want?", "Sprunk ($1)\nBeer ($2)\nWine ($3)", "Purchase", "Cancel");
}
    return 1;
}
thats the InRangeOfPoint version
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)