1
0

y_classes.inc 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. #if defined _INC_y_classes
  2. #endinput
  3. #endif
  4. #define _INC_y_classes
  5. /**
  6. * <library name="y_classes">
  7. * <section>
  8. * Description
  9. * </section>
  10. * Allows greater control over classes so not everyone has every class. Uses
  11. * a form of compression for locations.
  12. * <section>
  13. * Version
  14. * </section>
  15. * 0.1
  16. * <section>
  17. * Functions
  18. * </section>
  19. * <subsection>
  20. * Public
  21. * </subsection><ul>
  22. * <symbol name="Class_AddRemote">Adds a class to the remote master.</symbol>
  23. * <symbol name="Class_Remote">Updates settings remotely.</symbol>
  24. * </ul><subsection>
  25. * Core
  26. * </subsection><ul>
  27. * <symbol name="Class_Class">Sets up the system.</symbol>
  28. * <symbol name="Class_OnPlayerRequestSpawn">Called when a player requests a spawn.</symbol>
  29. * <symbol name="Class_OnPlayerRequestClass">Called when a player requests a class.</symbol>
  30. * <symbol name="Class_OnPlayerConnect">Called when a player connects.</symbol>
  31. * </ul><subsection>
  32. * Stock
  33. * </subsection><ul>
  34. * <symbol name="Class_Delete">Removes a class.</symbol>
  35. * <symbol name="Class_SetPlayer">Sets whether or not a player can use a class.</symbol>
  36. * <symbol name="Class_Disable">Disables a class.</symbol>
  37. * <symbol name="Class_Enable">Enables a disabled class.</symbol>
  38. * <symbol name="Class_AddForGroup">Adds a class to the system for only one group.</symbol>
  39. * <symbol name="Class_Add">Adds a class to the system.</symbol>
  40. * <symbol name="Class_AddEx">Adds a class to the system with group selection and setting.</symbol>
  41. * <symbol name="Class_AddWithGroupSet">Adds a class and sets their group on selection.</symbol>
  42. * <symbol name="Class_AllowReselection">Allows or disallows people to return to reselect a class.</symbol>
  43. * <symbol name="Class_RequireSpawnLogin">Require people to login before spawning.</symbol>
  44. * <symbol name="Class_RequireSelectionLogin">Require people to login before selecting.</symbol>
  45. * <symbol name="Class_RequireSelectionReg">Require people to register before selecting.</symbol>
  46. * <symbol name="Class_RequireSpawnReg">Require people to register before spawning.</symbol>
  47. * </ul><subsection>
  48. * Static
  49. * </subsection><ul>
  50. * <symbol name="Class_AddClass">Adds a class, wrapped by API and remote functions.</symbol>
  51. * </ul><subsection>
  52. * Inline
  53. * </subsection><ul>
  54. * <symbol name="Class_IsActive">Checks a class is active.</symbol>
  55. * <symbol name="Class_Enabled">Checks a class is enabled.</symbol>
  56. * <symbol name="Class_IsValid">Checks a class is valid.</symbol>
  57. * <symbol name="Class_X">Gets a classes x position.</symbol>
  58. * <symbol name="Class_Y">Gets a classes y position.</symbol>
  59. * <symbol name="Class_Z">Gets a classes z position.</symbol>
  60. * <symbol name="Class_A">Gets a classes angle.</symbol>
  61. * <symbol name="Class_Skin">Gets a classes skin.</symbol>
  62. * </ul><section>
  63. * Definitions
  64. * </section><ul>
  65. * <symbol name="MAX_CLASSES">Maximum number of classes storeable by the system.</symbol>
  66. * <symbol name="CLASS_LEFT">Flag for last internal class viewed.</symbol>
  67. * <symbol name="CLASS_MIDDLE">Flag for last internal class viewed.</symbol>
  68. * <symbol name="CLASS_RIGHT">Flag for last internal class viewed.</symbol>
  69. * </ul><section>
  70. * Enums
  71. * </section><ul>
  72. * <symbol name="e_CLASS_FLAGS">Small data for individual classes.</symbol>
  73. * <symbol name="E_CLASS">Class data structure.</symbol>
  74. * </ul><section>
  75. * Variables
  76. * </section>
  77. * <subsection>
  78. * Static
  79. * </subsection><ul>
  80. * <symbol name="YSI_g_sClasses">Data for classes.</symbol>
  81. * <symbol name="YSI_g_sPlayerClass">Player's current classes.</symbol>
  82. * <symbol name="YSI_g_sLeft">Handle for the first internal class.</symbol>
  83. * <symbol name="YSI_g_sMiddle">Handle for the second internal class.</symbol>
  84. * <symbol name="YSI_g_sRight">Handle for the third internal class.</symbol>
  85. * <symbol name="YSI_g_sClassCount">Number of classes stored.</symbol>
  86. * </ul>
  87. * </library>
  88. *//** *//*
  89. Legal:
  90. Version: MPL 1.1
  91. The contents of this file are subject to the Mozilla Public License Version
  92. 1.1 the "License"; you may not use this file except in compliance with
  93. the License. You may obtain a copy of the License at
  94. http://www.mozilla.org/MPL/
  95. Software distributed under the License is distributed on an "AS IS" basis,
  96. WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  97. for the specific language governing rights and limitations under the
  98. License.
  99. The Original Code is the YSI framework.
  100. The Initial Developer of the Original Code is Alex "Y_Less" Cole.
  101. Portions created by the Initial Developer are Copyright C 2011
  102. the Initial Developer. All Rights Reserved.
  103. Contributors:
  104. Y_Less
  105. koolk
  106. JoeBullet/Google63
  107. g_aSlice/Slice
  108. Misiur
  109. samphunter
  110. tianmeta
  111. maddinat0r
  112. spacemud
  113. Crayder
  114. Dayvison
  115. Ahmad45123
  116. Zeex
  117. irinel1996
  118. Yiin-
  119. Chaprnks
  120. Konstantinos
  121. Masterchen09
  122. Southclaws
  123. PatchwerkQWER
  124. m0k1
  125. paulommu
  126. udan111
  127. Thanks:
  128. JoeBullet/Google63 - Handy arbitrary ASM jump code using SCTRL.
  129. ZeeX - Very productive conversations.
  130. koolk - IsPlayerinAreaEx code.
  131. TheAlpha - Danish translation.
  132. breadfish - German translation.
  133. Fireburn - Dutch translation.
  134. yom - French translation.
  135. 50p - Polish translation.
  136. Zamaroht - Spanish translation.
  137. Los - Portuguese translation.
  138. Dracoblue, sintax, mabako, Xtreme, other coders - Producing other modes for
  139. me to strive to better.
  140. Pixels^ - Running XScripters where the idea was born.
  141. Matite - Pestering me to release it and using it.
  142. Very special thanks to:
  143. Thiadmer - PAWN, whose limits continue to amaze me!
  144. Kye/Kalcor - SA:MP.
  145. SA:MP Team past, present and future - SA:MP.
  146. Optional plugins:
  147. Gamer_Z - GPS.
  148. Incognito - Streamer.
  149. Me - sscanf2, fixes2, Whirlpool.
  150. */
  151. #include "..\YSI_Internal\y_compilerdata"
  152. stock _YSI_HAS_y_classes(_do_not_call_me_ever_, _like_never_)
  153. {
  154. P:E("You called _YSI_HAS_y_classes! Bad, don't do that!", _do_not_call_me_ever_, _like_never_);
  155. assert(false);
  156. return 0;
  157. }
  158. #include "..\YSI_Internal\y_version"
  159. #if !defined MAX_CLASSES
  160. #define MAX_CLASSES (512)
  161. #endif
  162. #if !defined MAX_CLASS_SPAWN_WEAPONS
  163. #define MAX_CLASS_SPAWN_WEAPONS (13)
  164. #endif
  165. #if !defined WEAPON_ARMOUR
  166. #define WEAPON_ARMOUR (100)
  167. #endif
  168. #define INFINATE_ARMOUR (0x00800000)
  169. #define MASTER 61
  170. #define YSIM_U_DISABLE
  171. #include "..\YSI_Core\y_master"
  172. #include "..\YSI_Data\y_bit"
  173. #include "..\YSI_Core\y_debug"
  174. #include "..\YSI_Data\y_iterate"
  175. #include "..\YSI_Data\y_playerarray"
  176. #include "..\YSI_Data\y_iterate"
  177. #include "..\YSI_Internal\y_natives"
  178. #define _GROUP_MAKE_NAME<%0...%1> %0Class%1
  179. #define _GROUP_MAKE_LIMIT MAX_CLASSES
  180. #include "..\YSI_Players\y_groups\_funcs"
  181. //#include "..\YSI_Players\y_groups\y_classes"
  182. #include "..\YSI_Coding\y_hooks"
  183. #include "y_classes/classcontrol"
  184. #include "..\YSI_Coding\y_hooks"
  185. #include "y_classes/multiclass"
  186. #if defined YSI_TESTS
  187. #include "..\YSI_Core\y_testing"
  188. #include "y_classes/tests"
  189. #endif
  190. #if defined _INC_y_groups
  191. #include "y_classes/classgroups"
  192. #endif
  193. // Reset.
  194. #undef _GROUP_MAKE_LIMIT
  195. #undef _GROUP_MAKE_NAME
  196. #include "..\YSI_Core\y_master"