[Help please] Food Menu
#1

Ok well I have made several menus and they all did ok, so whats wrong with this one, when I select Sprunk or HotDog it crashes the server.exe
heres the code
Код:
public OnPlayerSelectedMenuRow(playerid, row)
{
  new Menu:Current = GetPlayerMenu(playerid);
	if(Current == Food)
  {
    switch(row)
    {
  			case 0: ShowMenuForPlayer(HotDog, playerid);
  			case 1: ShowMenuForPlayer(Sprunk, playerid);
    }
	}
	if(Current == HotDog)
	{
	  switch(row)
	  {
      case 0:
			{
        if(GetPlayerMoney(playerid) > 7)
				{
          ApplyAnimation(playerid, "FOOD", "EAT_Burger", 3.0, 0, 0, 0, 0, 0); // Eat annimation for /buyhotdog( I didn't make anim. just command)
					GivePlayerCash(playerid,-7);
					SetPlayerHealth(playerid, 100);
					TogglePlayerControllable(playerid, true);
				}
				else
				{
					SendClientMessage(playerid,COLOR_WHITE,"You dont have 7$");
				}
      }
      case 1: ShowMenuForPlayer(Sprunk, playerid);
		}
	}
	if(Current == Sprunk)
	{
	  switch(row)
	  {
      case 0:
			{
        if(GetPlayerMoney(playerid) > 4)
				{
          ApplyAnimation(playerid, "FOOD", "EAT_Burger", 3.0, 0, 0, 0, 0, 0); // Eat annimation for /buyhotdog( I didn't make anim. just command)
					GivePlayerCash(playerid,-4);
					SetPlayerHealth(playerid, 100);
					TogglePlayerControllable(playerid, true);
				}
				else
				{
					SendClientMessage(playerid,COLOR_WHITE,"You dont have 4$");
				}
      }
		}
	}
I have new Menu:Food etc, and here is command
Код:
	//--------[BUY HOTDOG]--------------
	if(strcmp(cmd,"/buyhotdog",true)==0)
	{
    if(IsPlayerConnected(playerid))
	  {
      if(PlayerToPoint(3.0,playerid,388.8925,-2072.9548,7.8359))
	    {
        TogglePlayerControllable(playerid, false);
        ShowMenuForPlayer(Menu:Food, playerid);
				return 1;
			}
	  		else if(PlayerToPoint(3.0,playerid,1589.8362,-1288.8944,17.5115))
	  		{
        TogglePlayerControllable(playerid, false);
        ShowMenuForPlayer(Menu:Food, playerid);
				return 1;
			}
  			else if(PlayerToPoint(3.0,playerid,2435.4011,-1238.1685,24.6749))
	    {
        TogglePlayerControllable(playerid, false);
        ShowMenuForPlayer(Menu:Food, playerid);
				return 1;
			}
		}
		return 1;
	}
P.S Please don't tell me its spacing because that messed up when I copyed it on to here from my pawno.
Reply
#2

umm this is old. I bump his topic if this is unsolved...
Reply
#3

Quote:
Originally Posted by Izanagi
umm this is old. I bump his topic if this is unsolved...
You lol, why don't you help him?

On topic
Please show the code about creating menus
Reply


Forum Jump:


Users browsing this thread: