groups.inc 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /**--------------------------------------------------------------------------**\
  2. =======================================
  3. y_races - Group settings
  4. =======================================
  5. Description:
  6. -
  7. Legal:
  8. Version: MPL 1.1
  9. The contents of this file are subject to the Mozilla Public License Version
  10. 1.1 (the "License"); you may not use this file except in compliance with
  11. the License. You may obtain a copy of the License at
  12. http://www.mozilla.org/MPL/
  13. Software distributed under the License is distributed on an "AS IS" basis,
  14. WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  15. for the specific language governing rights and limitations under the
  16. License.
  17. The Original Code is the YSI classgroups include.
  18. The Initial Developer of the Original Code is Alex "Y_Less" Cole.
  19. Portions created by the Initial Developer are Copyright (C) 2011
  20. the Initial Developer. All Rights Reserved.
  21. Contributors:
  22. ZeeX, koolk, JoeBullet/Google63, g_aSlice/Slice
  23. Thanks:
  24. JoeBullet/Google63 - Handy arbitrary ASM jump code using SCTRL.
  25. ZeeX - Very productive conversations.
  26. koolk - IsPlayerinAreaEx code.
  27. TheAlpha - Danish translation.
  28. breadfish - German translation.
  29. Fireburn - Dutch translation.
  30. yom - French translation.
  31. 50p - Polish translation.
  32. Zamaroht - Spanish translation.
  33. Dracoblue, sintax, mabako, Xtreme, other coders - Producing other modes
  34. for me to strive to better.
  35. Pixels^ - Running XScripters where the idea was born.
  36. Matite - Pestering me to release it and using it.
  37. Very special thanks to:
  38. Thiadmer - PAWN, whose limits continue to amaze me!
  39. Kye/Kalcor - SA:MP.
  40. SA:MP Team past, present and future - SA:MP.
  41. Version:
  42. 1.0
  43. Changelog:
  44. 28/03/13:
  45. First version
  46. \**--------------------------------------------------------------------------**/
  47. stock Races_SetupGroups() <YSI_has_groups:y>
  48. {
  49. Group_SetGlobalRaceDefault(false);
  50. // This already is the default.
  51. //Group_SetRaceDefault(false);
  52. }
  53. stock Races_ResolveGroups(class, Group:forgroup, bool:cp) <YSI_has_groups:y>
  54. {
  55. P:2("Class_ResolveGroups<y>: call Resolve %d %d %d", class, _:forgroup, cp);
  56. if (cp)
  57. {
  58. // Here "class" means "playerid".
  59. Group_SetPlayer(forgroup, class, true);
  60. }
  61. else
  62. {
  63. P:7("Class_ResolveGroups<y>: Enable this class: %d For: %d", class, _:forgroup);
  64. // Only enable this class for one group.
  65. //Group_UpdateAllClass(class, false);
  66. //Group_SetClass(forgroup, class, true);
  67. /*#if !(YSIM_HAS_MASTER && (_YSIM_IS_CLIENT || _YSIM_IS_STUB))
  68. _yGIClass(-1, 2, _:forgroup);
  69. Class_InitialiseFromGroups(el);
  70. _yGIClass(-1, 3, _:forgroup);
  71. #endif
  72. GROUP_ADD<forgroup>
  73. {
  74. // el.
  75. }*/
  76. if (forgroup == Group:-1) Group_ExclusiveClass(GROUP_GLOBAL, class);
  77. else Group_ExclusiveClass(forgroup, class);
  78. }
  79. }