onplayerdialog Help
#1

who can help me to this getting work?

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(response)// They pressed the first button.
    {
    switch(dialogid)// If you only have one dialog, then this isn't required, but it's neater for when you implement more dialogs.
        {
        case 1:// Our dialog!ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Select your Weapons", "SMG-AK47-Grenades\        //Tec9-M4-Chainsaw\MicroSMG-Shotgun-Knife", "Choose");
            {
            switch(listitem)// Checking which listitem was selected
            {
                case 0:// The first item listed
                {
                GivePlayerWeapon( playerid, 29,500);
                GivePlayerWeapon( playerid, 30,500);
                GivePlayerWeapon( playerid, 16,10);
                weapon[playerid]=2;
                TogglePlayerControllable(playerid,true);
                }
                case 1: // The second item listed
                {
                GivePlayerWeapon( playerid, 32,500);
                GivePlayerWeapon( playerid, 31,500);
                GivePlayerWeapon( playerid, 9,1);
                weapon[playerid]=3;
                TogglePlayerControllable(playerid,true);
                }
                case 2: // The third item listed
                {
                    GivePlayerWeapon( playerid, 28,500);
                    GivePlayerWeapon( playerid, 25,40);
                    GivePlayerWeapon( playerid, 4,1);
                    weapon[playerid]=4;
                    TogglePlayerControllable(playerid,true);
                }
                case 3: // The third item listed
                {
                if(IsPlayerLuxAdmin(playerid))
                {
                ShowPlayerDialog(playerid, 3, DIALOG_STYLE_LIST, "Admin Weapons", "MicroSMG-Sawnoff-Sniper\nTec9-Sawnoff-Sniper\nCombatShotgun-Sawnoff-Knife", "Choose", "No Weaps");
                }
                else SendClientMessage(playerid, COLOR_WHITE, "ERROR: Your not Admin");
                ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Select your Weapons", "SMG-AK47-Grenades\nTec9-M4-Chainsaw\nMicroSMG-Shotgun-Knife\nAdmins\nVip's", "Choose", "No Weaps");

                }
                case 4: // The third item listed
                {
                if(IsPlayerVipMember(playerid))
                {
                ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Vip Weapons", "MicroSMG-Sawnoff-Sniper\nTec9-Sawnoff-Sniper\nCombatShotgun-Sawnoff-Knife", "Choose", "No Weaps");
                }
                else SendClientMessage(playerid, COLOR_WHITE, "ERROR: Your not a Vip Member!");
                ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Select your Weapons", "SMG-AK47-Grenades\nTec9-M4-Chainsaw\nMicroSMG-Shotgun-Knife\nAdmins\nVip's", "Choose", "No Weaps");

                }
            }
            }
        }
    }
    return 1;
}

 

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(response)// They pressed the first button.
    {
    switch(dialogid)// If you only have one dialog, then this isn't required, but it's neater for when you implement more dialogs.
        {
        case 2:// Our dialog!ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Select your Weapons", "SMG-AK47-Grenades\        //Tec9-M4-Chainsaw\MicroSMG-Shotgun-Knife", "Choose");
            {
            switch(listitem)// Checking which listitem was selected
            {
                case 0:// The first item listed
                {
                GivePlayerWeapon( playerid, 28,1500);
                GivePlayerWeapon( playerid, 26,100);
                GivePlayerWeapon( playerid, 34,100);
                weapon[playerid]=5;
                TogglePlayerControllable(playerid,true);
                }
                case 1: // The second item listed
                {
                GivePlayerWeapon( playerid, 32,1500);
                GivePlayerWeapon( playerid, 26,100);
                GivePlayerWeapon( playerid, 34,100);
                weapon[playerid]=6;
                TogglePlayerControllable(playerid,true);
                }
                case 2: // The third item listed
                {
                    GivePlayerWeapon( playerid, 27,150);
                    GivePlayerWeapon( playerid, 26,100);
                    GivePlayerWeapon( playerid, 4,1);
                    weapon[playerid]=7;
                    TogglePlayerControllable(playerid,true);
                }
            }
            }
        }
    }
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(response)// They pressed the first button.
    {
    switch(dialogid)// If you only have one dialog, then this isn't required, but it's neater for when you implement more dialogs.
        {
        case 3:// Our dialog!ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Select your Weapons", "SMG-AK47-Grenades\        //Tec9-M4-Chainsaw\MicroSMG-Shotgun-Knife", "Choose");
            {
            switch(listitem)// Checking which listitem was selected
            {
                case 0:// The first item listed
                {
                GivePlayerWeapon( playerid, 28,9999);
                GivePlayerWeapon( playerid, 26,9999);
                GivePlayerWeapon( playerid, 34,9999);
                weapon[playerid]=8;
                TogglePlayerControllable(playerid,true);
                }
                case 1: // The second item listed
                {
                GivePlayerWeapon( playerid, 32,9999);
                GivePlayerWeapon( playerid, 26,9999);
                GivePlayerWeapon( playerid, 34,9999);
                weapon[playerid]=9;
                TogglePlayerControllable(playerid,true);
                }
                case 2: // The third item listed
                {
                    GivePlayerWeapon( playerid, 27,9999);
                    GivePlayerWeapon( playerid, 26,9999);
                    GivePlayerWeapon( playerid, 4,1);
                    weapon[playerid]=10;
                    TogglePlayerControllable(playerid,true);
                }
            }
            }
        }
    }
    return 1;
}
Reply
#2

I'm not sure what your problem is but, do you have all 3 of them functions in your mode?
Reply
#3

yes
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(response)// They pressed the first button.
    {
    switch(dialogid)// If you only have one dialog, then this isn't required, but it's neater for when you implement more dialogs.
        {
        case 1:// Our dialog!ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Select your Weapons", "SMG-AK47-Grenades\        //Tec9-M4-Chainsaw\MicroSMG-Shotgun-Knife", "Choose");
            {
            switch(listitem)// Checking which listitem was selected
            {
                case 0:// The first item listed
                {
                GivePlayerWeapon( playerid, 29,500);
                GivePlayerWeapon( playerid, 30,500);
                GivePlayerWeapon( playerid, 16,10);
                weapon[playerid]=2;
                TogglePlayerControllable(playerid,true);
                }
                case 1: // The second item listed
                {
                GivePlayerWeapon( playerid, 32,500);
                GivePlayerWeapon( playerid, 31,500);
                GivePlayerWeapon( playerid, 9,1);
                weapon[playerid]=3;
                TogglePlayerControllable(playerid,true);
                }
                case 2: // The third item listed
                {
                    GivePlayerWeapon( playerid, 28,500);
                    GivePlayerWeapon( playerid, 25,40);
                    GivePlayerWeapon( playerid, 4,1);
                    weapon[playerid]=4;
                    TogglePlayerControllable(playerid,true);
                }
                case 3: // The third item listed
                {
                if(IsPlayerLuxAdmin(playerid))
                {
                ShowPlayerDialog(playerid, 3, DIALOG_STYLE_LIST, "Admin Weapons", "MicroSMG-Sawnoff-Sniper\nTec9-Sawnoff-Sniper\nCombatShotgun-Sawnoff-Knife", "Choose", "No Weaps");
                }
                else SendClientMessage(playerid, COLOR_WHITE, "ERROR: Your not Admin");
                ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Select your Weapons", "SMG-AK47-Grenades\nTec9-M4-Chainsaw\nMicroSMG-Shotgun-Knife\nAdmins\nVip's", "Choose", "No Weaps");

                }
                case 4: // The third item listed
                {
                if(IsPlayerVipMember(playerid))
                {
                ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Vip Weapons", "MicroSMG-Sawnoff-Sniper\nTec9-Sawnoff-Sniper\nCombatShotgun-Sawnoff-Knife", "Choose", "No Weaps");
                }
                else SendClientMessage(playerid, COLOR_WHITE, "ERROR: Your not a Vip Member!");
                ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Select your Weapons", "SMG-AK47-Grenades\nTec9-M4-Chainsaw\nMicroSMG-Shotgun-Knife\nAdmins\nVip's", "Choose", "No Weaps");

                }
            }
            }
        }
    }
if(response)// They pressed the first button.
    {
    switch(dialogid)// If you only have one dialog, then this isn't required, but it's neater for when you implement more dialogs.
        {
        case 2:// Our dialog!ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Select your Weapons", "SMG-AK47-Grenades\        //Tec9-M4-Chainsaw\MicroSMG-Shotgun-Knife", "Choose");
            {
            switch(listitem)// Checking which listitem was selected
            {
                case 0:// The first item listed
                {
                GivePlayerWeapon( playerid, 28,1500);
                GivePlayerWeapon( playerid, 26,100);
                GivePlayerWeapon( playerid, 34,100);
                weapon[playerid]=5;
                TogglePlayerControllable(playerid,true);
                }
                case 1: // The second item listed
                {
                GivePlayerWeapon( playerid, 32,1500);
                GivePlayerWeapon( playerid, 26,100);
                GivePlayerWeapon( playerid, 34,100);
                weapon[playerid]=6;
                TogglePlayerControllable(playerid,true);
                }
                case 2: // The third item listed
                {
                    GivePlayerWeapon( playerid, 27,150);
                    GivePlayerWeapon( playerid, 26,100);
                    GivePlayerWeapon( playerid, 4,1);
                    weapon[playerid]=7;
                    TogglePlayerControllable(playerid,true);
                }
            }
            }
        }
    }
if(response)// They pressed the first button.
    {
    switch(dialogid)// If you only have one dialog, then this isn't required, but it's neater for when you implement more dialogs.
        {
        case 3:// Our dialog!ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Select your Weapons", "SMG-AK47-Grenades\        //Tec9-M4-Chainsaw\MicroSMG-Shotgun-Knife", "Choose");
            {
            switch(listitem)// Checking which listitem was selected
            {
                case 0:// The first item listed
                {
                GivePlayerWeapon( playerid, 28,9999);
                GivePlayerWeapon( playerid, 26,9999);
                GivePlayerWeapon( playerid, 34,9999);
                weapon[playerid]=8;
                TogglePlayerControllable(playerid,true);
                }
                case 1: // The second item listed
                {
                GivePlayerWeapon( playerid, 32,9999);
                GivePlayerWeapon( playerid, 26,9999);
                GivePlayerWeapon( playerid, 34,9999);
                weapon[playerid]=9;
                TogglePlayerControllable(playerid,true);
                }
                case 2: // The third item listed
                {
                    GivePlayerWeapon( playerid, 27,9999);
                    GivePlayerWeapon( playerid, 26,9999);
                    GivePlayerWeapon( playerid, 4,1);
                    weapon[playerid]=10;
                    TogglePlayerControllable(playerid,true);
                }
            }
            }
        }
    }
    return 1;
}
I want my menu opens a another menu but when I click on admins or vip than the same menu stays
Reply
#4

What is dialogid ? It must be diffend i think...
Reply
#5

Try changing
pawn Код:
case 4: // The third item listed
                {
                if(IsPlayerVipMember(playerid))
                {
                ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Vip Weapons", "MicroSMG-Sawnoff-Sniper\nTec9-Sawnoff-Sniper\nCombatShotgun-Sawnoff-Knife", "Choose", "No Weaps");
                }
                else SendClientMessage(playerid, COLOR_WHITE, "ERROR: Your not a Vip Member!");
                ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Select your Weapons", "SMG-AK47-Grenades\nTec9-M4-Chainsaw\nMicroSMG-Shotgun-Knife\nAdmins\nVip's", "Choose", "No Weaps");

                }
to
pawn Код:
case 4: // The third item listed
{
    if(IsPlayerVipMember(playerid))
    {
        ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Vip Weapons", "MicroSMG-Sawnoff-Sniper\nTec9-Sawnoff-Sniper\nCombatShotgun-Sawnoff-Knife", "Choose", "No Weaps");
    }
    else
    {
        SendClientMessage(playerid, COLOR_WHITE, "ERROR: Your not a Vip Member!");
        ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Select your Weapons", "SMG-AK47-Grenades\nTec9-M4-Chainsaw\nMicroSMG-Shotgun-Knife\nAdmins\nVip's", "Choose", "No Weaps");
    }
}
Reply
#6

thanx its fixed !! rep +
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)