y_groupsecond.inc 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526
  1. /*----------------------------------------------------------------------------*\
  2. =======================================
  3. y_groups - Player group abstractions!
  4. =======================================
  5. Description:
  6. Admin levels, gangs, teams etc - they're all "groups" of people, this
  7. provides an abstraction for all of these collections.
  8. Legal:
  9. Version: MPL 1.1
  10. The contents of this file are subject to the Mozilla Public License Version
  11. 1.1 (the "License"); you may not use this file except in compliance with
  12. the License. You may obtain a copy of the License at
  13. http://www.mozilla.org/MPL/
  14. Software distributed under the License is distributed on an "AS IS" basis,
  15. WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  16. for the specific language governing rights and limitations under the
  17. License.
  18. The Original Code is the YSI group include.
  19. The Initial Developer of the Original Code is Alex "Y_Less" Cole.
  20. Portions created by the Initial Developer are Copyright (C) 2011
  21. the Initial Developer. All Rights Reserved.
  22. Contributors:
  23. ZeeX, koolk, JoeBullet/Google63, g_aSlice/Slice
  24. Thanks:
  25. JoeBullet/Google63 - Handy arbitrary ASM jump code using SCTRL.
  26. ZeeX - Very productive conversations.
  27. koolk - IsPlayerinAreaEx code.
  28. TheAlpha - Danish translation.
  29. breadfish - German translation.
  30. Fireburn - Dutch translation.
  31. yom - French translation.
  32. 50p - Polish translation.
  33. Zamaroht - Spanish translation.
  34. Dracoblue, sintax, mabako, Xtreme, other coders - Producing other modes
  35. for me to strive to better.
  36. Pixels^ - Running XScripters where the idea was born.
  37. Matite - Pestering me to release it and using it.
  38. Very special thanks to:
  39. Thiadmer - PAWN, whose limits continue to amaze me!
  40. Kye/Kalcor - SA:MP.
  41. SA:MP Team past, present and future - SA:MP.
  42. Version:
  43. 1.0
  44. Changelog:
  45. 29/11/10:
  46. First version
  47. \*----------------------------------------------------------------------------*/
  48. #undef _inc_y_groupsecond
  49. // This code, having been updated to use the later version of y_hooks,
  50. // unfortunately no longer has one function spread between two files, which was
  51. // a very unique (required) code feature. However this version should be better
  52. // overall (at least slightly).
  53. #include "..\y_hooks"
  54. /* // This is actually the second half of a function!
  55. //_GROUP_INIT(group);
  56. //_GROUP_MAKE_NAME<Group_...Init>(group);
  57. #if YSIM_HAS_MASTER
  58. #if _YSIM_IS_CLIENT
  59. #else
  60. #if _YSIM_IS_SERVER
  61. _GROUP_OPC_IS_CALLED(playerid);
  62. #else
  63. #if _YSIM_IS_STUB
  64. #error y_groupsecond called with _YSIM_IS_STUB.
  65. #else
  66. _GROUP_OPC_IS_CALLED(playerid);
  67. #endif
  68. #endif
  69. #endif
  70. #else
  71. _GROUP_OPC_IS_CALLED(playerid);
  72. #endif
  73. // This is also NOT a master controlled function as the group master may be
  74. // different to a system using the group system's master.
  75. #pragma tabsize 4
  76. _GROUP_OPC_OTHER_CALLED(playerid);
  77. }
  78. forward _GROUP_OPC_PUBLIC(playerid);*/
  79. // This file contains generic code for setting all the stats to do with a single
  80. // element type. Groups can be defined for any element (classes, objects etc)
  81. // and each one will specialise this file to give different functions.
  82. #if !defined _GROUP_MAKE_NAME
  83. #error Please define _GROUP_MAKE_NAME before including y_groups.
  84. #endif
  85. #if !defined _GROUP_MAKE_LIMIT
  86. #error Please define _GROUP_MAKE_LIMIT before including y_groups.
  87. #endif
  88. // Start of the multi-use file.
  89. static stock
  90. BitArray:_GROUP_GLOBAL_NAME<_GROUP_MAKE_LIMIT>,
  91. BitArray:_GROUP_GROUP_NAME[MAX_GROUPS]<_GROUP_MAKE_LIMIT>,
  92. BitArray:_GROUP_DEFAULTS<_:MAX_GROUPS + 1>,
  93. YSI_g_sNextUpdateFunc,//[32],
  94. YSI_g_sNextInitFunc;/*[32],
  95. bool:YSI_g_sHasOPC = false;*/
  96. // Initialise permissions for a new player based on the default settings. This
  97. // is one of the few places where direct master system intervention is required
  98. // due to the horrible combination of function naming macros.
  99. // TODO: Uncomment when the better y_hooks library is integrated.
  100. ghook OnPlayerConnect(playerid)
  101. {
  102. P:2("ghook OnPlayerConnect called in %d", _@);
  103. for (new j = 0; j != _GROUP_MAKE_LIMIT; ++j)
  104. {
  105. // Set and unset all the global items.
  106. //_GROUP_SET_PLAYER(j, playerid, Bit_Get(_GROUP_GLOBAL_NAME, j));
  107. //P:5(#_GROUP_SET_PLAYER ": Set %d %d %d", j, playerid, Bit_Get(_GROUP_GLOBAL_NAME, j));
  108. _GROUP_MAKE_NAME<Group_UpdatePlayer...>(j, playerid);
  109. }
  110. return 1;
  111. }
  112. /*#if YSIM_HAS_MASTER
  113. #if _YSIM_IS_CLIENT
  114. #define __GF<%0...%1>[%2](%3)<%4> stock _GROUP_MAKE_NAME<%0...%1>(%3)U@(8,YSIM_CALLER,_@),W@(#@#_GROUP_MAKE_NAME<%0...%1>,#%2#x,%4),U@(8,YSIM_CALLER,-1);stock _GROUP_MAKE_NAME<_%0...%1>(%3)
  115. #else
  116. #if _YSIM_IS_SERVER
  117. #define __GF<%0...%1>[%2](%3)<%4> forward _GROUP_MAKE_NAME<@%0...%1>(%3);_GROUP_MAKE_NAME<@%0...%1>(%3)_GROUP_MAKE_NAME<%0...%1>(%4);_GROUP_MAKE_NAME<%0...%1>(%3)
  118. #else
  119. #if _YSIM_IS_STUB
  120. #error y_groupsecond called with _YSIM_IS_STUB.
  121. #else
  122. #define __GF<%0...%1>[%2](%3)<%4> forward _GROUP_MAKE_NAME<@%0...%1>(%3);_GROUP_MAKE_NAME<@%0...%1>(%3)<>{}_GROUP_MAKE_NAME<@%0...%1>(%3)<_YCM:y>_GROUP_MAKE_NAME<%0...%1>(%4);_GROUP_MAKE_NAME<%0...%1>(%3)<>Y@(),W@(#@#_GROUP_MAKE_NAME<%0...%1>,#%2#x,%4),T@();_GROUP_MAKE_NAME<%0...%1>(%3)<_YCM:y>
  123. #endif
  124. #endif
  125. #endif
  126. #else
  127. #define __GF<%0...%1>[%2](%3)<%4> stock _GROUP_MAKE_NAME<%0...%1>(%3)
  128. #endif*/
  129. _GROUP_CREATE(group,idx);
  130. #if !YSIM_HAS_MASTER
  131. _GROUP_CREATE(group,idx)
  132. #elseif _YSIM_IS_CLIENT
  133. // Note: not the same.
  134. stock _GROUP_MAKE_NAME<_yG@Init...>(group,idx)
  135. #elseif _YSIM_IS_SERVER
  136. _GROUP_CREATE(group,idx)
  137. #elseif !_YSIM_IS_STUB
  138. _GROUP_CREATE(group,idx)<>
  139. {
  140. P:2(#_GROUP_MAKE_NAME<@yG_Init...> " called in %d", _@);
  141. if (group == -1)
  142. {
  143. //YSI_g_sHasOPC = funcidx(#_GROUP_OPC_PUBLIC) != -1;
  144. //P:2(#_GROUP_OPC_PUBLIC " does%s exist", YSI_g_sHasOPC ? ("") : ("not"));
  145. /*new
  146. a = AMX_GetPublicPointer(idx >>> 16, YSI_g_sNextUpdateFunc, "@yG_Upd"),
  147. b = AMX_GetPublicPointer(idx & 0xFFFF, YSI_g_sNextInitFunc, "@yG_Init");
  148. if (b)
  149. {
  150. CallLocalFunction(YSI_g_sNextInitFunc, "ii", -1, (a << 16) | b);
  151. }*/
  152. new
  153. a = AMX_GetPublicPointer(idx >>> 16, YSI_g_sNextUpdateFunc, "@yG_Upd"),
  154. b = AMX_GetPublicPointer(idx & 0xFFFF, YSI_g_sNextInitFunc, "@yG_Init");
  155. P:5(#_GROUP_MAKE_NAME<@yG_Init...> ": %d, %d", a, b);
  156. if (b)
  157. {
  158. _Group_ChainCall1((a << 16) | b, YSI_g_sNextInitFunc);
  159. }
  160. }
  161. }
  162. _GROUP_CREATE(group,idx)<_YCM:y>
  163. #endif
  164. {
  165. P:2(#_GROUP_MAKE_NAME<@yG_Init...> " called in %d", _@);
  166. if (group == -1)
  167. {
  168. Bit_SetAll(_GROUP_GLOBAL_NAME, true, bits<_GROUP_MAKE_LIMIT>);
  169. Bit_Let(_GROUP_DEFAULTS, _:MAX_GROUPS);
  170. // Initialise the next item
  171. /*YSI_g_sHasOPC = funcidx(#_GROUP_OPC_PUBLIC) != -1;
  172. P:2(#_GROUP_OPC_PUBLIC " does%s exist", YSI_g_sHasOPC ? ("") : (" not"));*/
  173. new
  174. a = AMX_GetPublicPointer(idx >>> 16, YSI_g_sNextUpdateFunc, "@yG_Upd"),
  175. b = AMX_GetPublicPointer(idx & 0xFFFF, YSI_g_sNextInitFunc, "@yG_Init");
  176. P:5(#_GROUP_MAKE_NAME<@yG_Init...> ": %d, %d", a, b);
  177. if (b)
  178. {
  179. //CallLocalFunction(YSI_g_sNextInitFunc, "ii", -1, (a << 16) | b);
  180. //_Group_ChainCall((a << 16) | b, YSI_g_sNextInitFunc);
  181. a = (a << 16) | b;
  182. #emit PUSH.S a
  183. #emit PUSH.C 0xFFFFFFFF
  184. #emit PUSH.C 8
  185. #emit LCTRL 6
  186. #emit ADD.C 28
  187. #emit PUSH.pri
  188. #emit LOAD.pri YSI_g_sNextInitFunc
  189. #emit SCTRL 6
  190. }
  191. }
  192. else if (group < _:MAX_GROUPS)
  193. {
  194. // This is called when a new group is created, it sets the default default
  195. // values - i.e. sets everything to true.
  196. Bit_SetAll(_GROUP_GROUP_NAME[Group:group], false, bits<_GROUP_MAKE_LIMIT>);
  197. Bit_Vet(_GROUP_DEFAULTS, group);
  198. if (YSI_g_sNextInitFunc)//[0])
  199. {
  200. //CallLocalFunction(YSI_g_sNextInitFunc, "ii", group, -1);
  201. //_Group_ChainCall(group, YSI_g_sNextInitFunc);
  202. #emit PUSH.C 0xFFFFFFFF
  203. #emit PUSH.S group
  204. #emit PUSH.C 8
  205. #emit LCTRL 6
  206. #emit ADD.C 28
  207. #emit PUSH.pri
  208. #emit LOAD.pri YSI_g_sNextInitFunc
  209. #emit SCTRL 6
  210. }
  211. }
  212. }
  213. #if !defined _YSI_GROUPS_FIRST_HALF
  214. forward bool:_GROUP_INITIALISE(x = _GROUP_MAKE_LIMIT);
  215. #endif
  216. stock bool:_GROUP_INITIALISE(x = _GROUP_MAKE_LIMIT) <YSI_has_groups:y>
  217. {
  218. // A new item has been added to the system - update all players according to
  219. // the default settings for a group.
  220. //_GROUP_UPDATE_ALL(_GROUP_LOCAL_NAME);
  221. if (x != _GROUP_MAKE_LIMIT)
  222. {
  223. P:2(#_GROUP_INITIALISE "<YSI_has_groups:y> called in %d", _@);
  224. _GROUP_MAKE_NAME<Group_UpdateAll...>(x, true);
  225. }
  226. return true;
  227. }
  228. // Called to set all players to a new element. Can ignore defaults for
  229. // specialised setups such as classes.
  230. gforeign Group_UpdateAll...(_GROUP_LOCAL_NAME,bool:d);
  231. gglobal Group_UpdateAll...(_GROUP_LOCAL_NAME,bool:d)
  232. {
  233. P:2(#_GROUP_MAKE_NAME<Group_UpdateAll...> " called: %i, %i", _GROUP_LOCAL_NAME, d);
  234. // Set the permissions from the defaults for each groups.
  235. new
  236. s = Bit_Slot(_GROUP_LOCAL_NAME),
  237. Bit:m = Bit_Mask(_GROUP_LOCAL_NAME),
  238. Bit:v = ~m;
  239. if (d)
  240. {
  241. for (new Group:i; i != MAX_GROUPS; ++i)
  242. {
  243. if (Bit_Get(_GROUP_DEFAULTS, i)) _GROUP_GROUP_NAME[i][s] |= m;
  244. else _GROUP_GROUP_NAME[i][s] &= v;
  245. }
  246. // Set the default settings.
  247. if (Bit_Get(_GROUP_DEFAULTS, MAX_GROUPS)) _GROUP_GLOBAL_NAME[s] |= m;
  248. else _GROUP_GLOBAL_NAME[s] &= v;
  249. // Now update all the existing players.
  250. foreach (new i : Player) _GROUP_MAKE_NAME<Group_UpdatePlayer...>(_GROUP_LOCAL_NAME, i);
  251. }
  252. else
  253. {
  254. P:2(#_GROUP_MAKE_NAME<Group_UpdateAll...> " called as 0");
  255. for (new Group:i; i != MAX_GROUPS; ++i) _GROUP_GROUP_NAME[i][s] &= v;
  256. _GROUP_GLOBAL_NAME[s] &= v;
  257. }
  258. return 1;
  259. }
  260. static stock _GROUP_MAKE_NAME<Group_UpdatePlayer...>(_GROUP_LOCAL_NAME,playerid)
  261. {
  262. P:4(#_GROUP_MAKE_NAME<Group_UpdatePlayer...> " called: %i, %i", _GROUP_LOCAL_NAME, playerid);
  263. if (Bit_Get(_GROUP_GLOBAL_NAME, _GROUP_LOCAL_NAME))
  264. {
  265. _GROUP_SET_PLAYER(_GROUP_LOCAL_NAME, playerid, true);
  266. return;
  267. }
  268. new
  269. ps = Bit_Slot(playerid) + 1,
  270. Bit:pm = Bit_Mask(playerid),
  271. es = Bit_Slot(_GROUP_LOCAL_NAME),
  272. Bit:em = Bit_Mask(_GROUP_LOCAL_NAME);
  273. for (new Group:i; i != MAX_GROUPS; ++i)
  274. {
  275. if (_Group_IsActive(i) && YSI_gGroupPlayers[i][ps] & pm && _GROUP_GROUP_NAME[i][es] & em)
  276. //if (Group_IsActive(i) && Group_HasPlayer(i, playerid) && Bit_Get(_GROUP_GROUP_NAME[i], _GROUP_LOCAL_NAME))
  277. {
  278. _GROUP_SET_PLAYER(_GROUP_LOCAL_NAME, playerid, true);
  279. return;
  280. }
  281. }
  282. _GROUP_SET_PLAYER(_GROUP_LOCAL_NAME, playerid, false);
  283. }
  284. _GROUP_UPDATE_PLAYER(playerid, group, set);
  285. #if !YSIM_HAS_MASTER
  286. _GROUP_UPDATE_PLAYER(playerid, group, set)
  287. #elseif _YSIM_IS_CLIENT
  288. // Note: not the same.
  289. stock _GROUP_MAKE_NAME<_yG@Upd...>(playerid, group, set)
  290. #elseif _YSIM_IS_SERVER
  291. _GROUP_UPDATE_PLAYER(playerid, group, set)
  292. #elseif !_YSIM_IS_STUB
  293. _GROUP_UPDATE_PLAYER(playerid, group, set)<>
  294. {
  295. if (YSI_g_sNextUpdateFunc)
  296. {
  297. /*#emit PUSH.S set
  298. #emit PUSH.S group
  299. #emit PUSH.S playerid
  300. #emit PUSH.C 12
  301. #emit LCTRL 6
  302. #emit ADD.C 28
  303. #emit PUSH.pri
  304. #emit LOAD.pri YSI_g_sNextUpdateFunc
  305. #emit SCTRL 6*/
  306. _Group_ChainCall2(set, group, playerid, YSI_g_sNextUpdateFunc);
  307. }
  308. /*if (YSI_g_sNextUpdateFunc[0])
  309. {
  310. CallLocalFunction(YSI_g_sNextUpdateFunc, "iii", playerid, group, set);
  311. }*/
  312. }
  313. _GROUP_UPDATE_PLAYER(playerid, group, set)<_YCM:y>
  314. #endif
  315. {
  316. if (set)
  317. {
  318. // Joined a group - add everything they will need.
  319. for (new j = 0; j != _GROUP_MAKE_LIMIT; ++j)
  320. {
  321. if (Bit_Get(_GROUP_GROUP_NAME[Group:group], j))
  322. {
  323. _GROUP_SET_PLAYER(j, playerid, true);
  324. }
  325. }
  326. }
  327. else
  328. {
  329. // Left a group - full update. Also used on group destruction.
  330. for (new j = 0; j != _GROUP_MAKE_LIMIT; ++j)
  331. {
  332. _GROUP_MAKE_NAME<Group_UpdatePlayer...>(j, playerid);
  333. }
  334. }
  335. if (YSI_g_sNextUpdateFunc)
  336. {
  337. #emit PUSH.S set
  338. #emit PUSH.S group
  339. #emit PUSH.S playerid
  340. #emit PUSH.C 12
  341. #emit LCTRL 6
  342. #emit ADD.C 28
  343. #emit PUSH.pri
  344. #emit LOAD.pri YSI_g_sNextUpdateFunc
  345. #emit SCTRL 6
  346. }
  347. }
  348. gforeign Group_Set...Default(Group:g,bool:s);
  349. gglobal Group_Set...Default(Group:g,bool:s)
  350. {
  351. P:2(#_GROUP_MAKE_NAME<Group_Set...Default> " called: %i, %i", _:g, s);
  352. GROUP_FIX(g);
  353. if (g == GROUP_GLOBAL & ~GROUP_MASK)
  354. {
  355. _GROUP_MAKE_NAME<Group_SetGlobal...Default>(s);
  356. }
  357. else if (_Group_IsValid(g))
  358. {
  359. Bit_SetAll(_GROUP_GROUP_NAME[g], s, bits<_GROUP_MAKE_LIMIT>);
  360. if (s)
  361. {
  362. Bit_Let(_GROUP_DEFAULTS, _:g);
  363. foreach (new i : Player)
  364. {
  365. if (_Group_HasPlayer(g, i))
  366. {
  367. for (new j = 0; j != _GROUP_MAKE_LIMIT; ++j)
  368. {
  369. _GROUP_SET_PLAYER(j, i, true);
  370. }
  371. }
  372. }
  373. }
  374. else
  375. {
  376. Bit_Vet(_GROUP_DEFAULTS, _:g);
  377. foreach (new i : Player)
  378. {
  379. if (_Group_HasPlayer(g, i))
  380. {
  381. for (new j = 0; j != _GROUP_MAKE_LIMIT; ++j)
  382. {
  383. _GROUP_MAKE_NAME<Group_UpdatePlayer...>(j, i);
  384. }
  385. }
  386. }
  387. }
  388. }
  389. return 1;
  390. }
  391. gforeign Group_SetGlobal...Default(bool:s);
  392. gglobal Group_SetGlobal...Default(bool:s)
  393. {
  394. P:2(#_GROUP_MAKE_NAME<Group_SetGlobal...Default> " called: %i", s);
  395. Bit_SetAll(_GROUP_GLOBAL_NAME, s, bits<_GROUP_MAKE_LIMIT>);
  396. if (s)
  397. {
  398. Bit_Let(_GROUP_DEFAULTS, _:MAX_GROUPS);
  399. foreach (new i : Player)
  400. {
  401. for (new j = 0; j != _GROUP_MAKE_LIMIT; ++j)
  402. {
  403. _GROUP_SET_PLAYER(j, i, true);
  404. }
  405. }
  406. }
  407. else
  408. {
  409. Bit_Vet(_GROUP_DEFAULTS, _:MAX_GROUPS);
  410. foreach (new i : Player)
  411. {
  412. for (new j = 0; j != _GROUP_MAKE_LIMIT; ++j)
  413. {
  414. _GROUP_MAKE_NAME<Group_UpdatePlayer...>(j, i);
  415. }
  416. }
  417. }
  418. return 1;
  419. }
  420. gforeign Group_SetGlobal...(_GROUP_LOCAL_NAME,bool:s);
  421. gglobal Group_SetGlobal...(_GROUP_LOCAL_NAME,bool:s)
  422. {
  423. P:2(#_GROUP_MAKE_NAME<Group_SetGlobal...> " called: %i, %i", _GROUP_LOCAL_NAME, s);
  424. // Set wether the global group can use this item.
  425. //Bit_Set(_GROUP_GLOBAL_NAME, _GROUP_LOCAL_NAME, set, bits<_GROUP_MAKE_LIMIT>);
  426. if (s)
  427. {
  428. Bit_Let(_GROUP_GLOBAL_NAME, _GROUP_LOCAL_NAME);
  429. foreach (new i : Player)
  430. {
  431. _GROUP_SET_PLAYER(_GROUP_LOCAL_NAME, i, true);
  432. }
  433. }
  434. else
  435. {
  436. Bit_Vet(_GROUP_GLOBAL_NAME, _GROUP_LOCAL_NAME);
  437. foreach (new i : Player)
  438. {
  439. _GROUP_MAKE_NAME<Group_UpdatePlayer...>(_GROUP_LOCAL_NAME, i);
  440. }
  441. }
  442. return 1;
  443. }
  444. gforeign Group_Set...(Group:g,_GROUP_LOCAL_NAME,bool:s);
  445. gglobal Group_Set...(Group:g,_GROUP_LOCAL_NAME,bool:s)
  446. {
  447. P:2(#_GROUP_MAKE_NAME<Group_Set...> " called: %i, %i, %i", _:g, _GROUP_LOCAL_NAME, s);
  448. // Set wether a group can use this item.
  449. if (0 <= _GROUP_LOCAL_NAME < _GROUP_MAKE_LIMIT)
  450. {
  451. GROUP_FIX(g);
  452. if (g == GROUP_GLOBAL & ~GROUP_MASK)
  453. {
  454. //_GROUP_GLOBAL_FUNC(_GROUP_LOCAL_NAME, set);
  455. _GROUP_MAKE_NAME<Group_SetGlobal...>(_GROUP_LOCAL_NAME, s);
  456. }
  457. else if (_Group_IsValid(g))
  458. {
  459. //Bit_Set(_GROUP_GROUP_NAME[group], _GROUP_LOCAL_NAME, set, bits<_GROUP_MAKE_LIMIT>);
  460. if (s)
  461. {
  462. Bit_Let(_GROUP_GROUP_NAME[g], _GROUP_LOCAL_NAME);
  463. foreach (new i : Player)
  464. {
  465. if (_Group_HasPlayer(g, i))
  466. {
  467. _GROUP_SET_PLAYER(_GROUP_LOCAL_NAME, i, true);
  468. }
  469. }
  470. }
  471. else
  472. {
  473. Bit_Vet(_GROUP_GROUP_NAME[g], _GROUP_LOCAL_NAME);
  474. foreach (new i : Player)
  475. {
  476. if (_Group_HasPlayer(g, i))
  477. {
  478. //_GROUP_UPDATE(_GROUP_LOCAL_NAME, i);
  479. _GROUP_MAKE_NAME<Group_UpdatePlayer...>(_GROUP_LOCAL_NAME, i);
  480. }
  481. }
  482. }
  483. }
  484. }
  485. return 1;
  486. }
  487. //#undef __GF