Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Robson04 authored Jul 16, 2021
1 parent c478430 commit 2256a70
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,15 @@ for(new i = 0; i < 100; i++)
format(tmp_str, sizeof tmp_str, "Random number: %i\n", random(999));
strcat(string, tmp_str);
}
ShowPlayerDialogPages(playerid, 9812, DIALOG_STYLE_LIST, "Dialog-Pages - Test.", string, "Select", "Cancel", 15, "Next page", "Previous Page", true);
ShowPlayerDialogPages(playerid, 9700, DIALOG_STYLE_LIST, "Dialog-Pages - Test.", string, "Select", "Cancel", 15, "Next page", "Previous Page", true);
```
When you using dynamic dialogs, you are forced to add an action for page buttons on the your code. To give them an action, you need to use the OnDialogPagesResponse callback and check which button has been clicked. For this condition, you will need the last two callback parameters. Just see 109 line:
```pawn
public OnDialogPagesResponse(playerid, dialogid, response, listitem, inputtext[], btn_next_index, btn_previous_index)
{
switch(dialogid)
{
case 9812:
case 9700:
{
if(listitem == btn_next_index || listitem == btn_previous_index) //line 109
{
Expand Down Expand Up @@ -147,7 +147,7 @@ public OnDialogPagesResponse(playerid, dialogid, response, listitem, inputtext[]
{
switch(dialogid)
{
case 9812:
case 9700:
{
if(listitem == btn_next_index || listitem == btn_previous_index)
{
Expand Down

0 comments on commit 2256a70

Please sign in to comment.