The dialog doesn't work in-game
#1

Hey I need help making my new filterscript but it seems I am doing something wrong, it's a weapon menu, so you can get a weapon.But something caught my nerves, I write /weapons I open dialog I go to for tut Melee and it doesn't open a new dialog. Here's the code:

pawn Код:
if (strcmp("/weapons", cmdtext, true, 10) == 0) //THE COMMAND
    {
        ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Weapon Menu", "Melee\nThrown\nPistols\nShotguns\nSub-machine guns\nRifles\nHeavy Weapons\nHand Held\nApparel", "Go", "Exit");
        return 1;
    }
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 1 && response)
    {
        switch(listitem)
        {
            case 0:
            {
                ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Melee Weapons", "Brass Knuckles\nGolf Club\nNightstick\nKnife\nBaseball Bat\nShovel\nPool Cue\nKatana\nChainsaw\nDildo\nVibrator\nFlowers\nCane", "Get", "Exit");
            }
            case 1:
            {
                ShowPlayerDialog(playerid, 3, DIALOG_STYLE_LIST, "Thrown Weapons", "Grenade\nTear Gas\nMolotov Cocktail\nSatchel Charges", "Get", "Exit");
            }
            case 2:
            {
                ShowPlayerDialog(playerid, 4, DIALOG_STYLE_LIST, "Pistols", "9mm\nSilenced 9mm\nDesert Eagle", "Get", "Exit");
            }
            case 3:
            {
                ShowPlayerDialog(playerid, 5, DIALOG_STYLE_LIST, "Shotguns", "Shotgun\nSawn-off Shotgun\nCombat Shotgun", "Get", "Exit");
            }
            case 4:
            {
                ShowPlayerDialog(playerid, 6, DIALOG_STYLE_LIST, "Sub-machinge guns", "Uzi\nMP5\nTec9", "Get", "Exit");
            }
            case 5:
            {
                ShowPlayerDialog(playerid, 7, DIALOG_STYLE_LIST, "Rifles", "AK-47\nM4\nCountry Rifle\nSniper Rifle", "Get", "Exit");
            }
            case 6:
            {
                ShowPlayerDialog(playerid, 8, DIALOG_STYLE_LIST, "Heavy Weapons", "RPG\nHS Rocket\nFlamethrower\nMinigun", "Get", "Exit");
            }
            case 7:
            {
                ShowPlayerDialog(playerid, 9, DIALOG_STYLE_LIST, "Hand Held Weaps", "Spray Can\nFire Extinguisher\nCamera", "Get", "Exit");
            }
            case 8:
            {
                ShowPlayerDialog(playerid, 10, DIALOG_STYLE_LIST, "Apparel", "Night Vision\nThermal Goggles\nParachute", "Get", "Exit");
            }
        }
    }
    if(dialogid == 2 && response)
    {
        switch(listitem)
        {
            case 0:
            {
                GivePlayerWeapon(playerid, 1, 1);
                SendClientMessage(playerid, green, "You recieved Brass Knuckles");
            }
            case 1:
            {
                GivePlayerWeapon(playerid, 2, 1);
                SendClientMessage(playerid, green, "You recieved Golf Club");
            }
            case 2:
            {
                GivePlayerWeapon(playerid, 3, 1);
                SendClientMessage(playerid, green, "You recieved Nightstick");
            }
            case 3:
            {
                GivePlayerWeapon(playerid, 4, 1);
                SendClientMessage(playerid, green, "You recieved Knife");
            }
            case 4:
            {
                GivePlayerWeapon(playerid, 5, 1);
                SendClientMessage(playerid, green, "You recieved Baseball Bat");
            }
            case 5:
            {
                GivePlayerWeapon(playerid, 6, 1);
                SendClientMessage(playerid, green, "You recieved Shovel");
            }
            case 6:
            {
                GivePlayerWeapon(playerid, 7, 1);
                SendClientMessage(playerid, green, "You recieved Pool Cue");
            }
            case 7:
            {
                GivePlayerWeapon(playerid, 8, 1);
                SendClientMessage(playerid, green, "You recieved Katana");
            }
            case 8:
            {
                GivePlayerWeapon(playerid, 9, 1);
                SendClientMessage(playerid, green, "You recieved Chainsaw");
            }
            case 9:
            {
                GivePlayerWeapon(playerid, 10, 1);
                SendClientMessage(playerid, green, "You recieved Dildo");
            }
            case 10:
            {
                GivePlayerWeapon(playerid, 12, 1);
                SendClientMessage(playerid, green, "You recieved Vibrator");
            }
            case 11:
            {
                GivePlayerWeapon(playerid, 14, 1);
                SendClientMessage(playerid, green, "You recieved Flowers");
            }
            case 12:
            {
                GivePlayerWeapon(playerid, 15, 1);
                SendClientMessage(playerid, green, "You recieved Cane");
            }
        }
    }
    if(dialogid == 3 & response)
    {
        switch(listitem)
        {
            case 0:
            {
                GivePlayerWeapon(playerid, 16, 250);
                SendClientMessage(playerid, green, "You recieved 100x Grenades");
            }
            case 1:
            {
                GivePlayerWeapon(playerid, 17, 250);
                SendClientMessage(playerid, green, "You recieved 100x Tear Gas");
            }
            case 2:
            {
                GivePlayerWeapon(playerid, 18, 250);
                SendClientMessage(playerid, green, "You recieved 100x Molotov Cocktail");
            }
            case 3:
            {
                GivePlayerWeapon(playerid, 39, 250);
                SendClientMessage(playerid, green, "You recieved 100x Satchel Charges");
            }
        }
    }
    if(dialogid == 4 & response)
    {
        switch(listitem)
        {
            case 0:
            {
                GivePlayerWeapon(playerid, 22, 500);
                SendClientMessage(playerid, green, "You recieved 9mm with 500 ammo");
            }
            case 1:
            {
                GivePlayerWeapon(playerid, 23, 500);
                SendClientMessage(playerid, green, "You recieved 9mm Silenced with 500 ammo");
            }
            case 2:
            {
                GivePlayerWeapon(playerid, 24, 500);
                SendClientMessage(playerid, green, "You recieved Desert Eagle with 500 ammo");
            }
        }
    }
    if(dialogid == 5 & response)
    {
        switch(listitem)
        {
            case 0:
            {
                GivePlayerWeapon(playerid, 25, 500);
                SendClientMessage(playerid, green, "You recieved Shotgun with 500 ammo");
            }
            case 1:
            {
                GivePlayerWeapon(playerid, 26, 500);
                SendClientMessage(playerid, green, "You recieved Sawn-off Shotgun with 500 ammo");
            }
            case 2:
            {
                GivePlayerWeapon(playerid, 27, 500);
                SendClientMessage(playerid, green, "You recieved Combat Shotgun with 500 ammo");
            }
        }
    }
    if(dialogid == 6 && response)
    {
        switch(listitem)
        {
            case 0:
            {
                GivePlayerWeapon(playerid, 28, 500);
                SendClientMessage(playerid, green, "You recieved Uzi with 500 ammo");
            }
            case 1:
            {
                GivePlayerWeapon(playerid, 29, 500);
                SendClientMessage(playerid, green, "You recieved MP5 with 500 ammo");
            }
            case 2:
            {
                GivePlayerWeapon(playerid, 32, 500);
                SendClientMessage(playerid, green, "You recieved Tec 9 with 500 ammo");
            }
        }
    }
    if(dialogid == 7 && response)
    {
        switch(listitem)
        {
            case 0:
            {
                GivePlayerWeapon(playerid, 30, 500);
                SendClientMessage(playerid, green, "You recieved AK-47 with 500 ammo");
            }
            case 1:
            {
                GivePlayerWeapon(playerid, 31, 500);
                SendClientMessage(playerid, green, "You recieved M4 with 500 ammo");
            }
            case 2:
            {
                GivePlayerWeapon(playerid, 33, 500);
                SendClientMessage(playerid, green, "You recieved Country Rifle with 500 ammo");
            }
            case 3:
            {
                GivePlayerWeapon(playerid, 34, 500);
                SendClientMessage(playerid, green, "You recieved Sniper Rifle with 500 ammo");
            }
        }
    }
    ShowPlayerDialog(playerid, 8, DIALOG_STYLE_LIST, "Heavy Weapons", "RPG\nHS Rocket\nFlamethrower\nMinigun", "Get", "Exit");
    if(dialogid == 8 && response)
    {
        switch(listitem)
        {
            case 0:
            {
                GivePlayerWeapon(playerid, 35, 500);
                SendClientMessage(playerid, green, "You recieved RPG with 500 ammo");
            }
            case 1:
            {
                GivePlayerWeapon(playerid, 36, 500);
                SendClientMessage(playerid, green, "You recieved HS Rocket with 500 ammo");
            }
            case 2:
            {
                GivePlayerWeapon(playerid, 37, 500);
                SendClientMessage(playerid, green, "You recieved Flamethrower with 500 ammo");
            }
            case 3:
            {
                GivePlayerWeapon(playerid, 38, 500);
                SendClientMessage(playerid, green, "You recieved Minigun with 500 ammo");
            }
        }
    }
    if(dialogid == 9 && response)
    {
        switch(listitem)
        {
            case 0:
            {
                GivePlayerWeapon(playerid, 41, 500);
                SendClientMessage(playerid, green, "You recieved Spray Can with 500 sprays");
            }
            case 1:
            {
                GivePlayerWeapon(playerid, 42, 500);
                SendClientMessage(playerid, green, "You recieved Fire Extinguisher with 500 ammo");
            }
            case 2:
            {
                GivePlayerWeapon(playerid, 43, 500);
                SendClientMessage(playerid, green, "You recieved Camera with 500 photo takes");
            }
         }
    }
    if(dialogid == 10 && response)
    {
        switch(listitem)
        {
            case 0:
            {
                GivePlayerWeapon(playerid, 44, 1);
                SendClientMessage(playerid, green, "You recieved Night Vision goggles");
            }
            case 1:
            {
                GivePlayerWeapon(playerid, 45, 1);
                SendClientMessage(playerid, green, "You recieved Thermal Vission goggles");
            }
            case 2:
            {
                GivePlayerWeapon(playerid, 46, 1);
                SendClientMessage(playerid, green, "You recieved Parachute");
            }
        }
    }
    return 0;
}
Reply
#2

Only on that option? All other is works perfectly ?
Reply
#3

Nope, on every option, Pistols, Sub-machine guns, everything...
Reply
#4

* * if(dialogid == 3 & response)
* *Must be in all if(dialogid == 3 && response)
Reply
#5

Daamn I didn't see that, let me try I will contact you again


EDIT : Still doesn't work.
Reply
#6

* *
Код:
ShowPlayerDialog(playerid, 8, DIALOG_STYLE_LIST, "Heavy Weapons", "RPG\nHS Rocket\nFlamethrower\nMinigun", "Get", "Exit");
* * if(dialogid == 8 && response)
* * {
* * * * switch(listitem)
* * * * {
* * * * * * case 0:
* * * * * * {
* * * * * * * * GivePlayerWeapon(playerid, 35, 500);
* * * * * * * * SendClientMessage(playerid, green, "You recieved RPG with 500 ammo");
Why again a code of showplayerdialog , dialog I'd 8
Reply
#7

Umm is someone playing games with me? Did I even put that there o.O I don't remember, or if I did I did it to know where I am at and forgot to take it off, I'mma see if it works.


EDIT: Nope again it doesn't work, I'm editing this post cuz it takes 120 or more seconds to reply.
Reply
#8

It's somewhere at the dialog 1 in the ondialogresponse. But I don't know where.
Reply
#9

When you handle a dialog return the value
Reply
#10

Man I tried that before, but it didn't work so, I don't know guess I'm gonna need to find it the hard way. :S
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)