20.03.2012, 15:39
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:
DIALOG:
I also definded it as my 6 dialog
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; } //==================================================================================================
Код:
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; }
Код:
#define DIALOG_BUY 6