y_areas.inc 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. /**
  2. * <library name="y_areas">
  3. * <section>
  4. * Description
  5. * </section>
  6. * Handles area checks for player location based code not involving CPs.
  7. * <section>
  8. * Version
  9. * </section>
  10. * 0.3
  11. * <section>
  12. * Functions
  13. * </section>
  14. * <subsection>
  15. * Public
  16. * </subsection><ul>
  17. * <symbol name="Area_Loop">Main loop for checking who's where.</symbol>
  18. * <symbol name="Area_Remote">Does minor functions remotely.</symbol>
  19. * <symbol name="Area_AddRemote">Adds areas remotely.</symbol>
  20. * <symbol name="YSIM_Areas">Master system interface.</symbol>
  21. * <symbol name="Area_Broadcast">Recieves transmitted areas.</symbol>
  22. * <symbol name="Area_UpdateEmpty">Resets the empty array after master change.</symbol>
  23. * </ul><subsection>
  24. * Core
  25. * </subsection><ul>
  26. * <symbol name="Area_Area">Constructor.</symbol>
  27. * <symbol name="Area_CheckArea">Gets an area's type anx calls the relevant function.</symbol>
  28. * <symbol name="Area_OnPlayerConnect">Called when a player connects.</symbol>
  29. * </ul><subsection>
  30. * Stock
  31. * </subsection><ul>
  32. * <symbol name="Area_Delete">Deletes an area.</symbol>
  33. * <symbol name="Area_AddCube">Adds a cube.</symbol>
  34. * <symbol name="Area_AddBox">Adds a box.</symbol>
  35. * <symbol name="Area_AddCircle">Adds a circle.</symbol>
  36. * <symbol name="Area_AddSphere">Adds a sphere.</symbol>
  37. * <symbol name="Area_AddPoly">Adds a polygon.</symbol>
  38. * <symbol name="Area_GetPlayerArea">Gets the area a player is in.</symbol>
  39. * <symbol name="Area_SetPlayer">Sets wether a player can use this area.</symbol>
  40. * <symbol name="Area_SetAllPlayers">Sets wether all players can use this area.</symbol>
  41. * <symbol name="Area_SetAllWorlds">Sets wether all worlds have this are.</symbol>
  42. * <symbol name="Area_SetWorld">Sets wether this world has this area.</symbol>
  43. * <symbol name="Area_IsValid">Checks if an area is valid.</symbol>
  44. * </ul><subsection>
  45. * Static
  46. * </subsection><ul>
  47. * <symbol name="Area_IsInCircle">Checks if a player is in this circular area.</symbol>
  48. * <symbol name="Area_IsInSphere">Checks if a player is in this spherical area.</symbol>
  49. * <symbol name="Area_IsInPoly">Checks if a player is in this polygonal area.</symbol>
  50. * <symbol name="Area_IsInCube">Checks if a player is in this cubic area.</symbol>
  51. * <symbol name="Area_IsInBox">Checks if a player is in this rectangular area.</symbol>
  52. * <symbol name="Area_AddToUnused">Adds a area pointer to the unused list.</symbol>
  53. * <symbol name="Area_GetFreeSlot">Gets the next free area slot.</symbol>
  54. * </ul><subsection>
  55. * Inline
  56. * </subsection><ul>
  57. * <symbol name="Area_IsActive">Checks if an area is active.</symbol>
  58. * <symbol name="Area_GetEmptySlotCount">Gets the number of empty slots.</symbol>
  59. * <symbol name="Area_AddSlots">Removes slots from the unused count.</symbol>
  60. * </ul><section>
  61. * Callbacks
  62. * </section><ul>
  63. * <symbol name="OnPlayerEnterArea">Called when a player enters an area.</symbol>
  64. * <symbol name="OnPlayerLeaveArea">Called when a player leaves an area.</symbol>
  65. * </ul><section>
  66. * Definitions
  67. * </section><ul>
  68. * <symbol name="MAX_AREAS">Max number of areas.</symbol>
  69. * <symbol name="NO_AREA">Fail return.</symbol>
  70. * <symbol name="AREA_NO_NEXT">Marker for end of a list.</symbol>
  71. * <symbol name="AREA_WORLDS">Number of worlds an area can be in.</symbol>
  72. * <symbol name="AREA_WORLD_COUNT">Number of cells required for a bit array of AREA_WORLDS.</symbol>
  73. * </ul><section>
  74. * Enums
  75. * </section><ul>
  76. * <symbol name="e_AREA_FLAGS">Flags for each area.</symbol>
  77. * <symbol name="E_AREA">Structure for part of an areas data.</symbol>
  78. * </ul><section>
  79. * Variables
  80. * </section>
  81. * <subsection>
  82. * Static
  83. * </subsection><ul>
  84. * <symbol name="YSI_g_sUnusedAreas">Pointer to the first unused area.</symbol>
  85. * <symbol name="YSI_g_sLastUnused">Pointer to the last unused area.</symbol>
  86. * <symbol name="YSI_g_sFreeCount">Number of unused slots.</symbol>
  87. * <symbol name="YSI_g_sAreas">Array of area data.</symbol>
  88. * <symbol name="YSI_g_sPlayerArea">Array of players' current areas.</symbol>
  89. * </ul>
  90. * </library>
  91. *//** *//*
  92. Legal:
  93. Version: MPL 1.1
  94. The contents of this file are subject to the Mozilla Public License Version
  95. 1.1 the "License"; you may not use this file except in compliance with
  96. the License. You may obtain a copy of the License at
  97. http://www.mozilla.org/MPL/
  98. Software distributed under the License is distributed on an "AS IS" basis,
  99. WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  100. for the specific language governing rights and limitations under the
  101. License.
  102. The Original Code is the YSI framework.
  103. The Initial Developer of the Original Code is Alex "Y_Less" Cole.
  104. Portions created by the Initial Developer are Copyright C 2011
  105. the Initial Developer. All Rights Reserved.
  106. Contributors:
  107. Y_Less
  108. koolk
  109. JoeBullet/Google63
  110. g_aSlice/Slice
  111. Misiur
  112. samphunter
  113. tianmeta
  114. maddinat0r
  115. spacemud
  116. Crayder
  117. Dayvison
  118. Ahmad45123
  119. Zeex
  120. irinel1996
  121. Yiin-
  122. Chaprnks
  123. Konstantinos
  124. Masterchen09
  125. Southclaws
  126. PatchwerkQWER
  127. m0k1
  128. paulommu
  129. udan111
  130. Thanks:
  131. JoeBullet/Google63 - Handy arbitrary ASM jump code using SCTRL.
  132. ZeeX - Very productive conversations.
  133. koolk - IsPlayerinAreaEx code.
  134. TheAlpha - Danish translation.
  135. breadfish - German translation.
  136. Fireburn - Dutch translation.
  137. yom - French translation.
  138. 50p - Polish translation.
  139. Zamaroht - Spanish translation.
  140. Los - Portuguese translation.
  141. Dracoblue, sintax, mabako, Xtreme, other coders - Producing other modes for
  142. me to strive to better.
  143. Pixels^ - Running XScripters where the idea was born.
  144. Matite - Pestering me to release it and using it.
  145. Very special thanks to:
  146. Thiadmer - PAWN, whose limits continue to amaze me!
  147. Kye/Kalcor - SA:MP.
  148. SA:MP Team past, present and future - SA:MP.
  149. Optional plugins:
  150. Gamer_Z - GPS.
  151. Incognito - Streamer.
  152. Me - sscanf2, fixes2, Whirlpool.
  153. */
  154. #if !defined _INC_y_areas
  155. #tryinclude "y_areas\y_areas_entry"
  156. #endif
  157. #if !defined _INC_y_areas
  158. #tryinclude "YSI_Visual\y_areas\y_areas_entry"
  159. #endif
  160. #if !defined _INC_y_areas
  161. #tryinclude "YSI\YSI_Visual\y_areas\y_areas_entry"
  162. #endif
  163. #if !defined _INC_y_areas
  164. #tryinclude <YSI_Visual\y_areas\y_areas_entry>
  165. #endif
  166. #if !defined _INC_y_areas
  167. #tryinclude <YSI\YSI_Visual\y_areas\y_areas_entry>
  168. #endif
  169. #if !defined _INC_y_areas
  170. #error Could not find y_areas
  171. #endif