04.06.2010, 14:34
Hey,i have a problem(again o.O),this time with dialogs.
I'm embarrassed to ask it,but here
The problem is,when i choose one of the options from dialog id 1,it doesn't show dialog id 2 or 3.
E.X if i chose "Choose from list" it doesn't affect.
Probably something stupid I've done.
Anyway thanks in advance to all helpers.
I'm embarrassed to ask it,but here
pawn Code:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 1 && response)
switch(listitem)
{
case 0:
{
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Choose from list:", "Red\nBlue\nLight blue\nGreen\nLight Green\nYellow\nLight yellow\nBlack\nWhite\nOrange\nBrown", "Apply", "Cancel");
}
case 1:
{
ShowPlayerDialog(playerid, 3,DIALOG_STYLE_INPUT,"Write color"," Write a color in hex notation format:","Apply","Cancel");
}
}
if(dialogid == 2 && response)
switch(listitem)
{
case 0:
{
SetPlayerColor(playerid,COLOR_RED);
}
case 1:
{
SetPlayerColor(playerid,COLOR_BLUE);
}
case 2:
{
SetPlayerColor(playerid,COLOR_LIGHTBLUE);
}
case 3:
{
SetPlayerColor(playerid,COLOR_GREEN);
}
case 4:
{
SetPlayerColor(playerid,COLOR_LIGHTGREEN);
}
case 5:
{
SetPlayerColor(playerid,COLOR_YELLOW);
}
case 6:
{
SetPlayerColor(playerid,COLOR_LIGHTYELLOW);
}
case 7:
{
SetPlayerColor(playerid,COLOR_BLACK);
}
case 8:
{
SetPlayerColor(playerid,COLOR_WHITE);
}
case 9:
{
SetPlayerColor(playerid,COLOR_ORANGE);
}
case 10:
{
SetPlayerColor(playerid,COLOR_BROWN);
}
}
if(dialogid == 3 && response)
{
new tmp[128];
if(response)
{
if(strval(tmp) < 10 || strval(tmp) > 10)
{
SendClientMessage(playerid,COLOR_RED,"ERROR: Invailed color format.");
}
else
{
SetPlayerColor(playerid,strval(tmp));
}
}
}
return 1;
}
E.X if i chose "Choose from list" it doesn't affect.
Probably something stupid I've done.
Anyway thanks in advance to all helpers.