menu problem [NOT FIXED]
#1

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;
            }
        }
}
Reply
#2

Any ideas?
Reply
#3

Show the CreateMenu please.
Reply
#4

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");
Reply
#5

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)
Reply
#6

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

Alright done that, now what?

And yeah, I have:

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



What do I do next?
Reply
#8

Anyone?
Reply
#9

Well did you try to compile? it works , not?
Reply
#10

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
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)