20.01.2013, 19:29
When you try to detect when a player presses the Enter key and display them a dialog after that (inside OnPlayerKeyStateChange) - OnDialogResponse will be automatically called with "response" parameter set to true.
Here's the video which describes what I mean: http://beta.xfire.com/video/5db67c
Code for testing:
Here's the video which describes what I mean: http://beta.xfire.com/video/5db67c
Code for testing:
pawn Code:
#include <a_samp>
main( ) { }
public OnGameModeInit()
{
AddPlayerClass(0,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (newkeys & KEY_SECONDARY_ATTACK)
{
SendClientMessage(playerid, -1, "Enter pressed");
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_MSGBOX, "Test", "Text\nText\nText\nText", "OK", "");
}
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
return SendClientMessage(playerid, -1, "OnDialogResponse called");
}