Check if the player is using Dialog - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Check if the player is using Dialog (
/showthread.php?tid=641226)
Check if the player is using Dialog -
SetPlayerNameTag - 13.09.2017
is there a native function to do this?
Re: Check if the player is using Dialog -
Gammix - 13.09.2017
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.
Re: Check if the player is using Dialog -
Kane - 13.09.2017
You could do something like:
PHP код:
stock ShowPlayerDialogEx(playerid, dialogid, style, caption[], info[], button1[], button2[]);
{
p_ActiveDialog[playerid] = true;
ShowPlayerDialog(playerid, dialogid, style, caption, info, button1, button2);
return 1;
}
So you don't have to set their variable during every instance of a dialog being shown.
Re: Check if the player is using Dialog -
SetPlayerNameTag - 13.09.2017
Okay.. no native function, thanks though I'll take this.
Re: Check if the player is using Dialog -
Paulice - 13.09.2017
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
Re: Check if the player is using Dialog -
Vince - 13.09.2017
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(playerid, dialogid)
IsAnyPlayerDialogOpen(playerid)