SA-MP Forums Archive
menu problem [NOT FIXED] - 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: menu problem [NOT FIXED] (/showthread.php?tid=79732)



menu problem [NOT FIXED] - David_Omid - 30.05.2009

The script doesn't work...everything inside the checks in the menu (i.e the SWAT level checks) aren't working and I don't know why...

This is the script:

P.S indentations on my screen are fine


pawn Код:
public OnPlayerSpawn(playerid)
{
    SAPDlevel[playerid] = 1;
    SWATlevel[playerid] = 1;
    FBIlevel[playerid] = 1;
}

pawn Код:
if(CurrentMenu == SWATmenu)
{
        switch(row)
        {
            case 0: // SWAT Uniforms
            {
                playeronduty[playerid] = 1;
                SetPlayerSkin(playerid,285);
                SetPlayerColor(playerid,COLOR_BLUE);
               
                if(SWATlevel[playerid] == 1) // SWAT Cadet
                {
                    GivePlayerWeapon(playerid,3,0);
                    GivePlayerWeapon(playerid,24,300);
                    GivePlayerWeapon(playerid,41,500);
                    SendClientMessage(playerid,COLOR_CYAN,"You have gone on duty as a SWAT cadet");
                    return 1;
                }
                else if(SWATlevel[playerid] == 2) // SWAT Member
                {
                        GivePlayerWeapon(playerid,3,0);
                    GivePlayerWeapon(playerid,24,300);
                    GivePlayerWeapon(playerid,41,500);
                    GivePlayerWeapon(playerid,27,500);
                    GivePlayerWeapon(playerid,29,1000);
                    SendClientMessage(playerid,COLOR_CYAN,"You have gone on duty as a SWAT member");
                    return 1;
                }
                else if(SWATlevel[playerid] == 3) // SWAT Commander
                {
                    GivePlayerWeapon(playerid,3,0);
                    GivePlayerWeapon(playerid,24,300);
                    GivePlayerWeapon(playerid,41,500);
                    GivePlayerWeapon(playerid,27,500);
                    GivePlayerWeapon(playerid,29,1000);
                    GivePlayerWeapon(playerid,31,2000);
                    SendClientMessage(playerid,COLOR_CYAN,"You have gone on duty as a commander");
                    return 1;
                }
            }
            case 1: // SAPD Uniforms
            {
                    ShowMenuForPlayer(SAPDmenu,playerid);
                return 1;
            }
        }
}



Re: menu problem [NOT FIXED] - David_Omid - 30.05.2009

Any ideas?


Re: menu problem [NOT FIXED] - Gamer007 - 30.05.2009

Show the CreateMenu please.


Re: menu problem [NOT FIXED] - David_Omid - 30.05.2009

on the filterscript init:
pawn Код:
SAPDmenu = CreateMenu("Uniforms", 1, 200.0, 100.0, 150.0, 150.0);
  AddMenuItem(SAPDmenu, 0, "LSPD Uniform");
  AddMenuItem(SAPDmenu, 0, "SFPD Uniform");
  AddMenuItem(SAPDmenu, 0, "LVPD Uniform");
  AddMenuItem(SAPDmenu, 0, "BC1 Uniform");
  AddMenuItem(SAPDmenu, 0, "BC2 Uniform");
  AddMenuItem(SAPDmenu, 0, "Biker Uniform");
 
  SWATmenu = CreateMenu("Uniforms", 1, 200.0, 100.0, 150.0, 150.0);
  AddMenuItem(SWATmenu, 0, "SWAT Uniform");
  AddMenuItem(SWATmenu, 0, "SAPD Uniforms");
 
  FBImenu = CreateMenu("Uniforms", 1, 200.0, 100.0, 150.0, 150.0);
  AddMenuItem(FBImenu, 0, "FBI Uniform");
  AddMenuItem(FBImenu, 0, "Agent1 Uniform");
  AddMenuItem(FBImenu, 0, "Agent2 Uniform");
  AddMenuItem(FBImenu, 0, "Agent3 Uniform");
  AddMenuItem(FBImenu, 0, "Agent4 Uniform");
  AddMenuItem(FBImenu, 0, "Plain Clothes");
  AddMenuItem(FBImenu, 0, "SAPD Uniforms");



Re: menu problem [NOT FIXED] - Gamer007 - 30.05.2009

Firstly, if you got SAPDmenu written under OnPlayerSelectedMenuRow ex like this:

if(CurrentMenu == SAPDmenu)
{
//script here
or you got FBImenu you need to change this:

Код:
if(CurrentMenu == SWATmenu)
{
to:

Код:
else if(CurrentMenu == SWATmenu)
{
you may need to add additional Bracket above the
Код:
else if(CurrentMenu == SWATmenu)



Re: menu problem [NOT FIXED] - member - 30.05.2009

make sure you have
pawn Код:
CurrentMenu = GetPlayerMenu(playerid);



Re: menu problem [NOT FIXED] - David_Omid - 30.05.2009

Alright done that, now what?

And yeah, I have:

pawn Код:
new Menu:CurrentMenu = GetPlayerMenu(playerid);



What do I do next?


Re: menu problem [NOT FIXED] - David_Omid - 30.05.2009

Anyone?


Re: menu problem [NOT FIXED] - Gamer007 - 30.05.2009

Well did you try to compile? it works , not?


Re: menu problem [NOT FIXED] - David_Omid - 30.05.2009

It compiles, no errors or warnings...but everything in the menu cases which are in checks like SAPDlevel etc don't take effect...no idea why