i asked for a weed menu 2 days ago, i got one (Thanks) but when i fix the errors. it doesn't work the menu pops up IG but when i select something it doesn't SetPlayerDrunkLevel or GivePlayerCash
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/weed", true))
{
ShowPlayerDialog(playerid, 666, DIALOG_STYLE_LIST, "Weed Menu", "Sticky Green $2,000\nPurple Haze $5,000\nGreen Mountain $7,500\nLucky Blaze $10,000\nFucked Up $15,000\nI Need Help $20,000\nSober Up $50,000", "Buy", "Cancel"); //example how to start.
return 1;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == Weed && response)
{
new weed[20],cost;
switch(listitem)
{
case 0:weed = "Sticky Green", GivePlayerMoney(playerid,-2000), SetPlayerDrunkLevel(playerid,1000);
case 1:weed = "Purple Haze", cost = 5000;
case 2:weed = "Green Mountain", cost = 7500;
case 3:weed = "Lucky Blaze", cost = 10000;
case 4:weed = "Fucked Up", cost = 15000;
case 5:weed = "I need Help", cost = 20000;
case 6:weed = "Sober Up", cost = 50000;
}
if(GetPlayerMoney(playerid) >= cost)
{
new string[256]; format(string,sizeof(string),"You Now Have The \'%s\'.",weed);
SendClientMessage(playerid,0xFFFFFFFF,string);
GivePlayerMoney(playerid, -cost);
}
else
{
SendClientMessage(playerid,0xFFFFFFFF,"you dont have enough money");
}
}
return 1;
}