Scripting/Server/Events/onDialogResponse
The player answered a dialog opened with ShowPlayerDialog (v0.2.3+, see section 4.9). response is 1 for the left button (or Enter) and 0 for the right button (or ESC). listitem is the selected row of the list styles (the header row is not counted), -1 for the other styles. inputtext is only filled for DIALOG_STYLE_INPUT and DIALOG_STYLE_PASSWORD. The dialog is closed by any answer; show another one from the handler to chain them. Answers for a dialog id that is not the one currently shown are ignored by the server.
Syntax
onDialogResponse(player, dialogid, response, listitem, inputtext)Arguments
- Player player
- int dialogid
- any response –
responseis1for the left button (or Enter) and0for the right button (or ESC). - any listitem –
listitemis the selected row of the list styles (the header row is not counted),-1for the other styles. - any inputtext –
inputtextis only filled forDIALOG_STYLE_INPUTandDIALOG_STYLE_PASSWORD.
Example
function onDialogResponse( player, dialogid, response, listitem, inputtext )
{
MessagePlayer( "onDialogResponse fired", player );
}This sample was generated from the signature – adapt the values to your gamemode.
Related pages
- onTrafficPedCreated
- onTrafficVehicleCreated
- onTrafficPedRemoved
- onTrafficVehicleRemoved
- onPlayerShootTrafficPed
- onTrafficPedDeath
- onTrafficVehicleWrecked
- onPlayerTakeOverTrafficVehicle
- onPlayerCommitCrime
- onPlayerEditObject
- onPlayerSelectObject
- onPlayerEditGraffiti
Section: Traffic events
Categories: Server events | Traffic events