PDA

View Full Version : OnDialogResponse


Ananisiki
20/03/2014, 05:44 AM
if(dialogid == DIALOG_NWEAPONS)
{
if(response)
{
if(listitem == 0)
{
GivePlayerWeapon(playerid, 9 , 1);
}
if(listitem == 1)
{
GivePlayerWeapon(playerid, 22, 3000);
}
if(listitem == 2)
{
GivePlayerWeapon(playerid, 23, 3000);
}
if(listitem == 3)
{
GivePlayerWeapon(playerid, 24 , 3000);
}
if(listitem == 4)
{
GivePlayerWeapon(playerid, 25 , 3000);
}
if(listitem == 5)
{
GivePlayerWeapon(playerid, 26 , 3000);
}
if(listitem == 6)
{
GivePlayerWeapon(playerid, 27 , 3000);
}
if(listitem == 7)
{
GivePlayerWeapon(playerid, 28, 3000);
}
if(listitem == 8)
{
GivePlayerWeapon(playerid, 29 , 3000);
}
if(listitem == 9)
{
GivePlayerWeapon(playerid, 30, 3000);
}
if(listitem == 10)
{
GivePlayerWeapon(playerid, 31, 3000);
}
if(listitem == 11)
{
GivePlayerWeapon(playerid, 32 , 3000);
}
if(listitem == 12)
{
GivePlayerWeapon(playerid, 33 , 3000);
}
if(listitem == 13)
{
GivePlayerWeapon(playerid, 34 , 3000);
}
}
}


When i try to give the first opinion (chainsaw) it gives me a golf club instead, and if i try to pick #2 it gives me a nightstick, if i try the other numbers it doesn't give me..

]Rafaellos[
20/03/2014, 06:11 AM
Show us the ShowPlayerDialog.

azzerking
20/03/2014, 06:12 AM
Could you show us your ShowPlayerDialog?

and your whole code for OnDialogResponse.

Ananisiki
03/04/2014, 07:40 PM
Bump

Macronix
03/04/2014, 07:47 PM
Mmh, can you show me your command or function where you put ShowPlayerDialog like the others said?
Also put it like this:
if(dialogid == DIALOG_NWEAPONS)
{
if(response)
{
switch(listitem)
{
case 0: GivePlayerWeapon(playerid, 9 , 1);
case 1: GivePlayerWeapon....
//and so on...
}
}
}

EiresJason
03/04/2014, 07:49 PM
Show us where you use the dialog.

It should be something like:

ShowPlayerDialog(playerid, DIALOG_NWEAPONS, DIALOG_STYLE_LISTITEM, "Weapons", "Brass Knuckles\nNightstick..(and then the rest)", "Select", "Cancel");

Ananisiki
03/04/2014, 08:57 PM
EDIT: Thanks.....