y_groups.inc 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. /* *
  2. * *
  3. * _____ ______ ______ ____ ______ _ ______ __ ______ ____ _____ *
  4. * / ____| ____| ____| | _ \| ____| | / __ \ \ / / | ____/ __ \| __ \ *
  5. * | (___ | |__ | |__ | |_) | |__ | | | | | \ \ /\ / / | |__ | | | | |__) | *
  6. * \___ \| __| | __| | _ <| __| | | | | | |\ \/ \/ / | __|| | | | _ / *
  7. * ____) | |____| |____ | |_) | |____| |___| |__| | \ /\ / | | | |__| | | \ \ *
  8. * |_____/|______|______| |____/|______|______\____/ \/ \/ |_| \____/|_| \_\ *
  9. * *
  10. * _____ ____ _____ _ _ __ __ ______ _ _ _______ _______ _____ ____ _ _ *
  11. * | __ \ / __ \ / ____| | | | \/ | ____| \ | |__ __|/\|__ __|_ _/ __ \| \ | | *
  12. * | | | | | | | | | | | | \ / | |__ | \| | | | / \ | | | || | | | \| | *
  13. * | | | | | | | | | | | | |\/| | __| | . ` | | | / /\ \ | | | || | | | . ` | *
  14. * | |__| | |__| | |____| |__| | | | | |____| |\ | | |/ ____ \| | _| || |__| | |\ | *
  15. * |_____/ \____/ \_____|\____/|_| |_|______|_| \_| |_/_/ \_\_| |_____\____/|_| \_| *
  16. * *
  17. * This is required for technical reasons - to place it after `#endinput` to not generate *
  18. * multiple copies of it in XML when compiling with `-r`. *
  19. * *
  20. *//*
  21. Legal:
  22. Version: MPL 1.1
  23. The contents of this file are subject to the Mozilla Public License Version
  24. 1.1 the "License"; you may not use this file except in compliance with
  25. the License. You may obtain a copy of the License at
  26. http://www.mozilla.org/MPL/
  27. Software distributed under the License is distributed on an "AS IS" basis,
  28. WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  29. for the specific language governing rights and limitations under the
  30. License.
  31. The Original Code is the YSI framework.
  32. The Initial Developer of the Original Code is Alex "Y_Less" Cole.
  33. Portions created by the Initial Developer are Copyright C 2011
  34. the Initial Developer. All Rights Reserved.
  35. Contributors:
  36. Y_Less
  37. koolk
  38. JoeBullet/Google63
  39. g_aSlice/Slice
  40. Misiur
  41. samphunter
  42. tianmeta
  43. maddinat0r
  44. spacemud
  45. Crayder
  46. Dayvison
  47. Ahmad45123
  48. Zeex
  49. irinel1996
  50. Yiin-
  51. Chaprnks
  52. Konstantinos
  53. Masterchen09
  54. Southclaws
  55. PatchwerkQWER
  56. m0k1
  57. paulommu
  58. udan111
  59. Thanks:
  60. JoeBullet/Google63 - Handy arbitrary ASM jump code using SCTRL.
  61. ZeeX - Very productive conversations.
  62. koolk - IsPlayerinAreaEx code.
  63. TheAlpha - Danish translation.
  64. breadfish - German translation.
  65. Fireburn - Dutch translation.
  66. yom - French translation.
  67. 50p - Polish translation.
  68. Zamaroht - Spanish translation.
  69. Los - Portuguese translation.
  70. Dracoblue, sintax, mabako, Xtreme, other coders - Producing other modes for
  71. me to strive to better.
  72. Pixels^ - Running XScripters where the idea was born.
  73. Matite - Pestering me to release it and using it.
  74. Very special thanks to:
  75. Thiadmer - PAWN, whose limits continue to amaze me!
  76. Kye/Kalcor - SA:MP.
  77. SA:MP Team past, present and future - SA:MP.
  78. Optional plugins:
  79. Gamer_Z - GPS.
  80. Incognito - Streamer.
  81. Me - sscanf2, fixes2, Whirlpool.
  82. */
  83. #include "..\YSI_Internal\y_version"
  84. #if defined _inc_y_groups
  85. #undef _inc_y_groups
  86. #endif
  87. #if !defined _INC_y_groups
  88. #include <a_samp>
  89. // Get basic defines.
  90. #include "..\YSI_Internal\y_plugins"
  91. #include "..\YSI_Internal\y_compilerdata"
  92. #include "..\YSI_Data\y_bit"
  93. #if !defined _INC_y_groups__funcs
  94. #define _INC_y_groups__funcs
  95. #include "y_groups/setup"
  96. #include "..\YSI_Internal\y_shortfunc"
  97. #include "..\YSI_Data\y_iterate"
  98. #endif
  99. #include "..\YSI_Server\y_scriptinit"
  100. #include "..\YSI_Data\y_playerarray"
  101. #include "..\YSI_Coding\y_stringhash"
  102. #include "..\YSI_Core\y_debug"
  103. #include "..\YSI_Coding\y_remote"
  104. #include "..\YSI_Storage\y_amx"
  105. #define YSIM_U_DISABLE
  106. #define MASTER 59
  107. #include "..\YSI_Core\y_master"
  108. #include "..\YSI_Internal\y_distribute"
  109. #include "..\YSI_Coding\y_hooks"
  110. #include "y_groups/impl"
  111. #include "..\YSI_Core\y_master"
  112. #endif
  113. #if defined GROUP_LIBRARY_NAME
  114. #if defined GROUP_LIBRARY_SIZE
  115. // Include the generic group code for this new custom group.
  116. // User-inclusion.
  117. #define _GROUP_MAKE_LIMIT GROUP_LIBRARY_SIZE
  118. #define _GROUP_MAKE_NAME GROUP_LIBRARY_NAME
  119. #if defined GROUP_LIBRARY_TAGS
  120. #define _GROUP_MAKE_TAG GROUP_LIBRARY_TAGS
  121. #else
  122. #define _GROUP_MAKE_TAG _
  123. #endif
  124. #include "y_groups\_funcs"
  125. // Now remove the defines.
  126. #if defined GROUP_LIBRARY_TAGS
  127. #undef GROUP_LIBRARY_TAGS
  128. #endif
  129. #undef _GROUP_MAKE_LIMIT
  130. #undef _GROUP_MAKE_NAME
  131. #undef GROUP_LIBRARY_NAME
  132. #undef GROUP_LIBRARY_SIZE
  133. #else
  134. #error You must define both GROUP_LIBRARY_SIZE and GROUP_LIBRARY_NAME.
  135. #endif
  136. #else
  137. #if defined GROUP_LIBRARY_SIZE
  138. #error You must define both GROUP_LIBRARY_SIZE and GROUP_LIBRARY_NAME.
  139. #endif
  140. #endif
  141. // Only include the remainder just once.
  142. #if defined _INC_y_groups
  143. #endinput
  144. #endif
  145. #define _INC_y_groups
  146. #if defined _INC_y_classes
  147. #include "..\YSI_Visual\y_classes/classgroups"
  148. #endif
  149. /**
  150. * <library name="y_groups">
  151. * <section>
  152. * Description
  153. * </section>
  154. * Admin levels, gangs, teams etc - they're all "groups" of people, this
  155. * provides an abstraction for all of these collections.
  156. * <section>
  157. * Version
  158. * </section>
  159. * 1.0
  160. * </library>
  161. *//** */
  162. stock _YSI_HAS_y_groups(_do_not_call_me_ever_, _like_never_)
  163. {
  164. P:E("You called _YSI_HAS_y_groups! Bad, don't do that!", _do_not_call_me_ever_, _like_never_);
  165. assert(false);
  166. return 0;
  167. }
  168. #if defined YSI_TESTS
  169. #include "..\YSI_Core\y_testing"
  170. #include "y_groups/tests"
  171. #endif