1
0

y_races.inc 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. #if defined _INC_y_races
  2. #endinput
  3. #endif
  4. #define _INC_y_races
  5. /**
  6. * <library name="y_races">
  7. * <section>
  8. * Description
  9. * </section>
  10. * Create, manage, and run races.
  11. * <section>
  12. * Version
  13. * </section>
  14. * 2.0
  15. * </library>
  16. *//** *//*
  17. Legal:
  18. Version: MPL 1.1
  19. The contents of this file are subject to the Mozilla Public License Version
  20. 1.1 the "License"; you may not use this file except in compliance with
  21. the License. You may obtain a copy of the License at
  22. http://www.mozilla.org/MPL/
  23. Software distributed under the License is distributed on an "AS IS" basis,
  24. WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  25. for the specific language governing rights and limitations under the
  26. License.
  27. The Original Code is the YSI framework.
  28. The Initial Developer of the Original Code is Alex "Y_Less" Cole.
  29. Portions created by the Initial Developer are Copyright C 2011
  30. the Initial Developer. All Rights Reserved.
  31. Contributors:
  32. Y_Less
  33. koolk
  34. JoeBullet/Google63
  35. g_aSlice/Slice
  36. Misiur
  37. samphunter
  38. tianmeta
  39. maddinat0r
  40. spacemud
  41. Crayder
  42. Dayvison
  43. Ahmad45123
  44. Zeex
  45. irinel1996
  46. Yiin-
  47. Chaprnks
  48. Konstantinos
  49. Masterchen09
  50. Southclaws
  51. PatchwerkQWER
  52. m0k1
  53. paulommu
  54. udan111
  55. Thanks:
  56. JoeBullet/Google63 - Handy arbitrary ASM jump code using SCTRL.
  57. ZeeX - Very productive conversations.
  58. koolk - IsPlayerinAreaEx code.
  59. TheAlpha - Danish translation.
  60. breadfish - German translation.
  61. Fireburn - Dutch translation.
  62. yom - French translation.
  63. 50p - Polish translation.
  64. Zamaroht - Spanish translation.
  65. Los - Portuguese translation.
  66. Dracoblue, sintax, mabako, Xtreme, other coders - Producing other modes for
  67. me to strive to better.
  68. Pixels^ - Running XScripters where the idea was born.
  69. Matite - Pestering me to release it and using it.
  70. Very special thanks to:
  71. Thiadmer - PAWN, whose limits continue to amaze me!
  72. Kye/Kalcor - SA:MP.
  73. SA:MP Team past, present and future - SA:MP.
  74. Optional plugins:
  75. Gamer_Z - GPS.
  76. Incognito - Streamer.
  77. Me - sscanf2, fixes2, Whirlpool.
  78. */
  79. #include "..\YSI_Internal\y_compilerdata"
  80. #if !defined YSI_NO_RACE_POSITION && !defined RACE_POSITION
  81. #define RACE_POSITION
  82. #endif
  83. #if defined YSI_TESTS
  84. #define _Y_RACES_STATIC
  85. #else
  86. #define _Y_RACES_STATIC static
  87. #endif
  88. #include "..\YSI_Players\y_text"
  89. #include "..\YSI_Data\y_bit"
  90. #include "..\YSI_Data\y_iterate"
  91. #include "..\YSI_Data\y_playerarray"
  92. #if defined RACE_POSITION
  93. #include "..\YSI_Coding\y_timers"
  94. #endif
  95. #if !defined MAX_RACES
  96. #define MAX_RACES 16
  97. #endif
  98. #define YSIM_U_DISABLE
  99. #define MASTER 53
  100. #include "..\YSI_Core\y_master"
  101. #define _GROUP_MAKE_NAME<%0...%1> %0Race%1
  102. #define _GROUP_MAKE_LIMIT MAX_RACES
  103. #include "..\YSI_Players\y_groups\_funcs"
  104. #include "..\YSI_Coding\y_hooks"
  105. stock _YSI_HAS_y_races(_do_not_call_me_ever_, _like_never_)
  106. {
  107. P:E("You called _YSI_HAS_y_races! Bad, don't do that!", _do_not_call_me_ever_, _like_never_);
  108. assert(false);
  109. return 0;
  110. }
  111. forward Race_Create(laps = 0, entry = 0, countdown = 3, bool:arial = false, bool:fixedPrize = true, exitTime = 0, interior = 0, world = 0, bool:restart = false);
  112. forward Race_Destroy(slot, bool:refund = false);
  113. foreign Race_AddCheckpoint(raceid, Float:x, Float:y, Float:z);
  114. foreign Race_AddStart(raceid, Float:x, Float:y, Float:z, Float:a);
  115. foreign void:Race_SetFixedWin(raceid, set);
  116. foreign void:Race_SetRestart(raceid, set);
  117. foreign void:Race_SetArial(raceid, set);
  118. foreign void:Race_SetCountdown(raceid, countdown);
  119. foreign void:Race_SetInterior(raceid, interior);
  120. foreign void:Race_SetWorld(raceid, world);
  121. foreign void:Race_SetPrize(raceid, position, amount);
  122. foreign void:Race_SetExitTime(raceid, time);
  123. foreign Race_IsActive(raceid);
  124. foreign void:Race_SetLaps(raceid, laps);
  125. foreign void:Race_SetEntry(raceid, cost);
  126. foreign Race_GetPlayerExitedTime(playerid);
  127. foreign Race_PlayerJoin(playerid, race);
  128. forward Race_PlayerLeave(playerid, bool:refund = false);
  129. foreign Race_Start(race);
  130. foreign Race_GetPlayerPosition(playerid);
  131. foreign Race_GetPlayerRaceTime(playerid);
  132. foreign Race_GetPlayerRace(playerid);
  133. foreign Race_SetPlayer(race, playerid, bool:set);
  134. #include "y_races/impl"
  135. #if defined YSI_TESTS
  136. #include "..\YSI_Core\y_testing"
  137. #include "y_races/tests"
  138. // Get some new IDs.
  139. #endif
  140. #undef _GROUP_MAKE_LIMIT
  141. #undef _GROUP_MAKE_NAME
  142. #include "..\YSI_Core\y_master"