31.12.2015, 11:54
Why not use the ID instead?
https://sampwiki.blast.hk/wiki/OnDialogResponse
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; }