nothing happened after clicking dialog -
xFirex - 03.06.2014
I press the Sell Fish and nothing appear.. its should show the dialog.
its should appear the dialog Sell Your Fish.. bla2
Help
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == FISH_DIALOG)
{
if(response)
{
if(listitem == 0)
{
new string[300];
format(string, sizeof(string), "Buy Baits | Cost: %d", BaitCost);
ShowPlayerDialog(playerid,FISH_DIALOG+1, DIALOG_STYLE_INPUT, "Fish Market", string, "Buy", "Cancel");
}
if(listitem == 1)
{
new string[300];
format(string, sizeof(string), "Buy Line | Cost: %d", LineCost);
ShowPlayerDialog(playerid,FISH_DIALOG+2, DIALOG_STYLE_INPUT, "Fish Market", string, "Buy", "Cancel");
}
if(listitem == 2)
{
new string[300];
format(string, sizeof(string), "Buy Rod | Cost: %d", RodCost);
ShowPlayerDialog(playerid, FISH_DIALOG+3, DIALOG_STYLE_MSGBOX, "Fish Market", string, "Buy", "Cancel");
}
if(listitem == 3)
{
new string[300];
format(string, sizeof(string), "Selll Your Fish", RodCost);
ShowPlayerDialog(playerid, FISH_DIALOG+4, DIALOG_STYLE_MSGBOX, "Fish Market", string, "Buy", "Cancel");
}
}
return 1;
}
return 0;
}
CMD
pawn Код:
CMD:fish(playerid,params[])
{
ShowPlayerDialog(playerid, FISH_DIALOG, DIALOG_STYLE_LIST, "Fish Market", "Buy Baits\nBuy Line\nBuy Rod\nSell Fish", "Buy", "Cancel");
return 1;
}
Re: nothing happened after clicking dialog - Guest4390857394857 - 03.06.2014
I think you 'll need to use switch function!
Re: nothing happened after clicking dialog -
xFirex - 03.06.2014
owh. i forgot to tell.. i already use switch function
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+1, 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+2, 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+3, DIALOG_STYLE_MSGBOX, "Fish Market", string, "Buy", "Cancel");
}
}
}
return 1;
}
return 0;
}
Re: nothing happened after clicking dialog -
Threshold - 03.06.2014
Did you remove listitem 3...?
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == FISH_DIALOG)
{
if(response)
{
new string[35];
switch(listitem)
{
case 0:
{
format(string, sizeof(string), "Buy Baits | Cost: $%d", BaitCost);
ShowPlayerDialog(playerid,FISH_DIALOG+1, DIALOG_STYLE_INPUT, "Fish Market", string, "Buy", "Cancel");
}
case 1:
{
format(string, sizeof(string), "Buy Line | Cost: $%d", LineCost);
ShowPlayerDialog(playerid,FISH_DIALOG+2, DIALOG_STYLE_INPUT, "Fish Market", string, "Buy", "Cancel");
}
case 2:
{
format(string, sizeof(string), "Buy Rod | Cost: $%d", RodCost);
ShowPlayerDialog(playerid, FISH_DIALOG+3, DIALOG_STYLE_MSGBOX, "Fish Market", string, "Buy", "Cancel");
}
case 3: ShowPlayerDialog(playerid, FISH_DIALOG+4, DIALOG_STYLE_MSGBOX, "Fish Market", "Sell Your Fish?", "Sell", "Cancel");
}
}
return 1;
}
return 0;
}
Re: nothing happened after clicking dialog -
xFirex - 03.06.2014
already added.. also not working
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+1, 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+2, 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+3, 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+4, DIALOG_STYLE_MSGBOX, "Fish Market", string, "Buy", "Cancel");
}
}
}
return 1;
}
return 0;
}
Re: nothing happened after clicking dialog -
xFirex - 03.06.2014
up, really need to fix.
Re: nothing happened after clicking dialog -
Koala818 - 03.06.2014
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;
}
Re: nothing happened after clicking dialog -
xFirex - 03.06.2014
and.. how to set function about selling the fish and buy baits,, ?
Re: nothing happened after clicking dialog -
Koala818 - 03.06.2014
Then you need to create another dialogid FISH_DIALOG+1...
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+1, 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+2, 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+3, 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+4, DIALOG_STYLE_MSGBOX, "Fish Market", string, "Buy", "Cancel");
}
}
}
return 1;
}
if(dialogid==FISH_DIALOG+1)
{
if(response)
//buy baits
}
if(dialogid==FISH_DIALOG+2)
{
if(response)
//buy line
}
if(dialogid==FISH_DIALOG+3)
{
if(response)
//buy road
}
if(dialogid==FISH_DIALOG+4)
{
if(response)
//Sell fish
}
return 0;
}