Scripting/Server/Functions/ShowPlayerDialog
Opens a dialog. dialogid is your own number 0-32767 that comes back in onDialogResponse. caption is the title bar (max 64 characters), info the body (max 4000 bytes), button1 is the left/confirm button, button2 the right/cancel button - pass "" for button2 to show a single button (ESC then does nothing). Showing a new dialog replaces the one that is open. Text colours: {RRGGBB} inside any text (PC).
Syntax
ShowPlayerDialog(player, dialogid, style, caption, info, button1, button2)Arguments
- Player player
- int dialogid –
dialogidis your own number 0-32767 that comes back inonDialogResponse. - any style
- string caption –
captionis the title bar (max 64 characters),infothe body (max 4000 bytes),button1is the left/confirm button,button2the right/cancel button - pass""forbutton2to show a single button (ESC then does nothing). - any info –
captionis the title bar (max 64 characters),infothe body (max 4000 bytes),button1is the left/confirm button,button2the right/cancel button - pass""forbutton2to show a single button (ESC then does nothing). - any button1 –
captionis the title bar (max 64 characters),infothe body (max 4000 bytes),button1is the left/confirm button,button2the right/cancel button - pass""forbutton2to show a single button (ESC then does nothing). - any button2 –
captionis the title bar (max 64 characters),infothe body (max 4000 bytes),button1is the left/confirm button,button2the right/cancel button - pass""forbutton2to show a single button (ESC then does nothing).
Returns
bool (false if the player is not connected or an argument is invalid)
Example
function onPlayerCommand( player, cmd, params )
{
if ( cmd == "showplayerdialog" )
{
local result = ShowPlayerDialog( player, 0, 0, "Hello world", 0, 0, 0 );
MessagePlayer( "ShowPlayerDialog returned: " + result, player );
}
}This sample was generated from the signature – adapt the values to your gamemode.
Related pages
Section: Server dialogs (SA-MP style)
Categories: Server functions | Server dialogs (SA-MP style)