[REQUEST] Please help me how to add menu for drinks? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [REQUEST] Please help me how to add menu for drinks? (
/showthread.php?tid=174652)
[REQUEST] Please help me how to add menu for drinks? -
GBLTeam - 06.09.2010
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
Re: [REQUEST] Please help me how to add menu for drinks? -
pmk1 - 06.09.2010
go on wiki, search the simple menu tutorial and how to create a dialog tutorial, everything will be in it ;P
Re: [REQUEST] Please help me how to add menu for drinks? -
GBLTeam - 06.09.2010
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?
Re: [REQUEST] Please help me how to add menu for drinks? -
Mike_Peterson - 06.09.2010
IfPlayerIsInRangeOfPoint or if you want /drinks when enter a pickup OnPlayerEnterPickup or sumthing.
Re: [REQUEST] Please help me how to add menu for drinks? -
GBLTeam - 06.09.2010
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?
Re: [REQUEST] Please help me how to add menu for drinks? -
Mike_Peterson - 06.09.2010
Код:
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