Advertisement
Guest User

Untitled

a guest
Aug 2nd, 2015
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.15 KB | None | 0 0
  1. #define format_query( mysql_format(database, query, sizeof query,
  2.  
  3. #define min(%0,%1) ((%0)<(%1)?(%0):(%1))
  4. #define max(%0,%1) ((%0)>(%1)?(%0):(%1))
  5.  
  6. #define F:%0(%1) (format(_@ifb[%0], sizeof _@ifb[], %1), _@ifb[%0])
  7.  
  8. #define strset strcpy
  9.  
  10. #if defined INVALID_TEXT_DRAW
  11. #undef INVALID_TEXT_DRAW
  12. #endif
  13. #define INVALID_TEXT_DRAW (Text:(0xFFFF))
  14. #define INVALID_PLAYER_TEXT_DRAW (PlayerText:(0xFFFF))
  15.  
  16. /*
  17. * Static variable initialized once with a non-constant value.
  18. *
  19. * Example:
  20. * static slots =: GetMaxPlayers();
  21. */
  22. #define static%1=:%2; static %1;%1=%2;
  23. #define statix%1=:%2; static %1;{static _@init;if(!_@init){_@init=1;(%1)=%2;}}
  24.  
  25. /*
  26. * XYZ0(ar) -> ar[0], ar[1], ar[2]
  27. *
  28. * Example:
  29. * new Float:pos[3];
  30. * GetPlayerPos(playerid, XYZ0(pos));
  31. */
  32. #define XYZ0(%1) %1[0],%1[1],%1[2]
  33. #define XYZR0(%1) %1[0],%1[1],%1[2],%1[3]
  34.  
  35. /*
  36. * XYZ0(ar) -> ar[X], ar[Y], ar[Z]
  37. *
  38. * Same as above, but for enums with keys X, Y, Z, and optionally Rot.
  39. */
  40. #define XYZ(%1) %1[X],%1[Y],%1[Z]
  41. #define XYZR(%1) %1[X],%1[Y],%1[Z],%1[Rot]
  42.  
  43. /*
  44. * Compile-time duration.
  45. *
  46. * Example:
  47. * DURATION(1 hour, 20 minutes) -> 4800
  48. */
  49. #define DURATION_MS(%1) (DURATION(%1) * 1000)
  50. #define DURATION(%1) (DURATION_PT:%1,0)
  51. #define DURATION_PT:%1, (%1:DURATION)+_:DURATION_PT:
  52.  
  53. #define second%1:DURATION
  54. #define seconds%1:DURATION
  55. #define minute%1:DURATION * DURATION_MINUTE
  56. #define minutes%1:DURATION * DURATION_MINUTE
  57. #define hour%1:DURATION * DURATION_HOUR
  58. #define hours%1:DURATION * DURATION_HOUR
  59. #define day%1:DURATION * DURATION_DAY
  60. #define days%1:DURATION * DURATION_DAY
  61. #define week%1:DURATION * DURATION_WEEK
  62. #define weeks%1:DURATION * DURATION_WEEK
  63. #define month%1:DURATION * DURATION_MONTH
  64. #define months%1:DURATION * DURATION_MONTH
  65. #define year%1:DURATION * DURATION_YEAR
  66. #define years%1:DURATION * DURATION_YEAR
  67.  
  68. /*
  69. * Shows dialog for a player
  70. *
  71. * Shows dialog and resets dialog text buffer.
  72. */
  73. #define dialogShow(%0) Dialog_ShowCallback(%0); g_DialogText[0] = EOS
  74. #define dialog_Input YSI_g_sDialogCallFix
  75. #define dialog_Row(%0) if(strfind(dialog_Input,%0) != -1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement