Check if the player is using Dialog
#1

is there a native function to do this?
Reply
#2

Create a boolean variable and set it to "true" whenever you show the player dialog, and set "false" under OnDialogResponse.

So this way, when the value is true, the player is using dialog.
Reply
#3

You could do something like:
PHP код:
stock ShowPlayerDialogEx(playeriddialogidstylecaption[], info[], button1[], button2[]);
{
    
p_ActiveDialog[playerid] = true;
    
    
ShowPlayerDialog(playeriddialogidstylecaptioninfobutton1button2); 
    return 
1

So you don't have to set their variable during every instance of a dialog being shown.
Reply
#4

Okay.. no native function, thanks though I'll take this.
Reply
#5

Quote:
Originally Posted by Gammix
Посмотреть сообщение
Create a boolean variable and set it to "true" whenever you show the player dialog, and set "false" under OnDialogResponse.

So this way, when the value is true, the player is using dialog.
Also note that command can be used while a dialog is shown, so whatever you are going to do with this detection you can take that in account.

OFF TOPIC: You're finally out of the game! Took you long enough. So much time wasted in those releases of yours
Reply
#6

You can use this: https://pastebin.com/MG7sgr8V
It's not advanced at all, so I don't mind. I wrote this in 5 minutes a few days ago when I needed something similar. It basically the same idea that Arthur Kane suggested. Provides two API functions:
PHP код:
IsPlayerDialogOpen(playeriddialogid)
IsAnyPlayerDialogOpen(playerid
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)