Buy dialog - 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)
+--- Thread: Buy dialog (
/showthread.php?tid=327242)
Buy dialog -
DannySnoopy - 20.03.2012
hello i have made a /buy cmd' with a dialog, the dialog show's up, but when i select what to buy.
it doesn't "buy" it, means doesn't take the money from me.. he's the cmd + the dialog.
CMD:
Код:
//==================================================================================================
CMD:buy(playerid, params[])
{
if(!IsPlayerInRangeOfPoint(playerid, 15.0, 6.091179,-29.271898,1003.549438)) return SendClientMessage(playerid, COLOR_GREY, "You are not inside of a 24/7");
ShowPlayerDialog(playerid, DIALOG_BUY, DIALOG_STYLE_LIST, "Store:", "Chips ($15)\nBurger($10)", "Purchase", "Cancel");
return 1;
}
//==================================================================================================
DIALOG:
Код:
if(dialogid == DIALOG_BUY)
{
if(response)
{
if(listitem == 0)
{
if(GetPlayerMoney(playerid) < 15) return SendClientMessage(playerid, 0xAFAFAFAA, "You don't have enough cash.");
GivePlayerMoney(playerid, -15);
SetPlayerHealth(playerid, -50);
SendClientMessage(playerid, COLOR_GREENYELLOW, "You have bought a chips");
}
if(listitem == 1)
{
if(GetPlayerMoney(playerid) < 10) return SendClientMessage(playerid, 0xAFAFAFAA, "You don't have enough cash.");
GivePlayerMoney(playerid, -10);
SendClientMessage(playerid, COLOR_GREENYELLOW, "You have bought a burger");
}
}
return 1;
}
I also definded it as my 6 dialog
Код:
#define DIALOG_BUY 6
Re: Buy dialog -
DannySnoopy - 20.03.2012
anyone? help?
Re: Buy dialog -
DannySnoopy - 20.03.2012
guys i could really use the help.
Re: Buy dialog -
rpx - 20.03.2012
Just add this in your script:
GivePlayerCash(playerid,-9999);
Don't forgot to put -
Re: Buy dialog -
tyler12 - 20.03.2012
Quote:
Originally Posted by rpx
Just add this in your script:
GivePlayerCash(playerid,-9999);
Don't forgot to put -
|
hes already done that..
also on ur 'chips' its giving -50 health aint it meant to give health?
Re: Buy dialog -
DannySnoopy - 20.03.2012
the problem is that the dialog doesn't work at-all, it just shows up.. that's it.
Re: Buy dialog -
DannySnoopy - 20.03.2012
help me fellas! i am waiting for hours!
Re: Buy dialog -
DannySnoopy - 20.03.2012
anyone?