SA-MP Forums Archive
Not sure what's happening with my menu - 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: Not sure what's happening with my menu (/showthread.php?tid=180816)



Not sure what's happening with my menu - [SCRP]Cody - 02.10.2010

Well I'm having a problem with my menu that I created. For some reason, at the menu mdcmain, when I select case 2: instead of simply showing the pdguns menu, it automatically goes to case 2 on the pdguns menu, giving the person a combat shotgun instead of showing the menu. Does anyone know how to fix this?

Код:
//++++++++++++++++++++++++++++++++++++++++++++++MDC MAIN++++++++++++++++++
        if(GetPlayerMenu(playerid) == mdcmain){
        switch(row){
        	    case 0:
        	    if(IsPlayerConnected(playerid))
				{
				    ShowMenuForPlayer(mdcsuspects, playerid);
				}
				case 1:
				if(IsPlayerConnected(playerid))
				{
				    ShowMenuForPlayer(mdcwarrants, playerid);
				}
				case 2:
				if(IsPlayerConnected(playerid))
				{
				    ShowMenuForPlayer(pdguns, playerid);
				}
				case 3:
				{
				if(IsPlayerInAnyVehicle(playerid)) {
				if (IsPlayerConnected(playerid))
				SendClientMessage(playerid,COLOR_YELLOW,"This vehicle has been outfitted with nos");
   				AddVehicleComponent(GetPlayerVehicleID(playerid),1010); // NOS
   				TogglePlayerControllable(playerid,true);
				}

		}
		}
Код:
//++++++++++++++++++++++++++++++++++++++MDC WEAPONS+++++++++++++++++++++++++++++++++=
        if(GetPlayerMenu(playerid) == pdguns){
        switch(row){
        case 0:
        {
        if(IsPlayerConnected(playerid))
        SendClientMessage(playerid, COLOR_YELLOW, "You have chosen to equip yourself with a standard issue desert eagle.");
        GivePlayerWeapon(playerid,24,100000);
        TogglePlayerControllable(playerid,true);
        HideMenuForPlayer(pdguns, playerid);
        }
        case 1:
        {
        if(IsPlayerConnected(playerid))
        SendClientMessage(playerid, COLOR_YELLOW, "You have chosen to equip yourself with a standard issue pump shotgun.");
        GivePlayerWeapon(playerid,25,100000);
        TogglePlayerControllable(playerid,true);
        HideMenuForPlayer(pdguns, playerid);
        }
        case 2:
        {
        if(IsPlayerConnected(playerid))
        SendClientMessage(playerid, COLOR_YELLOW, "You have chosen to equip yourself with a combat shotgun.");
        GivePlayerWeapon(playerid,27,100000);
        TogglePlayerControllable(playerid,true);
        HideMenuForPlayer(pdguns, playerid);
        }
        
        case 3:
        {
        if(IsPlayerConnected(playerid))
        SendClientMessage(playerid, COLOR_YELLOW, "You have chosen to equip yourself with a standard issue camera.");
        GivePlayerWeapon(playerid,43,100000);
        TogglePlayerControllable(playerid,true);
        HideMenuForPlayer(pdguns, playerid);
        }
        case 4:
        {
        if(IsPlayerConnected(playerid))
        SendClientMessage(playerid, COLOR_YELLOW, "You have chosen to equip yourself with a standard issue night vision.");
        GivePlayerWeapon(playerid,44,100000);
        TogglePlayerControllable(playerid,true);
        HideMenuForPlayer(pdguns, playerid);
        }
        case 5:
        {
        if(IsPlayerConnected(playerid))
        SendClientMessage(playerid, COLOR_YELLOW, "You have chosen to equip yourself with a standard issue thermal vision.");
        GivePlayerWeapon(playerid,45,100000);
        TogglePlayerControllable(playerid,true);
        HideMenuForPlayer(pdguns, playerid);
        }
        
        case 6:
        {
        if(IsPlayerConnected(playerid))
        SendClientMessage(playerid, COLOR_YELLOW, "You have chosen to equip yourself with a fire extinguisher.");
        GivePlayerWeapon(playerid,42,100000);
        TogglePlayerControllable(playerid,true);
        HideMenuForPlayer(pdguns, playerid);
        }
        }
        }
If you need to know more about how the menu is made, like the AddMenuItems parts, I will tell you, but if you can help with just this, please and thank you.


Re: Not sure what's happening with my menu - [SCRP]Cody - 03.10.2010

*BUMP*
Anyone?