Dialog Styles

From SA-MP Wiki

Jump to: navigation, search


To be used with ShowPlayerDialog.

0 - DIALOG_STYLE_MSGBOX

This dialog shows a simple message to the player, and has 2 buttons for response. Leaving the second button's text completely blank ("") will make only the first button appear. The same applies for all dialog styles.

Image:dialog_style_msgbox.png



1 - DIALOG_STYLE_INPUT

This dialog style allows the user to input textual information.

Image:dialog_style_input.png



2 - DIALOG_STYLE_LIST

This dialog style allows a list of options to be shown to the player, which they can select.

Image:dialog_style_list.png

Example Usage:

ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_LIST, "Buy Weapon",
"Item 0\n\
Item 1\n\
Item 2\n",
"Select", "Cancel");

3 - DIALOG_STYLE_PASSWORD

This dialog style is similar to DIALOG_STYLE_INPUT, but the input is hidden from the player. This is most suitable for entering passwords.

Image:dialog_style_password.png



4 - DIALOG_STYLE_TABLIST

This style was added in SA-MP 0.3.7 and will not work in earlier versions!


This dialog style is similar to DIALOG_STYLE_LIST, several columns can be defined to align information however 4 columns is maximum - more than 4 columns will not show.

Image:dialog_style_tablist.png

Example Usage:

ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_TABLIST, "Buy Weapon",
"Deagle\t$5000\t100\n\
Sawnoff\t$5000\t100\n\
Pistol\t$1000\t50", // Etc.
"Select", "Cancel");


5 - DIALOG_STYLE_TABLIST_HEADERS

This style was added in SA-MP 0.3.7 and will not work in earlier versions!


This style is the same as DIALOG_STYLE_TABLIST, however headers for each column can be defined at the start. Same limits apply as above: 4 columns is maximum - more than 4 columns will not show.

Image:dialog_style_tablist_headers.png

Example Usage:

ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_TABLIST_HEADERS, "Buy Weapon",
"Weapon\tPrice\tAmmo\n\
Deagle\t$5000\t100\n\
Sawnoff\t$5000\t100\n\
Pistol\t$1000\t50", // Etc.
"Select", "Cancel");
Personal tools
In other languages