y_groups.inc 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. /**--------------------------------------------------------------------------**\
  2. =======================================
  3. y_groups - Player group abstractions!
  4. =======================================
  5. Description:
  6. Admin levels, gangs, teams etc - they're all "groups" of people, this
  7. provides an abstraction for all of these collections.
  8. Legal:
  9. Version: MPL 1.1
  10. The contents of this file are subject to the Mozilla Public License Version
  11. 1.1 (the "License"); you may not use this file except in compliance with
  12. the License. You may obtain a copy of the License at
  13. http://www.mozilla.org/MPL/
  14. Software distributed under the License is distributed on an "AS IS" basis,
  15. WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  16. for the specific language governing rights and limitations under the
  17. License.
  18. The Original Code is the YSI groups include.
  19. The Initial Developer of the Original Code is Alex "Y_Less" Cole.
  20. Portions created by the Initial Developer are Copyright (C) 2011
  21. the Initial Developer. All Rights Reserved.
  22. Contributors:
  23. ZeeX, koolk, JoeBullet/Google63, g_aSlice/Slice
  24. Thanks:
  25. JoeBullet/Google63 - Handy arbitrary ASM jump code using SCTRL.
  26. ZeeX - 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. 1.0
  44. Changelog:
  45. 29/11/10:
  46. First version
  47. \**--------------------------------------------------------------------------**/
  48. #include "..\YSI_Internal\y_version"
  49. #include "..\YSI_Internal\y_compilerpass"
  50. #if AUTO_INCLUDE_GUARD
  51. #if !defined _inc_y_groups
  52. #error Did you do <YSI/y_groups> instead of the required <YSI\y_groups>?
  53. #endif
  54. #undef _inc_y_groups
  55. #endif
  56. #if !defined _INC_y_groups
  57. #include <a_samp>
  58. // Get basic defines.
  59. #include "..\YSI_Internal\y_plugins"
  60. #include "..\YSI_Internal\y_compilerpass"
  61. #include "..\YSI_Data\y_bit"
  62. #if !defined _INC_y_groups__funcs
  63. #define _INC_y_groups__funcs
  64. #include "y_groups/setup"
  65. #include "..\YSI_Internal\y_shortfunc"
  66. #include "..\YSI_Data\y_iterate"
  67. #endif
  68. #include "..\YSI_Server\y_scriptinit"
  69. #include "..\YSI_Data\y_playerarray"
  70. #include "..\YSI_Coding\y_stringhash"
  71. #include "..\YSI_Core\y_debug"
  72. #include "..\YSI_Coding\y_remote"
  73. #include "..\YSI_Storage\y_amx"
  74. #define YSIM_U_DISABLE
  75. #define MASTER 59
  76. #include "..\YSI_Core\y_master"
  77. #include "..\YSI_Internal\y_distribute"
  78. #include "..\YSI_Coding\y_hooks"
  79. #include "y_groups/impl"
  80. #include "..\YSI_Core\y_master"
  81. #endif
  82. #if defined GROUP_LIBRARY_NAME
  83. #if defined GROUP_LIBRARY_SIZE
  84. // Include the generic group code for this new custom group.
  85. // User-inclusion.
  86. #define _GROUP_MAKE_LIMIT GROUP_LIBRARY_SIZE
  87. #define _GROUP_MAKE_NAME GROUP_LIBRARY_NAME
  88. #if defined GROUP_LIBRARY_TAGS
  89. #define _GROUP_MAKE_TAG GROUP_LIBRARY_TAGS
  90. #else
  91. #define _GROUP_MAKE_TAG _
  92. #endif
  93. #include "y_groups\_funcs"
  94. // Now remove the defines.
  95. #if defined GROUP_LIBRARY_TAGS
  96. #undef GROUP_LIBRARY_TAGS
  97. #endif
  98. #undef _GROUP_MAKE_LIMIT
  99. #undef _GROUP_MAKE_NAME
  100. #undef GROUP_LIBRARY_NAME
  101. #undef GROUP_LIBRARY_SIZE
  102. #else
  103. #error You must define both GROUP_LIBRARY_SIZE and GROUP_LIBRARY_NAME.
  104. #endif
  105. #else
  106. #if defined GROUP_LIBRARY_SIZE
  107. #error You must define both GROUP_LIBRARY_SIZE and GROUP_LIBRARY_NAME.
  108. #endif
  109. #endif
  110. // Only include the remainder just once.
  111. #if defined _INC_y_groups
  112. #endinput
  113. #endif
  114. #define _INC_y_groups
  115. stock _YSI_HAS_y_groups(_do_not_call_me_ever_, _like_never_)
  116. {
  117. P:E("You called _YSI_HAS_y_groups! Bad, don't do that!", _do_not_call_me_ever_, _like_never_);
  118. assert(false);
  119. return 0;
  120. }
  121. #if defined YSI_TESTS
  122. #include "..\YSI_Core\y_testing"
  123. #include "y_groups/tests"
  124. #endif