08.08.2010, 04:23
(
Last edited by ev0lution; 08/08/2010 at 04:41 AM.
)
Dialog Controller
Dynamically create and show dialogs!
What is it?Dynamically create and show dialogs!
Dialog Controller allows you to dynamically create dialogs and show them to players. It keeps track of dialog data, and also handles OnDialogResponse.
The system consists of a filterscript, which keeps track of everything and actually shows the dialogs, and an include, which you include in any script you want to use this system. Dialog IDs will not clash, provided you only use this system.
It provides a system which you can use to easily create dialogs and assign them to variables, then show them whenever necessary. You won't ever have to worry about dialog IDs.

How do I use it?
Copy the compiled filterscript to your server's filterscript directory, or compile it from the source provided. Load the filterscript as you normally would, by adding "dialog" to your filterscripts line.
Include the "dialog.inc" file in any scripts which you would like to use this system in. (with "#include <dialog>") You shouldn't mix normal ShowPlayerDialog functions with this system in the same script.
For a list of functions to use, as well as how to use them, please see dialog.inc.
OnDialogResponse should operate the same way it does usually. For checking which dialog was called, compare it to the ID received from CreateDialog.
What am I allowed to do with it?
Dialog Controller is licensed under the GNU General Public License. Please see COPYING in the download package, or http://www.gnu.org/licenses/gpl.html.
Where can I download it?
Right here - this also includes the source.
http://code.******.com/p/sa-mpdialog...1.0.0-full.zip (1.0.0 @ 08/08/10)
Please abide by the terms of the license!
Note: You should use isnull (included in dialog.inc) to check if inputtext is empty in OnDialogResponse. This is because CallRemoteFunction crashes when passing an empty string, so I had to make Dialog Controller pass \1. (which is detected properly with isnull)