You've been given good methods for defining dialogs and they work efficiently, I'll give you one more method which I prefer though. Hmm what about writing an special include file for dialogs? Let me explain:
Open up notepad and put something like this:
pawn Код:
// Dialogs IDs
#if defined _diags_included
#endinput
#endif
#define _diags_included
// Dialogs definations
#define Dialog 1 // Example
#define Dialogo Dialog+1 // another example actually Dialogo is set to 2 now (1 + Dialog = 1 + 1 = 2)
#define Dialogoo 3
// Other dialogs
Save as .inc (Include File) then put this file into your pawno include folder.
After that open up your a_samp include file then include the dialogs inc file there:
pawn Код:
#include <core>
#include <float>
#include <string>
#include <file>
#include <time>
#include <datagram>
#include <a_players>
#include <a_vehicles>
#include <a_objects>
#include <a_sampdb>
#include <dialogs> // replace "dialogs" with your dialogs include file name.
So as soon as you include a_samp, the dialogs inc file will be included as well. So, whenever you want to add/remove a dialog, you'll just have to go to the dialogs inc file and define/un-define it there.
Now you can easily use your dialogs in any script that includes the a_samp we modified above:
pawn Код:
ShowPlayerDialog(playerid, Dialogo, ...);
The same can be done with virtual worlds and such things.