Advertisement
whiplk

[Include] JPD - Processador de dialogs, easy and fast(v1)

May 10th, 2012
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.64 KB | None | 0 0
  1. /******************************************************************************\
  2. |                                                                              |
  3. |                       [Include] - Processador de Dialogs                     |
  4. |                             By Jeffrey_Hatrix                                |
  5. |                   Special thanks to: SlashPT  &  Willian_Luigi               |
  6. |                                                                              |
  7. \******************************************************************************/
  8. // [22/06/2013] - Atualizado por Willian Luigi
  9. //JD processor, simples, fácil e rápido.
  10.  
  11. #define msgbox DIALOG_STYLE_MSGBOX
  12. #define input DIALOG_STYLE_INPUT
  13. #define list DIALOG_STYLE_LIST
  14. #define pass DIALOG_STYLE_PASSWORD
  15.  
  16. #if !defined isnull
  17.     #define isnull(%1) \
  18.                 ((!(%1[0])) || (((%1[0]) == '\1') && (!(%1[1]))))
  19. #endif
  20.  
  21. #define addDialogHandler(%0) \
  22.     forward callDialog_%0(playerid, response, listitem, inputtext[]); \
  23.     public callDialog_%0(playerid, response, listitem, inputtext[])
  24.  
  25. #define Dialog:%0(%1,%2,%3,%4) \
  26.     forward callDialog_%0(%1,%2,%3,%4); \
  27.     public callDialog_%0(%1,%2,%3,%4)
  28.  
  29.  
  30. static CALL_DIALOG [ 24 ] ;
  31.  
  32. public OnDialogResponse ( playerid , dialogid , response , listitem , inputtext [] )
  33. {
  34.     if ( dialogid ) format ( CALL_DIALOG , 24 , "callDialog_%d" , dialogid ) ;
  35.     return ( ( funcidx ( CALL_DIALOG ) != -1 ) ? ( CallLocalFunction ( CALL_DIALOG , "ddds" , playerid , response , listitem , isnull( inputtext ) ? ( "\1" ) : ( inputtext ) ) ) : ( 0 ) ) ;
  36. }
  37.  
  38. // =================================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement