1
0

y_hooks.inc 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*----------------------------------------------------------------------------*\
  2. ==============================
  3. y_hooks - Hook any callback!
  4. ==============================
  5. Description:
  6. Automatically hooks any callbacks with a very simple syntax.
  7. Legal:
  8. Version: MPL 1.1
  9. The contents of this file are subject to the Mozilla Public License Version
  10. 1.1 (the "License"); you may not use this file except in compliance with
  11. the License. You may obtain a copy of the License at
  12. http://www.mozilla.org/MPL/
  13. Software distributed under the License is distributed on an "AS IS" basis,
  14. WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  15. for the specific language governing rights and limitations under the
  16. License.
  17. The Original Code is the SA:MP callback hooks include.
  18. The Initial Developer of the Original Code is Alex "Y_Less" Cole.
  19. Portions created by the Initial Developer are Copyright (C) 2008
  20. the Initial Developer. All Rights Reserved.
  21. Contributors:
  22. ZeeX, koolk, JoeBullet/Google63, g_aSlice/Slice
  23. Thanks:
  24. JoeBullet/Google63 - Handy arbitrary ASM jump code using SCTRL.
  25. Peter, Cam - Support.
  26. ZeeX, g_aSlice/Slice, Popz, others - Very productive conversations.
  27. koolk - IsPlayerinAreaEx code.
  28. TheAlpha - Danish translation.
  29. breadfish - German translation.
  30. Fireburn - Dutch translation.
  31. yom - French translation.
  32. 50p - Polish translation.
  33. Zamaroht - Spanish translation.
  34. Dracoblue, sintax, mabako, Xtreme, other coders - Producing other modes
  35. for me to strive to better.
  36. Pixels^ - Running XScripters where the idea was born.
  37. Matite - Pestering me to release it and using it.
  38. Very special thanks to:
  39. Thiadmer - PAWN, whose limits continue to amaze me!
  40. Kye/Kalcor - SA:MP.
  41. SA:MP Team past, present and future - SA:MP.
  42. Version:
  43. 2.0
  44. Changelog:
  45. 25/02/12:
  46. Extracted most of the code to a separate file.
  47. 17/03/11:
  48. Second complete re-write using another new technique. Now VERY fast!
  49. Updated OnPlayerUpdate code using Google63's SCTRL jump code.
  50. 06/08/10:
  51. First version
  52. \*----------------------------------------------------------------------------*/
  53. #if !defined _inc_y_hooks
  54. #error Did you do <YSI/y_hooks> instead of the required <YSI\y_hooks>?
  55. #endif
  56. #undef _inc_y_hooks
  57. // Multiple includes!
  58. #include "internal\y_unique"
  59. #if defined _INC_y_hooks
  60. #endinput
  61. #endif
  62. // Everything except including "y_unique" is done once only.
  63. #define _INC_y_hooks
  64. #include "internal\y_dohooks"