Skip to content

Commit 8fdef36

Browse files
authored
Update README.md
1 parent 01d0b32 commit 8fdef36

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

README.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,52 @@
11
# Dialogs-Samp
22
Include to make easy your life with dialogs.
3+
4+
| Total downloads | Latest release |
5+
| :---: | :---: |
6+
[![All Releases](https://img.shields.io/github/downloads/Dayvison/Dialogs-Samp/total.svg?maxAge=86400)]() | [![latest release](https://img.shields.io/github/release/Dayvison/Dialogs-Samp.svg?maxAge=86400)](https://github.com/Dayvison/Dialogs-Samp/releases) <br> [![Github Releases](https://img.shields.io/github/downloads/Dayvison/Dialogs-Samp/latest/total.svg?maxAge=86400)](https://github.com/Dayvison/Dialogs-Samp/releases) |
7+
8+
## Features
9+
* Response for dialogs(Like ZCMD processor)
10+
* Create dynamic dialogs
11+
* Format the info directly in the dialog, without need use format.
12+
* A new callback `OnDialogPerformed`, called before showing dialog to player
13+
14+
## Examples
15+
16+
### Creating and show the dialog for player
17+
```pawn
18+
CreateDialog:Dialog(playerid, style, caption[], info[], button1[], button2[])
19+
{
20+
style = DIALOG_STYLE_MSGBOX;
21+
caption = "Hello World!";
22+
button1 = "Hello";
23+
button2 = "World";
24+
new name[MAX_PLAYER_NAME];
25+
GetPlayerName(playerid, name, sizeof(name));
26+
format(info, sizeof(info), "Hello %s. What you think about?", name);
27+
}
28+
public OnPlayerConnect(playerid)
29+
{
30+
ShowDialog(playerid, Dialog);
31+
}
32+
Dialog:Dialog(playerid, dialogid, response, listitem, inputtext[])
33+
{
34+
SendClientMessage(playerid, -1, response ? "You clicked at button 1" : "You clicked at button 0");
35+
return true;
36+
}
37+
```
38+
39+
### Show dialog without create
40+
```pawn
41+
public OnPlayerConnect(playerid)
42+
{
43+
new name[MAX_PLAYER_NAME];
44+
GetPlayerName(playerid, name, sizeof(name));
45+
ShowPlayerDialog(playerid, Dialog, DIALOG_STYLE_MSGBOX, "Hello World!", "Hello %s. What you think about?", "Hello", "World", name);
46+
}
47+
Dialog:Dialog(playerid, dialogid, response, listitem, inputtext[])
48+
{
49+
SendClientMessage(playerid, -1, response ? "You clicked at button 1" : "You clicked at button 0");
50+
return true;
51+
}
52+
```

0 commit comments

Comments
 (0)