dialog menu - listitem's name
#2

Why not use the ID instead?
Code:
#define DIALOG_WEAPONS 3
 
// In some command
ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_LIST, "Weapons", "Desert Eagle\nAK-47\nCombat Shotgun", "Select", "Close");
 
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOG_WEAPONS)
    {
        if(response) // If they clicked 'Select' or double-clicked a weapon
        {
            // Give them the weapon
            switch(listitem)
            {
                case 0: GivePlayerWeapon(playerid, WEAPON_DEAGLE, 14); // Give them a desert eagle
                case 1: GivePlayerWeapon(playerid, WEAPON_AK47, 120); // Give them an AK-47
                case 2: GivePlayerWeapon(playerid, WEAPON_SHOTGSPA, 28); // Give them a Combat Shotgun
            }
        }
        return 1;
    } 
    return 0;
}
https://sampwiki.blast.hk/wiki/OnDialogResponse
Reply


Messages In This Thread
dialog menu - listitem's name - by VincenzoDrift - 31.12.2015, 11:16
Re: dialog menu - listitem's name - by Larceny - 31.12.2015, 11:54
Re: dialog menu - listitem's name - by Stanford - 31.12.2015, 12:12
Re: dialog menu - listitem's name - by VincenzoDrift - 31.12.2015, 12:24

Forum Jump:


Users browsing this thread: 2 Guest(s)