SA-MP Forums Archive
WowZ - 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: WowZ (/showthread.php?tid=124166)



WowZ - ScottCFR - 29.01.2010

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;
}



Re: WowZ - bluray - 29.01.2010

um for staters dialog id should not equal weed but 666


Re: WowZ - ScottCFR - 29.01.2010

ok, i fixed that, sill nothin