response a dialog with another defined dialog
#1

Hi. I would like to ask for a help how to fix this problem.


So I wanted to make a /c command which shows general commands like Teleports Menu, Weapons Menu and some other menus.

Now.. I want to show Weapons Menu with the use /c command. See below for sample..

Code:
CMD:c(playerid, params[])
{
        ShowPlayerDialog(playerid, DIALOG_CMDS, DIALOG_STYLE_LIST, "{09F7DF}Command Menu", "Weapons Menu", "Select", "Close");
        return 1;
}
This is under ondialogresponse
Code:
	if(dialogid == DIALOGID)
    {
        if(response)
        {
        	if(listitem == 0) // Reset Weapons
            {
                ResetPlayerWeapons(playerid);
            }
            if(listitem == 1) // Meele
            {
                ShowPlayerDialog(playerid, DIALOGID+1, DIALOG_STYLE_LIST, "{09F7DF}Select a Weapon", "{09F7DF}Knuckle Dusters\n{09F7DF}Golf Club\n{09F7DF}Nite Stick\n{09F7DF}Bat\n{09F7DF}Shovel\n{09F7DF}Pool Cue\n{09F7DF}Katana\n{09F7DF}Dildo\n{09F7DF}Spray Can\n{09F7DF}Cane\n{09F7DF}Chainsaw\n{09F7DF}Vibrator", "Select", "Back");
            }
            if(listitem == 2) // Pistols
            {
                ShowPlayerDialog(playerid, DIALOGID+2, DIALOG_STYLE_LIST, "{09F7DF}Select a Weapon", "{09F7DF}9mm\n{09F7DF}Silenced 9mm\n{09F7DF}Desert Eagle", "Select", "Back");
            }
            if(listitem == 3) // Sub-Machine Guns
            {
                ShowPlayerDialog(playerid, DIALOGID+3, DIALOG_STYLE_LIST, "{09F7DF}Select a Weapon", "{09F7DF}Uzi\n{09F7DF}SMG\n{09F7DF}Tec9", "Select", "Back");
            }
            if(listitem == 4) // Rifles
            {
                ShowPlayerDialog(playerid, DIALOGID+4, DIALOG_STYLE_LIST, "{09F7DF}Select a Weapon", "{09F7DF}Country Rifle\n{09F7DF}Sniper Rifle", "Select", "Back");
            }
            if(listitem == 5) // Assault
            {
                ShowPlayerDialog(playerid, DIALOGID+5, DIALOG_STYLE_LIST, "{09F7DF}Select a Weapon", "{09F7DF}AK-47\n{09F7DF}M4", "Select", "Back");
            }
            if(listitem == 6) // Shotguns
            {
                ShowPlayerDialog(playerid, DIALOGID+6, DIALOG_STYLE_LIST, "{09F7DF}Select a Weapon", "{09F7DF}Standard Shotgun\n{09F7DF}Sawnoff Shotgun\n{09F7DF}Combat Shotgun", "Select", "Back");
            }
            if(listitem == 7) // Misc
            {
                ShowPlayerDialog(playerid, DIALOGID+7, DIALOG_STYLE_LIST, "{09F7DF}Select a Weapon", "{09F7DF}Fire Extinguisher\n{09F7DF}Parachute\n{09F7DF}Nightvision Goggles\n{09F7DF}Flowers \n{09F7DF}Camera", "Select", "Back");
            }
        }
        return 1;
    }
So basically I have two defined dialogs

one is #define DIALOG_CMDS(This is for the command /c) and DIALOGID (This is for the command /w for weapons)

How can weapon menu dialog show when I do use /c and choose different kind of weapons?

I tried to do if(dialogid == DIALOGID+DIALOG_CMDS) but nothing happens.
Reply
#2

if(dialogid == DIALOGID) to if(dialogid == DIALOG_CMDS)
Reply
#3

pawn Code:
if(dialogid == DIALOG_CMDS)
    {
        if(response)
        {
            if(listitem == 0) // Reset Weapons
            {
                ResetPlayerWeapons(playerid);
            }
            if(listitem == 1) // Meele
            {
                ShowPlayerDialog(playerid, DIALOGID+1, DIALOG_STYLE_LIST, "{09F7DF}Select a Weapon", "{09F7DF}Knuckle Dusters\n{09F7DF}Golf Club\n{09F7DF}Nite Stick\n{09F7DF}Bat\n{09F7DF}Shovel\n{09F7DF}Pool Cue\n{09F7DF}Katana\n{09F7DF}Dildo\n{09F7DF}Spray Can\n{09F7DF}Cane\n{09F7DF}Chainsaw\n{09F7DF}Vibrator", "Select", "Back");
            }
            if(listitem == 2) // Pistols
            {
                ShowPlayerDialog(playerid, DIALOGID+2, DIALOG_STYLE_LIST, "{09F7DF}Select a Weapon", "{09F7DF}9mm\n{09F7DF}Silenced 9mm\n{09F7DF}Desert Eagle", "Select", "Back");
            }
            if(listitem == 3) // Sub-Machine Guns
            {
                ShowPlayerDialog(playerid, DIALOGID+3, DIALOG_STYLE_LIST, "{09F7DF}Select a Weapon", "{09F7DF}Uzi\n{09F7DF}SMG\n{09F7DF}Tec9", "Select", "Back");
            }
            if(listitem == 4) // Rifles
            {
                ShowPlayerDialog(playerid, DIALOGID+4, DIALOG_STYLE_LIST, "{09F7DF}Select a Weapon", "{09F7DF}Country Rifle\n{09F7DF}Sniper Rifle", "Select", "Back");
            }
            if(listitem == 5) // Assault
            {
                ShowPlayerDialog(playerid, DIALOGID+5, DIALOG_STYLE_LIST, "{09F7DF}Select a Weapon", "{09F7DF}AK-47\n{09F7DF}M4", "Select", "Back");
            }
            if(listitem == 6) // Shotguns
            {
                ShowPlayerDialog(playerid, DIALOGID+6, DIALOG_STYLE_LIST, "{09F7DF}Select a Weapon", "{09F7DF}Standard Shotgun\n{09F7DF}Sawnoff Shotgun\n{09F7DF}Combat Shotgun", "Select", "Back");
            }
            if(listitem == 7) // Misc
            {
                ShowPlayerDialog(playerid, DIALOGID+7, DIALOG_STYLE_LIST, "{09F7DF}Select a Weapon", "{09F7DF}Fire Extinguisher\n{09F7DF}Parachute\n{09F7DF}Nightvision Goggles\n{09F7DF}Flowers \n{09F7DF}Camera", "Select", "Back");
            }
        }
        return 1;
    }
EDIT: Too late xD
Reply
#4

It just reset my weapons..

What exactly I want is. How do Weapon Menu show when I do /c? Let say I will choose Weapon Menu from the /c command (The below dialog will show when you doi /c)

Command List: <<---//dialog title just incase you didn't know
Weapons Menu
Teleports Menu
Animations Menu


For example I click weapons menu. it SHOULD show the following below..
Reset Weapon
Melee
Pistols
etcc....

I just want to show Weapon Menu when I choose it from /c - command list
Reply
#5

EDIT: Damn, hit post by mistake - Hold on a second.

EDIT2: Ok, fixed.
pawn Code:
//up with the rest of your #defines.
#define WEAPONSMENU  54
#define WEAPONSMENU1 55
#define WEAPONSMENU2 56
#define WEAPONSMENU3 57
#define WEAPONSMENU4 58
#define WEAPONSMENU5 59
#define WEAPONSMENU6 60
#define WEAPONSMENU7 61

//your /c command
CMD:c(playerid, params[])
{
        ShowPlayerDialog(playerid, DIALOG_CMDS, DIALOG_STYLE_LIST, "{09F7DF}Command Menu", "Weapons Menu", "Select", "Close");
        return 1;
}

//put this under OnDialogResponse and repeat it for all of the different dialogues.

if(dialogid == DIALOG_CMDS)
{
    if(response)
    {
         switch(liistitem)
        {
             case 0://show command menu dialog
             case 1: ShowPlayerDialog(playerid, WEAPONSMENU , DIALOG_STYLE_LIST, "Melee\nPistols\SMGs\nRifles\Assault\nShotguns\nMisc""Select", "Close");//show weapons dialog

         }

     }

}
//repeat this for all the dialogues.

if(dialogid == WEAPONSMENU  )
    {
        if(response)
        {
            switch(listitem)
            {
            if(listitem == 0) // Reset Weapons
            {
                ResetPlayerWeapons(playerid);
            }
            case 0: // Meele
            {
                ShowPlayerDialog(playerid, WEAPONSMENU1 , DIALOG_STYLE_LIST, "{09F7DF}Select a Weapon", "{09F7DF}Knuckle Dusters\n{09F7DF}Golf Club\n{09F7DF}Nite Stick\n{09F7DF}Bat\n{09F7DF}Shovel\n{09F7DF}Pool Cue\n{09F7DF}Katana\n{09F7DF}Dildo\n{09F7DF}Spray Can\n{09F7DF}Cane\n{09F7DF}Chainsaw\n{09F7DF}Vibrator", "Select", "Back");
            }
            case 1: // Pistols
            {
                ShowPlayerDialog(playerid, WEAPONSMENU2 , DIALOG_STYLE_LIST, "{09F7DF}Select a Weapon", "{09F7DF}9mm\n{09F7DF}Silenced 9mm\n{09F7DF}Desert Eagle", "Select", "Back");
            }
           case 2: // Sub-Machine Guns
            {
                ShowPlayerDialog(playerid, WEAPONSMENU3 , DIALOG_STYLE_LIST, "{09F7DF}Select a Weapon", "{09F7DF}Uzi\n{09F7DF}SMG\n{09F7DF}Tec9", "Select", "Back");
            }
            case 3: // Rifles
            {
                ShowPlayerDialog(playerid, WEAPONSMENU4 , DIALOG_STYLE_LIST, "{09F7DF}Select a Weapon", "{09F7DF}Country Rifle\n{09F7DF}Sniper Rifle", "Select", "Back");
            }
            case 3: // Assault
            {
                ShowPlayerDialog(playerid, WEAPONSMENU5 , DIALOG_STYLE_LIST, "{09F7DF}Select a Weapon", "{09F7DF}AK-47\n{09F7DF}M4", "Select", "Back");
            }
            case 3: // Shotguns
            {
                ShowPlayerDialog(playerid, WEAPONSMENU6 , DIALOG_STYLE_LIST, "{09F7DF}Select a Weapon", "{09F7DF}Standard Shotgun\n{09F7DF}Sawnoff Shotgun\n{09F7DF}Combat Shotgun", "Select", "Back");
            }
            case 3: // Misc
            {
                ShowPlayerDialog(playerid, WEAPONSMENU7 , DIALOG_STYLE_LIST, "{09F7DF}Select a Weapon", "{09F7DF}Fire Extinguisher\n{09F7DF}Parachute\n{09F7DF}Nightvision Goggles\n{09F7DF}Flowers \n{09F7DF}Camera", "Select", "Back");
            }
            }
        }
        return 1;
    }

if(dialogid == WEAPONSMENU1)
{
    if(response)
    {
         switch(liistitem)
        {
             case 0: GivePlayerWeapon(playerid,1);//give brass knuckles
             case 1: GivePlayerWeapon(playerid,2);//give golf club.

         }

     }

}
//repeat this for all the dialogues.
Reply
#6

Quote:
Originally Posted by EiresJason
View Post
EDIT: Damn, hit post by mistake - Hold on a second.

EDIT2: Ok, fixed.
pawn Code:
//up with the rest of your #defines.
#define WEAPONSMENU  54
#define WEAPONSMENU1 55
#define WEAPONSMENU2 56
#define WEAPONSMENU3 57
#define WEAPONSMENU4 58
#define WEAPONSMENU5 59
#define WEAPONSMENU6 60
#define WEAPONSMENU7 61

//your /c command
CMD:c(playerid, params[])
{
        ShowPlayerDialog(playerid, DIALOG_CMDS, DIALOG_STYLE_LIST, "{09F7DF}Command Menu", "Weapons Menu", "Select", "Close");
        return 1;
}

//put this under OnDialogResponse and repeat it for all of the different dialogues.

if(dialogid == DIALOG_CMDS)
{
    if(response)
    {
         switch(liistitem)
        {
             case 0://show command menu dialog
             case 1: ShowPlayerDialog(playerid, WEAPONSMENU , DIALOG_STYLE_LIST, "Melee\nPistols\SMGs\nRifles\Assault\nShotguns\nMisc""Select", "Close");//show weapons dialog

         }

     }

}
//repeat this for all the dialogues.

if(dialogid == WEAPONSMENU  )
    {
        if(response)
        {
            switch(listitem)
            {
            if(listitem == 0) // Reset Weapons
            {
                ResetPlayerWeapons(playerid);
            }
            case 0: // Meele
            {
                ShowPlayerDialog(playerid, WEAPONSMENU1 , DIALOG_STYLE_LIST, "{09F7DF}Select a Weapon", "{09F7DF}Knuckle Dusters\n{09F7DF}Golf Club\n{09F7DF}Nite Stick\n{09F7DF}Bat\n{09F7DF}Shovel\n{09F7DF}Pool Cue\n{09F7DF}Katana\n{09F7DF}Dildo\n{09F7DF}Spray Can\n{09F7DF}Cane\n{09F7DF}Chainsaw\n{09F7DF}Vibrator", "Select", "Back");
            }
            case 1: // Pistols
            {
                ShowPlayerDialog(playerid, WEAPONSMENU2 , DIALOG_STYLE_LIST, "{09F7DF}Select a Weapon", "{09F7DF}9mm\n{09F7DF}Silenced 9mm\n{09F7DF}Desert Eagle", "Select", "Back");
            }
           case 2: // Sub-Machine Guns
            {
                ShowPlayerDialog(playerid, WEAPONSMENU3 , DIALOG_STYLE_LIST, "{09F7DF}Select a Weapon", "{09F7DF}Uzi\n{09F7DF}SMG\n{09F7DF}Tec9", "Select", "Back");
            }
            case 3: // Rifles
            {
                ShowPlayerDialog(playerid, WEAPONSMENU4 , DIALOG_STYLE_LIST, "{09F7DF}Select a Weapon", "{09F7DF}Country Rifle\n{09F7DF}Sniper Rifle", "Select", "Back");
            }
            case 3: // Assault
            {
                ShowPlayerDialog(playerid, WEAPONSMENU5 , DIALOG_STYLE_LIST, "{09F7DF}Select a Weapon", "{09F7DF}AK-47\n{09F7DF}M4", "Select", "Back");
            }
            case 3: // Shotguns
            {
                ShowPlayerDialog(playerid, WEAPONSMENU6 , DIALOG_STYLE_LIST, "{09F7DF}Select a Weapon", "{09F7DF}Standard Shotgun\n{09F7DF}Sawnoff Shotgun\n{09F7DF}Combat Shotgun", "Select", "Back");
            }
            case 3: // Misc
            {
                ShowPlayerDialog(playerid, WEAPONSMENU7 , DIALOG_STYLE_LIST, "{09F7DF}Select a Weapon", "{09F7DF}Fire Extinguisher\n{09F7DF}Parachute\n{09F7DF}Nightvision Goggles\n{09F7DF}Flowers \n{09F7DF}Camera", "Select", "Back");
            }
            }
        }
        return 1;
    }

if(dialogid == WEAPONSMENU1)
{
    if(response)
    {
         switch(liistitem)
        {
             case 0: GivePlayerWeapon(playerid,1);//give brass knuckles
             case 1: GivePlayerWeapon(playerid,2);//give golf club.

         }

     }

}
//repeat this for all the dialogues.
Wow thanks man. Im going to work this out. But may I ask something. Is there any shortcut for this? Because I already have /w command for weapons menu. I want to put /w command to /c command list dialog..

EDIT: MAybe this will help..



Code:
CMD:c(playerid, params[])
{
        ShowPlayerDialog(playerid, DIALOG_CMDS, DIALOG_STYLE_LIST, "{09F7DF}Command List", "Weapons Menu\nTeleports Menu", "Select", "Close");
        return 1;
}
Code:
if(dialogid == DIALOG_CMDS)
    {
       if(response)
        {
        	if(listitem == 0) // Weapons Menu
            {
        	ShowPlayerDialog(playerid, DIALOGID, DIALOG_STYLE_LIST, "Weapons Menu", "Reset Weapons\nMelee\nPistons\nSub-Machines", "Choose", "Close");
            }
            if(listitem == 1) // Teleports Menu
            {
                ShowPlayerDialog(playerid, DIALOGID+1, DIALOG_STYLE_LIST, "Teleports Menu", "Lost Santos\nLas Ventras\nAbandoned Airport \netccetc", "Select", "Back");
            }
            {
Reply
#7

EDIT:already helped - removed.
Reply
#8

Yeah, you can.
pawn Code:
if(dialogid == DIALOG_CMDS)
{
    if(response)
    {
         switch(liistitem)
        {
             case 0://show command menu dialog
             case 1: //put the ShowPlayerDialog you have in /w.

         }

     }

}
Reply
#9

Quote:
Originally Posted by EiresJason
View Post
Yeah, you can.
pawn Code:
if(dialogid == DIALOG_CMDS)
{
    if(response)
    {
         switch(liistitem)
        {
             case 0://show command menu dialog
             case 1: //put the ShowPlayerDialog you have in /w.

         }

     }

}
OMGG! Thank you. This is what I am looking for!! You save me 1 week for tihs I tried and its all good now. +reppppppp!
Reply
#10

Np
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)