03.06.2014, 04:52
In onDialogResponse you only have 1 dialogid named "FISH_DIALOG" but you are showing players a dialog with the id "FISH_DIALOG+1/2/3/4" so when they respond, the function won't find any "FISH_DIALOG+1/2/3/4" in OnDialogResponse. Try to remove those numbers and let just FISH_DIALOG.
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == FISH_DIALOG)
{
if(response)
{
switch(listitem)
{
case 0:
{
new string[300];
format(string, sizeof(string), "Buy Baits | Cost: %d", BaitCost);
ShowPlayerDialog(playerid,FISH_DIALOG, DIALOG_STYLE_INPUT, "Fish Market", string, "Buy", "Cancel");
}
case 1:
{
new string[300];
format(string, sizeof(string), "Buy Line | Cost: %d", LineCost);
ShowPlayerDialog(playerid,FISH_DIALOG, DIALOG_STYLE_INPUT, "Fish Market", string, "Buy", "Cancel");
}
case 2:
{
new string[300];
format(string, sizeof(string), "Buy Rod | Cost: %d", RodCost);
ShowPlayerDialog(playerid, FISH_DIALOG, DIALOG_STYLE_MSGBOX, "Fish Market", string, "Buy", "Cancel");
}
case 3:
{
new string[300];
new cleanpay = PlayerInfo[playerid][pFishMoney] -= PlayerInfo[playerid][pTax];
format(string, sizeof(string), "Sell Fish\n\nFish Money : %d\nTax : %d \nClean Play : %d ",PlayerInfo[playerid][pFishMoney],PlayerInfo[playerid][pTax],cleanpay );
ShowPlayerDialog(playerid, FISH_DIALOG, DIALOG_STYLE_MSGBOX, "Fish Market", string, "Buy", "Cancel");
}
}
}
return 1;
}
return 0;
}