Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- .................................
- RDLG
- Reliable/Fast Dialog Processor
- .................................
- Description:
- This is a little include that uses OnPlayerDialogResponse( ) to process players Dialogs.
- Each dialog has his own function like the Command Processors( ZCMD, DCMD, YCMD ),
- such method is much faster than the normal way.
- License:
- The contents of this file are subject to the Mozilla Public License Version
- 1.1 (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
- http://www.mozilla.org/MPL/
- */
- #tryinclude <YSI\y_hooks>
- #if defined _rdlg_included
- #endinput
- #endif
- #define _rdlg_included
- #define DIALOG:%1(%2) \
- forward dlg_%1(%2); \
- public dlg_%1(%2)
- #define DLG:%1(%2) \
- DIALOG:%1(%2)
- #if !defined isnull
- #define isnull(%1) \
- ((!(%1[0])) || (((%1[0]) == '\1') && (!(%1[1]))))
- #endif
- new s_g_Dialog[ 25 ];
- #if defined _INC_y_hooks
- Hook:RDLG_OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] )
- #else
- public OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] )
- #endif
- {
- new _D[ 10 ]; valstr( _D, dialogid, true );
- strcat( s_g_Dialog, "dlg_" );
- strcat( s_g_Dialog, _D );
- //if( inputtext[ 0 ] == '\0' ) return CallLocalFunction( s_g_Dialog, "iiis", playerid, response, listitem, "\1" );
- return CallLocalFunction( s_g_Dialog, "iiis", playerid, response, listitem, ( inputtext[ 0 ] == '\0' ) ? ( "\1" ) : ( inputtext ) );
- }
- #if !defined _INC_y_hooks
- #if defined _ALS_OnDialogResponse
- #undef OnDialogResponse
- #else
- #define _ALS_OnDialogResponse
- #endif
- #define OnDialogResponse rdlg_OnDialogResponse
- forward rdlg_OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] );
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement