01.03.2014, 19:08
Your code checks if the dialogid is equal to SHOP_DIALOG and then you use switch on dialogid and you say, if the dialogid is 0 then show the dialog SHOP_SKIN.
I guess you mean list item:
However, using switch is faster and it's recommended:
If you don't use DIALOG_STYLE_LIST in SHOP_DIALOG dialog, then listitem will be -1 so you will need to change:
to:
I guess you mean list item:
pawn Код:
if (dialogid == SHOP_DIALOG)
{
if (response)
{
if (!listitem) ShowPlayerDialog(playerid, SHOP_SKIN, DIALOG_STYLE_INPUT, "Enter a valid Skin ID.", "", "OK", "Cancel");
}
return 1;
}
else if (dialogid == SHOP_SKIN)
{
if (response)
{
SetPlayerSkin(playerid, strval(inputtext));
GivePlayerMoney(playerid, -5000);
}
return 1;
}
pawn Код:
switch (dialogid)
{
case SHOP_DIALOG:
{
if (response)
{
if (!listitem) ShowPlayerDialog(playerid, SHOP_SKIN, DIALOG_STYLE_INPUT, "Enter a valid Skin ID.", "", "OK", "Cancel");
}
return 1;
}
case SHOP_SKIN:
{
if (response)
{
SetPlayerSkin(playerid, strval(inputtext));
GivePlayerMoney(playerid, -5000);
}
return 1;
}
}
pawn Код:
if (!listitem) ShowPlayerDialog(playerid, SHOP_SKIN, DIALOG_STYLE_INPUT, "Enter a valid Skin ID.", "", "OK", "Cancel");
pawn Код:
ShowPlayerDialog(playerid, SHOP_SKIN, DIALOG_STYLE_INPUT, "Enter a valid Skin ID.", "", "OK", "Cancel");