Best effiecent scripting
#30

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.
Reply


Messages In This Thread
Best effiecent scripting - by Jack_Leslie - 31.07.2012, 03:27
Re: Best effiecent scripting - by dannyk0ed - 31.07.2012, 03:33
Re: Best effiecent scripting - by ReneG - 31.07.2012, 03:53
Re: Best effiecent scripting - by Jack_Leslie - 31.07.2012, 03:56
Re: Best effiecent scripting - by coole210 - 31.07.2012, 03:56
Re: Best effiecent scripting - by Jack_Leslie - 31.07.2012, 04:01
Re: Best effiecent scripting - by coole210 - 31.07.2012, 04:22
Re: Best effiecent scripting - by JoBullet - 31.07.2012, 05:00
Re: Best effiecent scripting - by CaHbKo - 31.07.2012, 08:40
Re: Best effiecent scripting - by CaHbKo - 31.07.2012, 09:16
Re: Best effiecent scripting - by Sinner - 31.07.2012, 09:31
Re: Best effiecent scripting - by Sniper Kitty - 31.07.2012, 09:32
Re: Best effiecent scripting - by Vince - 31.07.2012, 09:49
Re: Best effiecent scripting - by Jack_Leslie - 31.07.2012, 11:07
Re: Best effiecent scripting - by Slice - 31.07.2012, 11:10
Re: Best effiecent scripting - by Jack_Leslie - 31.07.2012, 11:12
Re: Best effiecent scripting - by IstuntmanI - 31.07.2012, 11:13
Re: Best effiecent scripting - by Slice - 31.07.2012, 11:26
Re: Best effiecent scripting - by Jack_Leslie - 31.07.2012, 11:46
Re: Best effiecent scripting - by Vince - 31.07.2012, 11:52
Re: Best effiecent scripting - by Universal - 31.07.2012, 12:17
Re: Best effiecent scripting - by Jack_Leslie - 31.07.2012, 12:20
Re: Best effiecent scripting - by Slice - 31.07.2012, 12:21
Re: Best effiecent scripting - by SuperViper - 31.07.2012, 16:26
Re: Best effiecent scripting - by The__ - 31.07.2012, 18:08
Re: Best effiecent scripting - by SuperViper - 31.07.2012, 19:05
Re: Best effiecent scripting - by Finn - 31.07.2012, 19:15
Re: Best effiecent scripting - by The__ - 31.07.2012, 19:24
Re: Best effiecent scripting - by Universal - 31.07.2012, 19:36
Re: Best effiecent scripting - by [KHK]Khalid - 02.08.2012, 03:12
Re: Best effiecent scripting - by Y_Less - 02.08.2012, 07:07
Re: Best effiecent scripting - by Ash. - 02.08.2012, 11:29
Re: Best effiecent scripting - by WackoX - 02.08.2012, 12:25
Re: Best effiecent scripting - by Y_Less - 02.08.2012, 14:13
Re: Best effiecent scripting - by [KHK]Khalid - 02.08.2012, 17:00
Re: Best effiecent scripting - by Y_Less - 02.08.2012, 18:44
Re: Best effiecent scripting - by [KHK]Khalid - 02.08.2012, 19:10

Forum Jump:


Users browsing this thread: 1 Guest(s)