y_lock_entry.inc 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. #if defined _INC_y_lock
  2. #endinput
  3. #endif
  4. #define _INC_y_lock
  5. /*
  6. Legal:
  7. Version: MPL 1.1
  8. The contents of this file are subject to the Mozilla Public License Version
  9. 1.1 the "License"; you may not use this file except in compliance with
  10. the License. You may obtain a copy of the License at
  11. http://www.mozilla.org/MPL/
  12. Software distributed under the License is distributed on an "AS IS" basis,
  13. WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  14. for the specific language governing rights and limitations under the
  15. License.
  16. The Original Code is the YSI framework.
  17. The Initial Developer of the Original Code is Alex "Y_Less" Cole.
  18. Portions created by the Initial Developer are Copyright C 2011
  19. the Initial Developer. All Rights Reserved.
  20. Contributors:
  21. Y_Less
  22. koolk
  23. JoeBullet/Google63
  24. g_aSlice/Slice
  25. Misiur
  26. samphunter
  27. tianmeta
  28. maddinat0r
  29. spacemud
  30. Crayder
  31. Dayvison
  32. Ahmad45123
  33. Zeex
  34. irinel1996
  35. Yiin-
  36. Chaprnks
  37. Konstantinos
  38. Masterchen09
  39. Southclaws
  40. PatchwerkQWER
  41. m0k1
  42. paulommu
  43. udan111
  44. Thanks:
  45. JoeBullet/Google63 - Handy arbitrary ASM jump code using SCTRL.
  46. ZeeX - Very productive conversations.
  47. koolk - IsPlayerinAreaEx code.
  48. TheAlpha - Danish translation.
  49. breadfish - German translation.
  50. Fireburn - Dutch translation.
  51. yom - French translation.
  52. 50p - Polish translation.
  53. Zamaroht - Spanish translation.
  54. Los - Portuguese translation.
  55. Dracoblue, sintax, mabako, Xtreme, other coders - Producing other modes for
  56. me to strive to better.
  57. Pixels^ - Running XScripters where the idea was born.
  58. Matite - Pestering me to release it and using it.
  59. Very special thanks to:
  60. Thiadmer - PAWN, whose limits continue to amaze me!
  61. Kye/Kalcor - SA:MP.
  62. SA:MP Team past, present and future - SA:MP.
  63. Optional plugins:
  64. Gamer_Z - GPS.
  65. Incognito - Streamer.
  66. Me - sscanf2, fixes2, Whirlpool.
  67. */
  68. #if defined _INC_y_utils
  69. #error YSI\y_lock must be the first include if you want to use it.
  70. #endif
  71. #if defined _DEBUG
  72. #if _DEBUG >= 1
  73. #define y_lock%0; _DoYLock(%0);
  74. #else
  75. #define y_lock%0; _DoYLock();
  76. #endif
  77. #else
  78. #define y_lock%0; _DoYLock();
  79. #endif
  80. #if !defined BIND_IP
  81. #if defined Y_LOCK_IP
  82. #define BIND_IP MAKE_LOCK_IP(Y_LOCK_IP)
  83. #else
  84. #define BIND_IP MAKE_LOCK_IP(127.0.0.1)
  85. #endif
  86. #endif
  87. // MASSIVE reliance on operator precedence here!
  88. #define MAKE_LOCK_IP(%0.%1.%2.%3) ((%0&0xFF)<<24|(%1&0xFF)<<16|(%2&0xFF)<<8|%3&0xFF)
  89. #define _LOCK_IP_0 (BIND_IP>>>24)
  90. #define _LOCK_IP_1 (BIND_IP>>>16&0xFF)
  91. #define _LOCK_IP_2 (BIND_IP>>>8&0xFF)
  92. #define _LOCK_IP_3 (BIND_IP&0xFF)
  93. #define UNHOOK for(from=AMX_HEADER_PUBLICS;from!=AMX_HEADER_NATIVES;from+= 8)AMX_Write(from,-1);
  94. #if _LOCK_IP_0 == 0
  95. #define _LOCK_LEN_0 1
  96. #else
  97. #define _LOCK_LEN_0 _LOCK_IP_0
  98. #endif
  99. #if _LOCK_IP_1 == 0
  100. #define _LOCK_LEN_1 1
  101. #else
  102. #define _LOCK_LEN_1 _LOCK_IP_1
  103. #endif
  104. #if _LOCK_IP_2 == 0
  105. #define _LOCK_LEN_2 1
  106. #else
  107. #define _LOCK_LEN_2 _LOCK_IP_2
  108. #endif
  109. #if _LOCK_IP_3 == 0
  110. #define _LOCK_LEN_3 1
  111. #else
  112. #define _LOCK_LEN_3 _LOCK_IP_3
  113. #endif
  114. #define YSI_LOCK_MODE
  115. #include "..\..\YSI_Core\y_utils"
  116. #include "..\..\YSI_Coding\y_hooks"
  117. _DoYLock(P:C(from);)
  118. {
  119. new
  120. arr[][] =
  121. {
  122. ";23#w",
  123. "32g2"
  124. };
  125. P:1("%d", from);
  126. #pragma unused arr
  127. #if !defined _DEBUG || _DEBUG < 1
  128. new from;
  129. #endif
  130. UNHOOK
  131. }