once.inc 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639
  1. /*
  2. Legal:
  3. Version: MPL 1.1
  4. The contents of this file are subject to the Mozilla Public License Version
  5. 1.1 the "License"; you may not use this file except in compliance with
  6. the License. You may obtain a copy of the License at
  7. http://www.mozilla.org/MPL/
  8. Software distributed under the License is distributed on an "AS IS" basis,
  9. WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  10. for the specific language governing rights and limitations under the
  11. License.
  12. The Original Code is the YSI framework.
  13. The Initial Developer of the Original Code is Alex "Y_Less" Cole.
  14. Portions created by the Initial Developer are Copyright C 2011
  15. the Initial Developer. All Rights Reserved.
  16. Contributors:
  17. Y_Less
  18. koolk
  19. JoeBullet/Google63
  20. g_aSlice/Slice
  21. Misiur
  22. samphunter
  23. tianmeta
  24. maddinat0r
  25. spacemud
  26. Crayder
  27. Dayvison
  28. Ahmad45123
  29. Zeex
  30. irinel1996
  31. Yiin-
  32. Chaprnks
  33. Konstantinos
  34. Masterchen09
  35. Southclaws
  36. PatchwerkQWER
  37. m0k1
  38. paulommu
  39. udan111
  40. Thanks:
  41. JoeBullet/Google63 - Handy arbitrary ASM jump code using SCTRL.
  42. ZeeX - Very productive conversations.
  43. koolk - IsPlayerinAreaEx code.
  44. TheAlpha - Danish translation.
  45. breadfish - German translation.
  46. Fireburn - Dutch translation.
  47. yom - French translation.
  48. 50p - Polish translation.
  49. Zamaroht - Spanish translation.
  50. Los - Portuguese translation.
  51. Dracoblue, sintax, mabako, Xtreme, other coders - Producing other modes for
  52. me to strive to better.
  53. Pixels^ - Running XScripters where the idea was born.
  54. Matite - Pestering me to release it and using it.
  55. Very special thanks to:
  56. Thiadmer - PAWN, whose limits continue to amaze me!
  57. Kye/Kalcor - SA:MP.
  58. SA:MP Team past, present and future - SA:MP.
  59. Optional plugins:
  60. Gamer_Z - GPS.
  61. Incognito - Streamer.
  62. Me - sscanf2, fixes2, Whirlpool.
  63. */
  64. #define Master_ID() (_@)
  65. // These parts should only be defined once ever. This code is not dependent on
  66. // the current MASTER value, it's all generic.
  67. #define _YSIM_COMPARE -1
  68. #define MASTER_DATA<%0> static stock Bit:YSI_g_sMasterData[_:(%0)];
  69. #define MASTER_RESET<%0> (YSI_g_sMasterData[_:(%0)] = Bit:0);
  70. #define MASTER_SET<%0> (YSI_g_sMasterData[_:(%0)] = Bit:((1) << (Master_Caller())));
  71. #define MASTER_ADD<%0> (YSI_g_sMasterData[_:(%0)] |= Bit:(1 << Master_Caller()));
  72. #define MASTER_REMOVE<%0> (YSI_g_sMasterData[_:(%0)] &= Bit:(~(1 << Master_Caller())));
  73. #define MASTER_EMPTY<%0> if(!YSI_g_sMasterData[_:(%0)])
  74. #define MASTER_EXCLUSIVE<%0> (YSI_g_sMasterData[_:(%0)] == Bit:(1 << Master_ID()))
  75. #define MASTER_GET<%0> (YSI_g_sMasterData[_:(%0)])
  76. #define MASTER_COPY<%0,%1> (YSI_g_sMasterData[_:(%0)] = YSI_g_sMasterData[_:(%1)]);
  77. #if defined YSI_IS_CLIENT
  78. #if NO_VALUE(YSI_IS_CLIENT)
  79. #undef YSI_IS_CLIENT
  80. #define YSI_IS_CLIENT 100
  81. #endif
  82. #endif
  83. #if defined YSI_IS_SERVER
  84. #if NO_VALUE(YSI_IS_SERVER)
  85. #undef YSI_IS_SERVER
  86. #define YSI_IS_SERVER 100
  87. #endif
  88. #endif
  89. #if defined YSI_IS_STUB
  90. #if NO_VALUE(YSI_IS_STUB)
  91. #undef YSI_IS_STUB
  92. #define YSI_IS_STUB 100
  93. #endif
  94. #endif
  95. #define mhook master_hook
  96. #define mtask master_task
  97. #define mptask master_ptask
  98. // These are the macros used by y_master for the recursive function definition
  99. // structure, but they are not used unless a cloud-based "foreign" or "global"
  100. // are used.
  101. #define W@(@Zu:#%0:%1#,%2);return%3(%8) W@(@Zu:#%1,%2);return%0:%3(%0:%8)
  102. #define Z@(%0string:i) S@(i),Q@
  103. #define V@(%0string:%1) F@(),Q@
  104. // "foreign" declaration.
  105. #define @Zu:#%0,_YM@C%8:,,);return%1(%2);} @Z%8:#%0,#);return%1(%2);}
  106. // Second "foreign" declaration.
  107. // This has been updated to check for arrays, then check if the array is a
  108. // string, instead of the old method which checked for those separately.
  109. #define @Zn:@Zo:%2:#%0#%1|||%3[%4]|||%5,%6);%7} @Zm:@Zr:%2:#%0#%1|||%3|||%5,%6);%7}
  110. #define @Zm:@Zr:%2:#%0#%1|||%4string:%3|||%5,%6);%7} @Zn:@Zo:%2:#%0s#%1,%3|||%5|||%6);%7}
  111. #define @Zr:%2:#%0#%1|||%3|||%5,%6);%7} @Zn:@Zo:%2:#%0a#%1,%3|||%5|||%6);%7}
  112. #define @Zo:%2:#%0#%1|||%3|||%5,%6);%7} @Zn:@Zo:%2:#%0i#%1,%3|||%5|||%6);%7}
  113. #define @Zp:%0||||||);%1} @Zl:%0);%1}
  114. #define @Zy:%0||||||);%1} @Zj:%0);%1}
  115. #define _YM@Cl:%0,%1);%2} @Zn:@Zo:@Zp:##|||%0|||%1);%2}
  116. #define _YM@Cj:%0,%1);%2} @Zn:@Zo:@Zy:##|||%0|||%1);%2}
  117. #define @Zl:%0);%8void:%3(%1);} %0);}
  118. #define @Zj:%0);%8void:%3(%1);} %0);%3(%1);}
  119. // "global" declaration.
  120. #define @Zt:@Zb:@Zh:@Zi:%0(%1|||%2:%3|||%5,%6) @Zb:@Zh:@Zi:%0(%1|||%3|||%5,%6)
  121. #define @Zb:@Zh:@Zi:%0(%1|||%3[%4]|||%5,%6) @Zt:@Zb:@Zh:@Zi:%0(%1,%3|||%5|||%6)
  122. #define @Zh:@Zi:%0(%1|||%3|||%5,%6) @Zt:@Zb:@Zh:@Zi:%0(%1,%3|||%5|||%6)
  123. #define @Zi:%0(,%1||||||) %0(%1)
  124. #define @Zk:_YM@CP:%0(,,) %0()
  125. #define _YM@CP:%0(%1,%2) @Zt:@Zb:@Zh:@Zi:%0(|||%1|||%2)
  126. #define X@(@Zk:_YM@CP:%0string:%1(%2)) R@(@Zk:_YM@CP:%1(%2))
  127. // This is nearly all I needed to add to "global" for "void:". I doubt that
  128. // "foreign" will be as simple!
  129. #define @Zz:X@(@Zk:_YM@CP:%0void:%1(%2)) @Zk:_YM@CP:%1(%2)
  130. #define YSIM_NOT_CLIENT (!YSIM_HAS_MASTER || !_YSIM_IS_CLIENT)
  131. #define @global global
  132. // Set up the master ID stack.
  133. #define _YSIM_PUSH_INDEX 0 // First position on the stack to push to.
  134. #if !defined MAX_MASTERS
  135. #define MAX_MASTERS 64 // Default, old value.
  136. #endif
  137. #define HANDOFF(%9) master_func MAKE_YCM<HANDOFF_SOURCE...>()<p>
  138. forward Master_Reassert();
  139. enum _E_YCM
  140. {
  141. _E_YCM@y,
  142. _E_YCM@n,
  143. _E_YCM@m,
  144. _E_YCM@p,
  145. _E_YCM@u
  146. }
  147. #define _YCM@y (_YCM@==_E_YCM@y)
  148. #define _YCM@n (_YCM@==_E_YCM@n)
  149. #define _YCM@m (_YCM@==_E_YCM@m)
  150. #define _YCM@p (_YCM@==_E_YCM@p)
  151. #define _YCM@u (_YCM@==_E_YCM@u)
  152. #if defined YSI_NO_MASTER
  153. #endinput
  154. #endif
  155. static
  156. YSI_g_sMasterCount,
  157. YSI_g_sMasterData[MAX_MASTERS];
  158. PRE_HOOK(Master)
  159. #undef CHAIN_ORDER
  160. #define CHAIN_ORDER @CO_Master
  161. /*-------------------------------------------------------------------------*//**
  162. * <returns>
  163. * Next master ID to be assigned.
  164. * </returns>
  165. *//*------------------------------------------------------------------------**/
  166. stock Master_GetNext()
  167. {
  168. P:3("Master_GetNext called");
  169. new
  170. masters = getproperty(8, YSIM_MASTER),
  171. i = 0;
  172. while (i != 32)
  173. {
  174. if (!(masters & (1 << i)))
  175. {
  176. return i;
  177. }
  178. ++i;
  179. }
  180. return -1;
  181. }
  182. /*-------------------------------------------------------------------------*//**
  183. * <returns>
  184. * OnScriptInit
  185. * </returns>
  186. * <remarks>
  187. * Constructor. Gets the script a master ID. Now ALWAYS gets an ID, even if
  188. * the master system is disabled - doing otherwise is just too complicated.
  189. * </remarks>
  190. * <transition keep="true" target="_ALS : _ALS_go" />
  191. *//*------------------------------------------------------------------------**/
  192. public OnScriptInit()
  193. {
  194. P:1("Master_OnScriptInit");
  195. state _ALS : _ALS_go;
  196. if (!existproperty(8, YSIM_MASTER))
  197. {
  198. setproperty(8, YSIM_MASTER, 1);
  199. }
  200. // Properties get lost between script changes so we need to force a rebuild.
  201. CallRemoteFunction("Master_Reassert", "");
  202. new
  203. masters = getproperty(8, YSIM_MASTER),
  204. i = 1;
  205. while (i != 32)
  206. {
  207. if (!(masters & (1 << i)))
  208. {
  209. _@ = i;
  210. masters |= 1 << i;
  211. break;
  212. }
  213. ++i;
  214. }
  215. if (i != 32)
  216. {
  217. setproperty(8, YSIM_MASTER, masters);
  218. }
  219. C:1(if (!_@) P:E("MasterID not assigned"););
  220. // Make sure this is called before all other YSI initialisations, at least
  221. // all the ones which use the master system.
  222. CallLocalFunction("YSIM_OnMasterSystemInit", "");
  223. Master_OnScriptInit();
  224. return 1;
  225. }
  226. HOOK_FORWARD:Master_OnScriptInit();
  227. #if defined _ALS_OnScriptInit
  228. #undef OnScriptInit
  229. #else
  230. #define _ALS_OnScriptInit
  231. #endif
  232. #define OnScriptInit(%0) Master_OnScriptInit(%0) <_ALS : _ALS_go>
  233. #define OnMasterSystemInit YSIM_OnMasterSystemInit
  234. forward YSIM_OnMasterSystemInit();
  235. /*-------------------------------------------------------------------------*//**
  236. * <returns>
  237. * OnGameModeExit
  238. * </returns>
  239. * <remarks>
  240. * Destructor.
  241. * </remarks>
  242. *//*------------------------------------------------------------------------**/
  243. public OnScriptExit()
  244. {
  245. P:1("MasterOnce_OnScriptExit called");
  246. // Loop through everything this script is master for and call the remote
  247. // function for it. EXCEPT for this script itself!
  248. new
  249. func[4];
  250. for (new i = 0, j = YSI_g_sMasterCount; i != j; ++i)
  251. {
  252. // This is slightly slower for ending and starting scripts, but uses far
  253. // less heap space, and these values are rarely used, so may as well
  254. // pack them (which is what has happened here).
  255. func[0] = YSI_g_sMasterData[i] & 0xFF,
  256. func[1] = (YSI_g_sMasterData[i] >> 8) & 0xFF,
  257. func[2] = YSI_g_sMasterData[i] >> 16,
  258. CallLocalFunction(func, "");
  259. P:5("Master_OnScriptExit: %d %d %s", i, YSI_g_sMasterCount, func);
  260. // The properties currently clear instantly, but that may not always be
  261. // the case.
  262. }
  263. setproperty(8, YSIM_MASTER, getproperty(8, YSIM_MASTER) & ~(1 << _@)),
  264. Master_OnScriptExit(),
  265. CallRemoteFunction("OnMasterSystemClose", "i", _@);
  266. return 1;
  267. }
  268. HOOK_FORWARD:Master_OnScriptExit();
  269. #if defined _ALS_OnScriptExit
  270. #undef OnScriptExit
  271. #else
  272. #define _ALS_OnScriptExit
  273. #endif
  274. #define OnScriptExit(%0) Master_OnScriptExit(%0) <_ALS : _ALS_go>
  275. //#define OnMasterSystemClose Master_OnScriptClose
  276. //forward Master_OnScriptClose(id);
  277. /*-------------------------------------------------------------------------*//**
  278. * <remarks>
  279. * Rebuilds the collection of master data whenever a script is restarted.
  280. * </remarks>
  281. *//*------------------------------------------------------------------------**/
  282. public Master_Reassert()
  283. {
  284. // Make sure that the caller parameter is always 0 by default.
  285. U@(8, YSIM_CALLER, 0);
  286. if (_@)
  287. {
  288. // Read this script's master value.
  289. setproperty(8, YSIM_MASTER, getproperty(8, YSIM_MASTER) | (1 << _@) | 1);
  290. // Readd this script's owned scripts.
  291. new
  292. func[4];
  293. for (new i = 0; i != YSI_g_sMasterCount; ++i)
  294. {
  295. // This is slightly slower for ending and starting scripts, but uses far
  296. // less heap space, and these values are rarely used, so may as well
  297. // pack them (which is what has happened here).
  298. func[0] = YSI_g_sMasterData[i] & 0xFF;
  299. func[1] = (YSI_g_sMasterData[i] >> 8) & 0xFF;
  300. func[2] = YSI_g_sMasterData[i] >> 16;
  301. setproperty(9, func, _@);
  302. }
  303. }
  304. }
  305. stock _Master_Relinquish(library[])
  306. {
  307. //printf("STEAL %s %d", library, YSI_g_sMasterCount);
  308. switch (YSI_g_sMasterCount)
  309. {
  310. case 0: return;
  311. case 1: YSI_g_sMasterCount = 0;
  312. default:
  313. {
  314. new
  315. m = library[0] | (library[1] << 8) | (library[2] << 16);
  316. // Last one, don't switch.
  317. if (YSI_g_sMasterData[--YSI_g_sMasterCount] == m) return;
  318. // Find where this master is in the list and remove it.
  319. for (new i = 0; i != YSI_g_sMasterCount; ++i)
  320. {
  321. if (YSI_g_sMasterData[i] == m)
  322. {
  323. // Shuffle them to same space.
  324. YSI_g_sMasterData[i] = YSI_g_sMasterData[YSI_g_sMasterCount];
  325. return;
  326. }
  327. }
  328. }
  329. }
  330. }
  331. /*-------------------------------------------------------------------------*//**
  332. * <param name="library">The name of the library to try become master for.</param>
  333. *//*------------------------------------------------------------------------**/
  334. stock bool:_Master_Get(library[], bool:force = false)
  335. {
  336. new
  337. bool:ret = true;
  338. P:3("bool:_Master_Get called: \"%s\", %i", library, _:force);
  339. P:2("_Master_Get called");
  340. if (existproperty(9, library))
  341. {
  342. new
  343. master = getproperty(9, library);
  344. P:4("_Master_Get: Prop exists: %d %d", master, _@);
  345. if (master != -1)
  346. {
  347. P:4("_Master_Get: Prop set");
  348. if (master == _@) return true; // Nothing has changed.
  349. else if (force) ret = false; // A server is forcing itself.
  350. else return false; // Not got the master.
  351. }
  352. }
  353. P:4("_Master_Get: Get master.");
  354. setproperty(9, library, _@);
  355. P:4("_Master_Get: Set master.");
  356. // Add this library to the list. The list is designed to only deal with
  357. // two or three character master names now!
  358. if (YSI_g_sMasterCount < MAX_MASTERS)
  359. {
  360. P:4("_Master_Get: Set master string %s = %d", library, library[0] | (library[1] << 8) | (library[2] << 16));
  361. YSI_g_sMasterData[YSI_g_sMasterCount++] = library[0] | (library[1] << 8) | (library[2] << 16);
  362. P:4("_Master_Get: Set master string.");
  363. }
  364. P:C(else P:E("Too many master scripts"););
  365. return ret;
  366. }
  367. /*----------------------------------------------------------------------------*\
  368. Forward all the 64 possible master script initialisation functions.
  369. The code is split up every 26 masters to slightly speed up the compilation
  370. by using "#endinput" if "MAX_MASTERS" is low enough.
  371. \*----------------------------------------------------------------------------*/
  372. #if defined @aOnScriptInit
  373. forward @aOnScriptInit();
  374. #endif
  375. #if defined @bOnScriptInit
  376. forward @bOnScriptInit();
  377. #endif
  378. #if defined @cOnScriptInit
  379. forward @cOnScriptInit();
  380. #endif
  381. #if defined @dOnScriptInit
  382. forward @dOnScriptInit();
  383. #endif
  384. #if defined @eOnScriptInit
  385. forward @eOnScriptInit();
  386. #endif
  387. #if defined @fOnScriptInit
  388. forward @fOnScriptInit();
  389. #endif
  390. #if defined @gOnScriptInit
  391. forward @gOnScriptInit();
  392. #endif
  393. #if defined @hOnScriptInit
  394. forward @hOnScriptInit();
  395. #endif
  396. #if defined @iOnScriptInit
  397. forward @iOnScriptInit();
  398. #endif
  399. #if defined @jOnScriptInit
  400. forward @jOnScriptInit();
  401. #endif
  402. #if defined @kOnScriptInit
  403. forward @kOnScriptInit();
  404. #endif
  405. #if defined @lOnScriptInit
  406. forward @lOnScriptInit();
  407. #endif
  408. #if defined @mOnScriptInit
  409. forward @mOnScriptInit();
  410. #endif
  411. #if defined @nOnScriptInit
  412. forward @nOnScriptInit();
  413. #endif
  414. #if defined @oOnScriptInit
  415. forward @oOnScriptInit();
  416. #endif
  417. #if defined @pOnScriptInit
  418. forward @pOnScriptInit();
  419. #endif
  420. #if defined @qOnScriptInit
  421. forward @qOnScriptInit();
  422. #endif
  423. #if defined @rOnScriptInit
  424. forward @rOnScriptInit();
  425. #endif
  426. #if defined @sOnScriptInit
  427. forward @sOnScriptInit();
  428. #endif
  429. #if defined @tOnScriptInit
  430. forward @tOnScriptInit();
  431. #endif
  432. #if defined @uOnScriptInit
  433. forward @uOnScriptInit();
  434. #endif
  435. #if defined @vOnScriptInit
  436. forward @vOnScriptInit();
  437. #endif
  438. #if defined @wOnScriptInit
  439. forward @wOnScriptInit();
  440. #endif
  441. #if defined @xOnScriptInit
  442. forward @xOnScriptInit();
  443. #endif
  444. #if defined @yOnScriptInit
  445. forward @yOnScriptInit();
  446. #endif
  447. #if defined @zOnScriptInit
  448. forward @zOnScriptInit();
  449. #endif
  450. #if MAX_MASTERS <= 26
  451. #endinput
  452. #endif
  453. #if defined @AOnScriptInit
  454. forward @AOnScriptInit();
  455. #endif
  456. #if defined @BOnScriptInit
  457. forward @BOnScriptInit();
  458. #endif
  459. #if defined @COnScriptInit
  460. forward @COnScriptInit();
  461. #endif
  462. #if defined @DOnScriptInit
  463. forward @DOnScriptInit();
  464. #endif
  465. #if defined @EOnScriptInit
  466. forward @EOnScriptInit();
  467. #endif
  468. #if defined @FOnScriptInit
  469. forward @FOnScriptInit();
  470. #endif
  471. #if defined @GOnScriptInit
  472. forward @GOnScriptInit();
  473. #endif
  474. #if defined @HOnScriptInit
  475. forward @HOnScriptInit();
  476. #endif
  477. #if defined @IOnScriptInit
  478. forward @IOnScriptInit();
  479. #endif
  480. #if defined @JOnScriptInit
  481. forward @JOnScriptInit();
  482. #endif
  483. #if defined @KOnScriptInit
  484. forward @KOnScriptInit();
  485. #endif
  486. #if defined @LOnScriptInit
  487. forward @LOnScriptInit();
  488. #endif
  489. #if defined @MOnScriptInit
  490. forward @MOnScriptInit();
  491. #endif
  492. #if defined @NOnScriptInit
  493. forward @NOnScriptInit();
  494. #endif
  495. #if defined @OOnScriptInit
  496. forward @OOnScriptInit();
  497. #endif
  498. #if defined @POnScriptInit
  499. forward @POnScriptInit();
  500. #endif
  501. #if defined @QOnScriptInit
  502. forward @QOnScriptInit();
  503. #endif
  504. #if defined @ROnScriptInit
  505. forward @ROnScriptInit();
  506. #endif
  507. #if defined @SOnScriptInit
  508. forward @SOnScriptInit();
  509. #endif
  510. #if defined @TOnScriptInit
  511. forward @TOnScriptInit();
  512. #endif
  513. #if defined @UOnScriptInit
  514. forward @UOnScriptInit();
  515. #endif
  516. #if defined @VOnScriptInit
  517. forward @VOnScriptInit();
  518. #endif
  519. #if defined @WOnScriptInit
  520. forward @WOnScriptInit();
  521. #endif
  522. #if defined @XOnScriptInit
  523. forward @XOnScriptInit();
  524. #endif
  525. #if defined @YOnScriptInit
  526. forward @YOnScriptInit();
  527. #endif
  528. #if defined @ZOnScriptInit
  529. forward @ZOnScriptInit();
  530. #endif
  531. #if MAX_MASTERS <= 52
  532. #endinput
  533. #endif
  534. // We can't permute these symbol names - a symbol can't start with a number.
  535. #if defined @0OnScriptInit
  536. forward @0OnScriptInit();
  537. #endif
  538. #if defined @1OnScriptInit
  539. forward @1OnScriptInit();
  540. #endif
  541. #if defined @2OnScriptInit
  542. forward @2OnScriptInit();
  543. #endif
  544. #if defined @3OnScriptInit
  545. forward @3OnScriptInit();
  546. #endif
  547. #if defined @4OnScriptInit
  548. forward @4OnScriptInit();
  549. #endif
  550. #if defined @5OnScriptInit
  551. forward @5OnScriptInit();
  552. #endif
  553. #if defined @6OnScriptInit
  554. forward @6OnScriptInit();
  555. #endif
  556. #if defined @7OnScriptInit
  557. forward @7OnScriptInit();
  558. #endif
  559. #if defined @8OnScriptInit
  560. forward @8OnScriptInit();
  561. #endif
  562. #if defined @9OnScriptInit
  563. forward @9OnScriptInit();
  564. #endif
  565. #if defined @@OnScriptInit
  566. forward @@OnScriptInit();
  567. #endif
  568. #if defined @_OnScriptInit
  569. forward @_OnScriptInit();
  570. #endif