Dialog mixed with KeyChange...
#1

Hello, what I want to do is, if player is near object and pressed ENTER there dialog will show to the player.
But when I pressed enter it fastly opens the dialog, and when I released enter it close the dialog, how can I do it when I will press enter dialog won't disappear ?

+How can I put this thing in quote thingy it's something like [pawno] [/pawno] ? or what ever it is :P

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(IsPlayerInRangeOfPoint(playerid,0.7,1581.500000 0,-1708.8000488,3619.1999512) && (PRESSED(KEY_SECONDARY_ATTACK)))
{
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Which jail cell door do you want to open?", "Jail cell door 1\nJail cell door 2\nJail cell door 3", "Open", "Cancel");
}
return 1;
}

Thank you for help in advance =)
Reply
#2

The problem lies within OnDialogResponse. When you release enter it receives response 0, and closes the dialog. Solution? Show the dialog on enter release:
pawn Код:
PRESSED => RELEASED
It's [pawn].

#e:
Or in OnDialogResponse show dialog again first time when response is 0.
Reply
#3

pawn Код:
Thank you =) now it works great ;)
.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)