y_properties.inc 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. /**
  2. * <library name="y_properties">
  3. * <section>
  4. * Description
  5. * </section>
  6. * Handles properties and other common features for some modes.
  7. * <section>
  8. * Version
  9. * </section>
  10. * 0.1
  11. * <section>
  12. * Functions
  13. * </section>
  14. * <subsection>
  15. * Public
  16. * </subsection><ul>
  17. * <symbol name="Property_Loop">Does the main system processing.</symbol>
  18. * <symbol name="Property_AddPropRemote">Adds a property from another script.</symbol>
  19. * <symbol name="Property_AddBankRemote">Adds a bank from another script.</symbol>
  20. * <symbol name="Property_AddAmmuRemote">Adds an ammunation from another script.</symbol>
  21. * <symbol name="Property_AddMARemote">Adds a money area from another script.</symbol>
  22. * <symbol name="Property_AddMPRemote">Adds a money point from another script.</symbol>
  23. * <symbol name="Property_AddTeleRemote">Adds a teleport from another script.</symbol>
  24. * <symbol name="Property_AddFobRemote">Adds a forbidden area from another script.</symbol>
  25. * <symbol name="Property_GetPropertyBitsReceive">Passes a player's properties.</symbol>
  26. * <symbol name="Property_Remote">Remote wrapper for most minor functions.</symbol>
  27. * <symbol name="YSIM_Properties">Master system callback.</symbol>
  28. * <symbol name="Property_Broadcast">Called to save properties on master shutdown.</symbol>
  29. * <symbol name="Property_PickupTimeCheck">Checks if a player is still stood on a pickup.</symbol>
  30. * </ul><subsection>
  31. * Core
  32. * </subsection><ul>
  33. * <symbol name="Property_OnPlayerSelectedMenuRow">Called when someone selects something.</symbol>
  34. * <symbol name="Property_OnPlayerExitedMenu">Called when someone exits a menu.</symbol>
  35. * <symbol name="Property_OnPlayerEnterCheckpointEx">Called when someone enters a checkpoint (public).</symbol>
  36. * <symbol name="Property_OnPlayerLeaveCheckpointEx">Called when someone leaves a checkpoint (public).</symbol>
  37. * <symbol name="Property_OnPlayerPickUpPickup">Called when someone picks up a pickup (public).</symbol>
  38. * <symbol name="Property_OnPlayerSpawn">Called when someone spawns.</symbol>
  39. * <symbol name="Property_OnPlayerConnect">Called when comaone connects.</symbol>
  40. * <symbol name="Property_OnPlayerLeaveArea">Called when someone leaves an area (public).</symbol>
  41. * <symbol name="Property_OnPlayerEnterArea">Called when someone enters an area (public).</symbol>
  42. * </ul><subsection>
  43. * Stock
  44. * </subsection><ul>
  45. * <symbol name="Property_GetPlayerPropCount">Gets the number of properties for a player.</symbol>
  46. * <symbol name="Property_GetLink">Gets the area or checkpoint for a property.</symbol>
  47. * <symbol name="Property_GetType">Gets a property's type.</symbol>
  48. * <symbol name="Property_IsValid">Checks if a property is valid.</symbol>
  49. * <symbol name="Property_Bank">Moves money to/from an account.</symbol>
  50. * <symbol name="Property_SavePlayerWeapon">Saves a players weapon for spawn.</symbol>
  51. * <symbol name="Property_SaveWeapons">Saves a player's spawn weapons.</symbol>
  52. * <symbol name="Property_LoadWeapons">Loads a player's spawn weapons.</symbol>
  53. * <symbol name="Property_SaveBank">Saves a player's banked money.</symbol>
  54. * <symbol name="Property_LoadBank">Loads a player's banked money.</symbol>
  55. * <symbol name="Property_GetBank">Gets a player's banked money.</symbol>
  56. * <symbol name="Property_GetSlotWeapon">Gets a player's spawn weapons.</symbol>
  57. * <symbol name="Property_GetPropertyBits">Gets a player's owned properties.</symbol>
  58. * <symbol name="Property_SetRebuyDelay">Set a delay on rebuying properties.</symbol>
  59. * </ul><subsection>
  60. * Static
  61. * </subsection><ul>
  62. * <symbol name="Property_GetWeapon">Gets weapon data for a slotid slot.</symbol>
  63. * <symbol name="Property_WeaponName">Gets a weapon name for a slotid.</symbol>
  64. * <symbol name="Property_GetWeaponFromSlot">Gets a weaponid from a slotid.</symbol>
  65. * <symbol name="Property_GenerateAmmuMenu">Generates the menu for ammunation.</symbol>
  66. * </ul><subsection>
  67. * Inline
  68. * </subsection><ul>
  69. * <symbol name="Property_SetOption">Sets a property's custom flag.</symbol>
  70. * <symbol name="Property_IsActive">Checks if a property is active.</symbol>
  71. * <symbol name="Property_GetOption">Gets a property's custom flag.</symbol>
  72. * <symbol name="Property_GivePlayerWeapon">Gives a player a weapon from it's slot.</symbol>
  73. * <symbol name="Property_WeaponCost">Gets the cost of a slot,</symbol>
  74. * <symbol name="Property_WeaponAmmo">Gets the ammo of a slot.</symbol>
  75. * <symbol name="Property_IsPlayerProperty">Checks if a player can have a property.</symbol>
  76. * </ul><subsection>
  77. * API
  78. * </subsection><ul>
  79. * <symbol name="CreateProperty">Creates a business.</symbol>
  80. * <symbol name="CreateBank">Creates a bank.</symbol>
  81. * <symbol name="CreateAmmunation">Creates an ammunation.</symbol>
  82. * <symbol name="CreateMoneyArea">Creates a money area.</symbol>
  83. * <symbol name="CreateMoneyPoint">Creates a money point.</symbol>
  84. * <symbol name="CreateTeleport">Creates a teleport.</symbol>
  85. * <symbol name="CreateForbiddenArea">Creates a forbidden area.</symbol>
  86. * <symbol name="DestroyProperty">Deletes a property from the array.</symbol>
  87. * </ul><section>
  88. * Definitions
  89. * </section><ul>
  90. * <symbol name="PROPERTY_LOOP_GRANULARITY">Number of itterations of the main loop a second.</symbol>
  91. * <symbol name="MAX_PROP_NAME">Max length of the name of a property.</symbol>
  92. * <symbol name="MAX_PROPERTIES">Max number of properties.</symbol>
  93. * <symbol name="NO_PROPERTY">Invalid return.</symbol>
  94. * <symbol name="WEAPON_ARMOUR">Type for salling armour at ammunation.</symbol>
  95. * <symbol name="PROPERTY_SELL_PERCENT">% of money got back for a reduced sale.</symbol>
  96. * </ul><section>
  97. * Enums
  98. * </section><ul>
  99. * e_PROP_FLAGS - Flags for property data.
  100. * E_PROP_DATA - Data for a property.
  101. * E_PROP_AMMU - Data for a persons current ammunation menu.
  102. * <unnamed> - Tagless remote instructions, must have new ones added to the end.
  103. * </ul><section>
  104. * Macros
  105. * </section><ul>
  106. * <symbol name="WEAPON_DATA_OFFSET">Offset for saving weapons with variable size arrays,</symbol>
  107. * <symbol name="WEAPON_DATA">Gets ammo and cost from parameters and compresses them.</symbol>
  108. * <symbol name="WEAPON_DATA_REM">Like WEAPON_DATA but reads from an array instead.</symbol>
  109. * <symbol name="WEAPON">Saves a weapon id in the top byte of a cell.</symbol>
  110. * </ul><section>
  111. * Tags
  112. * </section><ul>
  113. * <symbol name="e_PROP_FLAGS">Flags.</symbol>
  114. * </ul><section>
  115. * Variables
  116. * </section>
  117. * <subsection>
  118. * Static
  119. * </subsection><ul>
  120. * <symbol name="YSI_g_sProperties">Array of all property data.</symbol>
  121. * <symbol name="YSI_g_sMoney">Array of player's banked money.</symbol>
  122. * <symbol name="YSI_g_sPlayerProperties">Bit array of properties a player has.</symbol>
  123. * <symbol name="YSI_g_sSpawnWeapons">Array of weapons a player will spawn with.</symbol>
  124. * <symbol name="YSI_g_sShopMenu">Array of players current menus.</symbol>
  125. * <symbol name="YSI_g_sAreaPointers">Array of properties for each area.</symbol>
  126. * <symbol name="YSI_g_sCheckpointPointers">Array of properties for each checkpoint.</symbol>
  127. * <symbol name="YSI_g_sTempPropReq">Script has requested a player's properties.</symbol>
  128. * <symbol name="YSI_g_sTempProp">Temporary store for properties.</symbol>
  129. * <symbol name="YSI_g_sIsMaster">Is this script the global master.</symbol>
  130. * </ul><section>
  131. * Commands
  132. * </section><ul>
  133. * <symbol name="buy">Lets you buy your current property.</symbol>
  134. * <symbol name="bank">Lets you bank money.</symbol>
  135. * <symbol name="properties">Lists properties and their owners.</symbol>
  136. * <symbol name="balance">Displays your current balance.</symbol>
  137. * <symbol name="withdraw">Allows you to take out money.</symbol>
  138. * <symbol name="sell">Allows you to sell a property.</symbol>
  139. * </ul><section>
  140. * Properties
  141. * </section><ul>
  142. * <symbol name="LReqProp">Return data from a remote script.</symbol>
  143. * <symbol name="110953013">Return properties for a player.</symbol>
  144. * </ul>
  145. * </library>
  146. *//** *//*
  147. Legal:
  148. Version: MPL 1.1
  149. The contents of this file are subject to the Mozilla Public License Version
  150. 1.1 the "License"; you may not use this file except in compliance with
  151. the License. You may obtain a copy of the License at
  152. http://www.mozilla.org/MPL/
  153. Software distributed under the License is distributed on an "AS IS" basis,
  154. WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  155. for the specific language governing rights and limitations under the
  156. License.
  157. The Original Code is the YSI framework.
  158. The Initial Developer of the Original Code is Alex "Y_Less" Cole.
  159. Portions created by the Initial Developer are Copyright C 2011
  160. the Initial Developer. All Rights Reserved.
  161. Contributors:
  162. Y_Less
  163. koolk
  164. JoeBullet/Google63
  165. g_aSlice/Slice
  166. Misiur
  167. samphunter
  168. tianmeta
  169. maddinat0r
  170. spacemud
  171. Crayder
  172. Dayvison
  173. Ahmad45123
  174. Zeex
  175. irinel1996
  176. Yiin-
  177. Chaprnks
  178. Konstantinos
  179. Masterchen09
  180. Southclaws
  181. PatchwerkQWER
  182. m0k1
  183. paulommu
  184. udan111
  185. Thanks:
  186. JoeBullet/Google63 - Handy arbitrary ASM jump code using SCTRL.
  187. ZeeX - Very productive conversations.
  188. koolk - IsPlayerinAreaEx code.
  189. TheAlpha - Danish translation.
  190. breadfish - German translation.
  191. Fireburn - Dutch translation.
  192. yom - French translation.
  193. 50p - Polish translation.
  194. Zamaroht - Spanish translation.
  195. Los - Portuguese translation.
  196. Dracoblue, sintax, mabako, Xtreme, other coders - Producing other modes for
  197. me to strive to better.
  198. Pixels^ - Running XScripters where the idea was born.
  199. Matite - Pestering me to release it and using it.
  200. Very special thanks to:
  201. Thiadmer - PAWN, whose limits continue to amaze me!
  202. Kye/Kalcor - SA:MP.
  203. SA:MP Team past, present and future - SA:MP.
  204. Optional plugins:
  205. Gamer_Z - GPS.
  206. Incognito - Streamer.
  207. Me - sscanf2, fixes2, Whirlpool.
  208. */
  209. #if !defined _INC_y_properties
  210. #tryinclude "y_properties\y_properties_entry"
  211. #endif
  212. #if !defined _INC_y_properties
  213. #tryinclude "YSI_Visual\y_properties\y_properties_entry"
  214. #endif
  215. #if !defined _INC_y_properties
  216. #tryinclude "YSI\YSI_Visual\y_properties\y_properties_entry"
  217. #endif
  218. #if !defined _INC_y_properties
  219. #tryinclude <YSI_Visual\y_properties\y_properties_entry>
  220. #endif
  221. #if !defined _INC_y_properties
  222. #tryinclude <YSI\YSI_Visual\y_properties\y_properties_entry>
  223. #endif
  224. #if !defined _INC_y_properties
  225. #error Could not find y_properties
  226. #endif