[HELP] Multiple Menu Problem
#1

as u can see my topic title, i have make a double menu on the same script like example "Weapon Buy Able Menu And Tuning Car Menu" but when i wanna go to tuning car menu and i select one of them it show Weapon Buy Able menu on the other selection any help ?
Reply
#2

no one reply ...
Reply
#3

Make sure u have diffrent menu ID's and not have used thesame ID for them both
Reply
#4

I think I can help you with this, But I'd need to see your codes, I have had trouble like this too.
Reply
#5

Quote:
Originally Posted by [DRD]Rodney
Посмотреть сообщение
Make sure u have diffrent menu ID's and not have used thesame ID for them both
but... i have the try the same thing u did b4 i post this
Reply
#6

Make sure u have 2 diffrent menu id's and then ur ok (if you make another menu in an FS always check that too, they conflict if its thesame menu-id)
Reply
#7

ok try urself with this

pawn Код:
//==============================================================================
#include <a_samp>
#include <dcmd>
//==============================================================================
new wmenu, fsmenu, str[128];
//==============================================================================
#define COLOR_RED               0xAA3333AA
#define COLOR_GREY              0xAFAFAFAA
#define COLOR_GREEN             0x33AA33AA
#define COLOR_RED               0xAA3333AA
#define COLOR_YELLOW            0xFFFF00AA
#define COLOR_WHITE             0xFFFFFFAA
//==============================================================================
public OnFilterScriptInit()
{
    return 0;
}

public OnFilterScriptExit()
{
    return 0;
}
//==============================================================================
public OnPlayerCommandText(playerid, cmdtext[])
{
    dcmd(wmenu, 8, cmdtext);
    dcmd(fsmenu, 9, cmdtext);
    return 0;
}
//==============================================================================
dcmd_wmenu(playerid, params[])
{
    #pragma unused params
    ShowPlayerDialog(playerid, wmenu, DIALOG_STYLE_LIST, "Weapon Shop Menu","Pistols\nMicro SMGs\nShotguns\nOthers\nAssault\nDengerous Weapons\n******s\nSniper", "Buy", "Cancel");
    return 1;
}

dcmd_fsmenu(playerid, params[])
{
    #pragma unused params
    ShowPlayerDialog(playerid, fsmenu, DIALOG_STYLE_LIST, "Choose You Fighting Style","Normal\nBoxing\nKung Fu\nKneehead\nGrab Kick\nElbow", "Select", "Cancel");
    return 1;
}
//==============================================================================
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == wmenu)
    {
        if(response)
        {
            if(listitem == 0)
            {
                ShowPlayerDialog(playerid, wmenu+1, DIALOG_STYLE_LIST, "Pistols", "9MM\nSilanced 9MM\nDesert Eagle\nBack", "Buy", "Cancel");
            }
            if(listitem == 1)
            {
                ShowPlayerDialog(playerid, wmenu+2, DIALOG_STYLE_LIST, "Micro SMGs", "Micro SMG\nTec 9\nMP5\nBack", "Buy", "Cancel");
            }
            if(listitem == 2)
            {
                ShowPlayerDialog(playerid, wmenu+3, DIALOG_STYLE_LIST, "Shotguns", "Shotgun\nSawnoff Shotgun\nCombat Shotgun\nBack", "Buy", "Cancel");
            }
            if(listitem == 3)
            {
                ShowPlayerDialog(playerid, wmenu+4, DIALOG_STYLE_LIST, "Others", "Armour\nParachute\nCamera\nBack", "Buy", "Cancel");
            }
            if(listitem == 4)
            {
                ShowPlayerDialog(playerid, wmenu+5, DIALOG_STYLE_LIST, "Assault", "AK-47\nM4\nBack", "Buy", "Cancel");
            }
            if(listitem == 5)
            {
                ShowPlayerDialog(playerid, wmenu+6, DIALOG_STYLE_LIST, "Dengerous Weapons", "Rocket Launcher\nHeat Seeker\nFlame Thrower\nMinigun\nBack", "Buy", "Cancel");
            }
            if(listitem == 6)
            {
                ShowPlayerDialog(playerid, wmenu+7, DIALOG_STYLE_LIST, "******s", "Night Vision ******\nThermal Vision ******\nBack", "Buy", "Cancel");
            }
            if(listitem == 7)
            {
                ShowPlayerDialog(playerid, wmenu+8, DIALOG_STYLE_LIST, "Snipers", "Rifle\nSniper Rifle\nBack", "Buy", "Cancel");
            }
            return 1;
        }
    }
    if(dialogid == wmenu+1)
    {
        if(response)
        {
            if(listitem == 0)
            {
                if(GetPlayerMoney(playerid) < 1) return SendClientMessage(playerid, COLOR_YELLOW, "You don't have enough cash.");
                GivePlayerMoney(playerid, -200);
                GivePlayerWeapon(playerid, 22, 99999);
                return 1;
            }
            if(listitem == 1)
            {
                if(GetPlayerMoney(playerid) < 2) return SendClientMessage(playerid, COLOR_YELLOW, "You don't have enough cash.");
                GivePlayerMoney(playerid, -200);
                GivePlayerWeapon(playerid, 23, 99999);
                return 1;
            }
            if(listitem == 2)
            {
                if(GetPlayerMoney(playerid) < 3) return SendClientMessage(playerid, COLOR_YELLOW, "You don't have enough cash.");
                GivePlayerMoney(playerid, -200);
                GivePlayerWeapon(playerid, 24, 99999);
                return 1;
            }
            if(listitem == 3)
            {
                ShowPlayerDialog(playerid, wmenu, DIALOG_STYLE_LIST, "Weapon Shop Menu","Pistols\nMicro SMGs\nShotguns\nOthers\nAssault\nDengerous Weapons\n******s\nSniper", "Buy", "Cancel");
            }
        }
    }
    if(dialogid == wmenu+2)
    {
        if(response)
        {
            if(listitem == 0)
            {
                if(GetPlayerMoney(playerid) < 1) return SendClientMessage(playerid, COLOR_YELLOW, "You don't have enough cash.");
                GivePlayerMoney(playerid, -340);
                GivePlayerWeapon(playerid, 28, 99999);
                SendClientMessage(playerid, COLOR_GREEN, "You have sucessfully buy Micro SMG.");
            }
            if(listitem == 1)
            {
                if(GetPlayerMoney(playerid) < 2) return SendClientMessage(playerid, COLOR_YELLOW, "You don't have enough cash.");
                GivePlayerMoney(playerid, -340);
                GivePlayerWeapon(playerid, 32, 99999);
                SendClientMessage(playerid, COLOR_GREEN, "You have sucessfully buy Tec 9.");
            }
            if(listitem == 2)
            {
                if(GetPlayerMoney(playerid) < 3) return SendClientMessage(playerid, COLOR_YELLOW, "You don't have enough cash.");
                GivePlayerMoney(playerid, -450);
                GivePlayerWeapon(playerid, 29, 99999);
                SendClientMessage(playerid, COLOR_GREEN, "You have sucessfully buy MP5.");
            }
            if(listitem == 3)
            {
                ShowPlayerDialog(playerid, wmenu, DIALOG_STYLE_LIST, "Weapon Shop Menu","Pistols\nMicro SMGs\nShotguns\nOthers\nAssault\nDengerous Weapons\n******s\nSniper", "Buy", "Cancel");
            }
            return 1;
        }
    }
    if(dialogid == wmenu+3)
    {
        if(response)
        {
            if(listitem == 0)
            {
                if(GetPlayerMoney(playerid) < 1) return SendClientMessage(playerid, COLOR_YELLOW, "You don't have enough cash.");
                GivePlayerMoney(playerid, -250);
                GivePlayerWeapon(playerid, 25, 99999);
                SendClientMessage(playerid, COLOR_GREEN, "You have sucessfully buy Shotgun.");
            }
            if(listitem == 1)
            {
                if(GetPlayerMoney(playerid) < 2) return SendClientMessage(playerid, COLOR_YELLOW, "You don't have enough cash.");
                GivePlayerMoney(playerid, -340);
                GivePlayerWeapon(playerid, 26, 99999);
                SendClientMessage(playerid, COLOR_GREEN, "You have sucessfully buy Sawnoff Shotgun.");
            }
            if(listitem == 2)
            {
                if(GetPlayerMoney(playerid) < 3) return SendClientMessage(playerid, COLOR_YELLOW, "You don't have enough cash.");
                GivePlayerMoney(playerid, -470);
                GivePlayerWeapon(playerid, 27, 99999);
                SendClientMessage(playerid, COLOR_GREEN, "You have sucessfully buy Combat Shotgun.");
            }
            if(listitem == 3)
            {
                ShowPlayerDialog(playerid, wmenu, DIALOG_STYLE_LIST, "Weapon Shop Menu","Pistols\nMicro SMGs\nShotguns\nOthers\nAssault\nDengerous Weapons\n******s\nSniper", "Buy", "Cancel");
            }
            return 1;
        }
    }
    if(dialogid == wmenu+4)
    {
        if(response)
        {
            if(listitem == 0)
            {
                if(GetPlayerMoney(playerid) < 1) return SendClientMessage(playerid, COLOR_YELLOW, "You don't have enough cash.");
                GivePlayerMoney(playerid, -250);
                SetPlayerArmour(playerid, 100.0);
                SendClientMessage(playerid, COLOR_GREEN, "You have sucessfully buy an Armour.");
            }
            if(listitem == 1)
            {
                if(GetPlayerMoney(playerid) < 2) return SendClientMessage(playerid, COLOR_YELLOW, "You don't have enough cash.");
                GivePlayerMoney(playerid, -250);
                GivePlayerWeapon(playerid, 43, 1);
                SendClientMessage(playerid, COLOR_GREEN, "You have sucessfully buy a Parachute.");
            }
            if(listitem == 2)
            {
                if(GetPlayerMoney(playerid) < 3) return SendClientMessage(playerid, COLOR_YELLOW, "You don't have enough cash.");
                GivePlayerMoney(playerid, -250);
                GivePlayerWeapon(playerid, 43, 99999);
                SendClientMessage(playerid, COLOR_GREEN, "You have sucessfully buy a Camera.");
            }
            if(listitem == 3)
            {
                ShowPlayerDialog(playerid, wmenu, DIALOG_STYLE_LIST, "Weapon Shop Menu","Pistols\nMicro SMGs\nShotguns\nOthers\nAssault\nDengerous Weapons\n******s\nSniper", "Buy", "Cancel");
            }
            return 1;
        }
    }
    if(dialogid == wmenu+5)
    {
        if(response)
        {
            if(listitem == 0)
            {
                if(GetPlayerMoney(playerid) < 1) return SendClientMessage(playerid, COLOR_YELLOW, "You don't have enough cash.");
                GivePlayerMoney(playerid, -1500);
                GivePlayerWeapon(playerid, 30, 99999);
                SendClientMessage(playerid, COLOR_GREEN, "You have sucessfully buy AK-47.");
            }
            if(listitem == 1)
            {
                if(GetPlayerMoney(playerid) < 2) return SendClientMessage(playerid, COLOR_YELLOW, "You don't have enough cash.");
                GivePlayerMoney(playerid, -2200);
                GivePlayerWeapon(playerid, 31, 99999);
                SendClientMessage(playerid, COLOR_GREEN, "You have sucessfully buy M4.");
            }
            if(listitem == 2)
            {
                ShowPlayerDialog(playerid, wmenu, DIALOG_STYLE_LIST, "Weapon Shop Menu","Pistols\nMicro SMGs\nShotguns\nOthers\nAssault\nDengerous Weapons\n******s\nSniper", "Buy", "Cancel");
            }
            return 1;
        }
    }
    if(dialogid == wmenu+6)
    {
        if(response)
        {
            if(listitem == 0)
            {
                if(GetPlayerMoney(playerid) < 1) return SendClientMessage(playerid, COLOR_YELLOW, "You don't have enough cash.");
                GivePlayerMoney(playerid, -10000);
                GivePlayerWeapon(playerid, 35, 99999);
                SendClientMessage(playerid, COLOR_GREEN, "You have sucessfully buy Rocket Launcher.");
            }
            if(listitem == 1)
            {
                if(GetPlayerMoney(playerid) < 2) return SendClientMessage(playerid, COLOR_YELLOW, "You don't have enough cash.");
                GivePlayerMoney(playerid, -10000);
                GivePlayerWeapon(playerid, 36, 99999);
                SendClientMessage(playerid, COLOR_GREEN, "You have sucessfully buy Heat Seeker.");
            }
            if(listitem == 2)
            {
                if(GetPlayerMoney(playerid) < 3) return SendClientMessage(playerid, COLOR_YELLOW, "You don't have enough cash.");
                GivePlayerMoney(playerid, -5000);
                GivePlayerWeapon(playerid, 37, 99999);
                SendClientMessage(playerid, COLOR_GREEN, "You have sucessfully buy Flame Thrower.");
            }
            if(listitem == 3)
            {
                if(GetPlayerMoney(playerid) < 4) return SendClientMessage(playerid, COLOR_YELLOW, "You don't have enough cash.");
                GivePlayerMoney(playerid, -100000);
                GivePlayerWeapon(playerid, 38, 99999);
                SendClientMessage(playerid, COLOR_GREEN, "You have sucessfully buy Minigun.");
            }
            if(listitem == 4)
            {
                ShowPlayerDialog(playerid, wmenu, DIALOG_STYLE_LIST, "Weapon Shop Menu","Pistols\nMicro SMGs\nShotguns\nOthers\nAssault\nDengerous Weapons\n******s\nSniper", "Buy", "Cancel");
            }
            return 1;
        }
    }
    if(dialogid == wmenu+7)
    {
        if(response)
        {
            if(listitem == 0)
            {
                if(GetPlayerMoney(playerid) < 1) return SendClientMessage(playerid, COLOR_YELLOW, "You don't have enough cash.");
                GivePlayerMoney(playerid, -100);
                GivePlayerWeapon(playerid, 44, 1);
                SendClientMessage(playerid, COLOR_GREEN, "You have sucessfully buy Night Vision ******.");
            }
            if(listitem == 1)
            {
                if(GetPlayerMoney(playerid) < 2) return SendClientMessage(playerid, COLOR_YELLOW, "You don't have enough cash.");
                GivePlayerMoney(playerid, -100);
                GivePlayerWeapon(playerid, 45, 1);
                SendClientMessage(playerid, COLOR_GREEN, "You have sucessfully buy Thermal Vision ******.");
            }
            if(listitem == 2)
            {
                ShowPlayerDialog(playerid, wmenu, DIALOG_STYLE_LIST, "Weapon Shop Menu","Pistols\nMicro SMGs\nShotguns\nOthers\nAssault\nDengerous Weapons\n******s\nSniper", "Buy", "Cancel");
            }
            return 1;
        }
    }
    if(dialogid == wmenu+8)
    {
        if(response)
        {
            if(listitem == 0)
            {
                if(GetPlayerMoney(playerid) < 1) return SendClientMessage(playerid, COLOR_YELLOW, "You don't have enough cash.");
                GivePlayerMoney(playerid, -250);
                GivePlayerWeapon(playerid, 33, 99999);
                SendClientMessage(playerid, COLOR_GREEN, "You have sucessfully buy Rifle.");
            }
            if(listitem == 1)
            {
                if(GetPlayerMoney(playerid) < 2) return SendClientMessage(playerid, COLOR_YELLOW, "You don't have enough cash.");
                GivePlayerMoney(playerid, -250);
                GivePlayerWeapon(playerid, 34, 99999);
                SendClientMessage(playerid, COLOR_GREEN, "You have sucessfully buy Sniper Rifle.");
            }
            if(listitem == 2)
            {
                    ShowPlayerDialog(playerid, wmenu, DIALOG_STYLE_LIST, "Weapon Shop Menu","Pistols\nMicro SMGs\nShotguns\nOthers\nAssault\nDengerous Weapons\n******s\nSniper", "Buy", "Cancel");
            }
            return 1;
        }
    }
    if(dialogid == fsmenu)
    {
        if(response)
        {
            if(listitem == 0)
            {
                format(str, sizeof(str), "You have successfuly changed your fighting style to Normal");
                SendClientMessage(playerid, COLOR_YELLOW, str);
                SetPlayerFightingStyle(playerid, FIGHT_STYLE_NORMAL);
            }
            if(listitem == 1)
            {
                format(str, sizeof(str), "You have successfuly changed your fighting style to Boxing");
                SendClientMessage(playerid, COLOR_YELLOW, str);
                SetPlayerFightingStyle(playerid, FIGHT_STYLE_BOXING);
            }
            if(listitem == 2)
            {
                format(str, sizeof(str), "You have successfuly changed your fighting style to Kung Fu");
                SendClientMessage(playerid, COLOR_YELLOW, str);
                SetPlayerFightingStyle(playerid, FIGHT_STYLE_KUNGFU);
            }
            if(listitem == 3)
            {
                format(str, sizeof(str), "You have successfuly changed your fighting style to Kneehead");
                SendClientMessage(playerid, COLOR_YELLOW, str);
                SetPlayerFightingStyle(playerid, FIGHT_STYLE_KNEEHEAD);
            }
            if(listitem == 4)
            {
                format(str, sizeof(str), "You have successfuly changed your fighting style to Grab Kick");
                SendClientMessage(playerid, COLOR_YELLOW, str);
                SetPlayerFightingStyle(playerid, FIGHT_STYLE_GRABKICK);
            }
            if(listitem == 5)
            {
                format(str, sizeof(str), "You have successfuly changed your fighting style to Elbow");
                SendClientMessage(playerid, COLOR_YELLOW, str);
                SetPlayerFightingStyle(playerid, FIGHT_STYLE_ELBOW);
            }
        }
    }
    return 1;
}
//==============================================================================
Reply
#8

wmenu and fsmenu should have a value. if they don't get a value from you, they're standard 0, so both got the same id's = dialog conflict.
Replace that:
Код:
new wmenu, fsmenu, str[128];
with this:
Код:
new wmenu = 0; // it needs 0 to 8, because you use wmenu + X, x = 1 to 8
new fsmenu = 9; // another id then wmenu and wmenu + X, x = 1 to 8
new str[128];
sorry for bad english
Reply
#9

new wmenu, fsmenu, str[128];

replace with

#define wmenu 0
#define fsmenu 9
new str[128];

Also:

dcmd(wmenu, 8, cmdtext);
dcmd(fsmenu, 9, cmdtext);

This is supposed to be

dcmd(commandname, length of command name, cmdtext);

so:

dcmd(wmenu, 5, cmdtext);
dcmd(fsmenu, 6, cmdtext);
Reply
#10

ok thx pal ill try that
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)