@amxts/core 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (247) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +162 -0
  3. package/README.ru.md +162 -0
  4. package/amxmodx/base/include/amxconst.inc +594 -0
  5. package/amxmodx/base/include/amxmisc.inc +902 -0
  6. package/amxmodx/base/include/amxmodx.inc +3447 -0
  7. package/amxmodx/base/include/amxmodx_version.inc +20 -0
  8. package/amxmodx/base/include/cellarray.inc +525 -0
  9. package/amxmodx/base/include/cellstack.inc +166 -0
  10. package/amxmodx/base/include/celltrie.inc +412 -0
  11. package/amxmodx/base/include/core.inc +202 -0
  12. package/amxmodx/base/include/csstats.inc +298 -0
  13. package/amxmodx/base/include/csstats_const.inc +29 -0
  14. package/amxmodx/base/include/cstrike.inc +1287 -0
  15. package/amxmodx/base/include/cstrike_const.inc +521 -0
  16. package/amxmodx/base/include/csx.inc +259 -0
  17. package/amxmodx/base/include/cvars.inc +547 -0
  18. package/amxmodx/base/include/datapack.inc +161 -0
  19. package/amxmodx/base/include/dbi.inc +154 -0
  20. package/amxmodx/base/include/dodconst.inc +152 -0
  21. package/amxmodx/base/include/dodfun.inc +152 -0
  22. package/amxmodx/base/include/dodstats.inc +69 -0
  23. package/amxmodx/base/include/dodx.inc +161 -0
  24. package/amxmodx/base/include/engine.inc +1343 -0
  25. package/amxmodx/base/include/engine_const.inc +310 -0
  26. package/amxmodx/base/include/engine_stocks.inc +248 -0
  27. package/amxmodx/base/include/esf.inc +70 -0
  28. package/amxmodx/base/include/esf_const.inc +74 -0
  29. package/amxmodx/base/include/fakemeta.inc +1127 -0
  30. package/amxmodx/base/include/fakemeta_const.inc +793 -0
  31. package/amxmodx/base/include/fakemeta_stocks.inc +395 -0
  32. package/amxmodx/base/include/fakemeta_util.inc +882 -0
  33. package/amxmodx/base/include/file.inc +666 -0
  34. package/amxmodx/base/include/float.inc +422 -0
  35. package/amxmodx/base/include/fun.inc +333 -0
  36. package/amxmodx/base/include/gameconfig.inc +93 -0
  37. package/amxmodx/base/include/geoip.inc +264 -0
  38. package/amxmodx/base/include/ham_const.inc +4352 -0
  39. package/amxmodx/base/include/hamsandwich.inc +439 -0
  40. package/amxmodx/base/include/hlsdk_const.inc +808 -0
  41. package/amxmodx/base/include/json.inc +777 -0
  42. package/amxmodx/base/include/lang.inc +119 -0
  43. package/amxmodx/base/include/message_const.inc +1130 -0
  44. package/amxmodx/base/include/message_stocks.inc +161 -0
  45. package/amxmodx/base/include/messages.inc +604 -0
  46. package/amxmodx/base/include/newmenus.inc +387 -0
  47. package/amxmodx/base/include/ns.inc +754 -0
  48. package/amxmodx/base/include/ns_const.inc +196 -0
  49. package/amxmodx/base/include/nvault.inc +154 -0
  50. package/amxmodx/base/include/regex.inc +348 -0
  51. package/amxmodx/base/include/sockets.inc +183 -0
  52. package/amxmodx/base/include/sorting.inc +107 -0
  53. package/amxmodx/base/include/sqlx.inc +582 -0
  54. package/amxmodx/base/include/string.inc +786 -0
  55. package/amxmodx/base/include/string_const.inc +156 -0
  56. package/amxmodx/base/include/string_stocks.inc +325 -0
  57. package/amxmodx/base/include/textparse_ini.inc +214 -0
  58. package/amxmodx/base/include/textparse_smc.inc +261 -0
  59. package/amxmodx/base/include/tfcconst.inc +84 -0
  60. package/amxmodx/base/include/tfcstats.inc +62 -0
  61. package/amxmodx/base/include/tfcx.inc +148 -0
  62. package/amxmodx/base/include/time.inc +118 -0
  63. package/amxmodx/base/include/tsconst.inc +154 -0
  64. package/amxmodx/base/include/tsfun.inc +198 -0
  65. package/amxmodx/base/include/tsstats.inc +65 -0
  66. package/amxmodx/base/include/tsx.inc +88 -0
  67. package/amxmodx/base/include/vault.inc +60 -0
  68. package/amxmodx/base/include/vector.inc +131 -0
  69. package/amxmodx/base/include/xs.inc +1570 -0
  70. package/as/amxts.d.ts +153 -0
  71. package/as/constants.ts +4730 -0
  72. package/as/effects.ts +1449 -0
  73. package/as/entities.ts +5482 -0
  74. package/as/events.ts +3054 -0
  75. package/as/facade.ts +4639 -0
  76. package/as/flags.ts +299 -0
  77. package/as/fs.ts +287 -0
  78. package/as/hooks.ts +18536 -0
  79. package/as/kit.ts +25 -0
  80. package/as/lib/check.ts +86 -0
  81. package/as/modules/http.ts +184 -0
  82. package/as/natives.ts +11845 -0
  83. package/as/os.ts +30 -0
  84. package/as/promise.ts +1392 -0
  85. package/as/promise.types.d.ts +82 -0
  86. package/as/remote.ts +288 -0
  87. package/as/tsconfig.json +22 -0
  88. package/as/vector.ts +65 -0
  89. package/bin/amxts.mjs +10 -0
  90. package/includes/menu_core.inc +355 -0
  91. package/includes/order.txt +54 -0
  92. package/includes/sources.json +27 -0
  93. package/includes/universal_config.inc +355 -0
  94. package/lint/oxlint-plugin.mjs +77 -0
  95. package/node_modules/assemblyscript/LICENSE +201 -0
  96. package/node_modules/assemblyscript/NOTICE +93 -0
  97. package/node_modules/assemblyscript/package.json +63 -0
  98. package/node_modules/assemblyscript/std/README.md +6 -0
  99. package/node_modules/assemblyscript/std/assembly/array.ts +526 -0
  100. package/node_modules/assemblyscript/std/assembly/arraybuffer.ts +77 -0
  101. package/node_modules/assemblyscript/std/assembly/atomics.ts +127 -0
  102. package/node_modules/assemblyscript/std/assembly/bindings/asyncify.ts +16 -0
  103. package/node_modules/assemblyscript/std/assembly/bindings/dom.ts +291 -0
  104. package/node_modules/assemblyscript/std/assembly/bindings/node.ts +6 -0
  105. package/node_modules/assemblyscript/std/assembly/builtins.ts +2631 -0
  106. package/node_modules/assemblyscript/std/assembly/compat.ts +2 -0
  107. package/node_modules/assemblyscript/std/assembly/console.ts +42 -0
  108. package/node_modules/assemblyscript/std/assembly/crypto.ts +9 -0
  109. package/node_modules/assemblyscript/std/assembly/dataview.ts +181 -0
  110. package/node_modules/assemblyscript/std/assembly/date.ts +373 -0
  111. package/node_modules/assemblyscript/std/assembly/diagnostics.ts +11 -0
  112. package/node_modules/assemblyscript/std/assembly/error.ts +44 -0
  113. package/node_modules/assemblyscript/std/assembly/function.ts +38 -0
  114. package/node_modules/assemblyscript/std/assembly/index.d.ts +2822 -0
  115. package/node_modules/assemblyscript/std/assembly/iterator.ts +35 -0
  116. package/node_modules/assemblyscript/std/assembly/map.ts +260 -0
  117. package/node_modules/assemblyscript/std/assembly/math.ts +3289 -0
  118. package/node_modules/assemblyscript/std/assembly/memory.ts +123 -0
  119. package/node_modules/assemblyscript/std/assembly/number.ts +388 -0
  120. package/node_modules/assemblyscript/std/assembly/object.ts +36 -0
  121. package/node_modules/assemblyscript/std/assembly/performance.ts +9 -0
  122. package/node_modules/assemblyscript/std/assembly/polyfills.ts +27 -0
  123. package/node_modules/assemblyscript/std/assembly/process.ts +50 -0
  124. package/node_modules/assemblyscript/std/assembly/reference.ts +48 -0
  125. package/node_modules/assemblyscript/std/assembly/regexp.ts +12 -0
  126. package/node_modules/assemblyscript/std/assembly/rt/README.md +83 -0
  127. package/node_modules/assemblyscript/std/assembly/rt/common.ts +81 -0
  128. package/node_modules/assemblyscript/std/assembly/rt/index-incremental.ts +2 -0
  129. package/node_modules/assemblyscript/std/assembly/rt/index-minimal.ts +2 -0
  130. package/node_modules/assemblyscript/std/assembly/rt/index-stub.ts +1 -0
  131. package/node_modules/assemblyscript/std/assembly/rt/index.d.ts +37 -0
  132. package/node_modules/assemblyscript/std/assembly/rt/itcms.ts +419 -0
  133. package/node_modules/assemblyscript/std/assembly/rt/rtrace.ts +15 -0
  134. package/node_modules/assemblyscript/std/assembly/rt/stub.ts +133 -0
  135. package/node_modules/assemblyscript/std/assembly/rt/tcms.ts +254 -0
  136. package/node_modules/assemblyscript/std/assembly/rt/tlsf.ts +592 -0
  137. package/node_modules/assemblyscript/std/assembly/rt.ts +87 -0
  138. package/node_modules/assemblyscript/std/assembly/set.ts +220 -0
  139. package/node_modules/assemblyscript/std/assembly/shared/feature.ts +65 -0
  140. package/node_modules/assemblyscript/std/assembly/shared/runtime.ts +11 -0
  141. package/node_modules/assemblyscript/std/assembly/shared/target.ts +11 -0
  142. package/node_modules/assemblyscript/std/assembly/shared/tsconfig.json +11 -0
  143. package/node_modules/assemblyscript/std/assembly/shared/typeinfo.ts +72 -0
  144. package/node_modules/assemblyscript/std/assembly/staticarray.ts +401 -0
  145. package/node_modules/assemblyscript/std/assembly/string.ts +847 -0
  146. package/node_modules/assemblyscript/std/assembly/symbol.ts +114 -0
  147. package/node_modules/assemblyscript/std/assembly/table.ts +16 -0
  148. package/node_modules/assemblyscript/std/assembly/tsconfig.json +6 -0
  149. package/node_modules/assemblyscript/std/assembly/typedarray.ts +1945 -0
  150. package/node_modules/assemblyscript/std/assembly/uri.ts +17 -0
  151. package/node_modules/assemblyscript/std/assembly/util/bytes.ts +107 -0
  152. package/node_modules/assemblyscript/std/assembly/util/casemap.ts +497 -0
  153. package/node_modules/assemblyscript/std/assembly/util/error.ts +54 -0
  154. package/node_modules/assemblyscript/std/assembly/util/hash.ts +117 -0
  155. package/node_modules/assemblyscript/std/assembly/util/math.ts +1922 -0
  156. package/node_modules/assemblyscript/std/assembly/util/memory.ts +290 -0
  157. package/node_modules/assemblyscript/std/assembly/util/number.ts +873 -0
  158. package/node_modules/assemblyscript/std/assembly/util/sort.ts +313 -0
  159. package/node_modules/assemblyscript/std/assembly/util/string.ts +1202 -0
  160. package/node_modules/assemblyscript/std/assembly/util/uri.ts +275 -0
  161. package/node_modules/assemblyscript/std/assembly/vector.ts +4 -0
  162. package/node_modules/assemblyscript/std/assembly.json +16 -0
  163. package/node_modules/assemblyscript/std/portable/index.d.ts +462 -0
  164. package/node_modules/assemblyscript/std/portable/index.js +416 -0
  165. package/node_modules/assemblyscript/std/portable.json +11 -0
  166. package/node_modules/assemblyscript/std/types/assembly/index.d.ts +1 -0
  167. package/node_modules/assemblyscript/std/types/assembly/package.json +3 -0
  168. package/node_modules/assemblyscript/std/types/portable/index.d.ts +1 -0
  169. package/node_modules/assemblyscript/std/types/portable/package.json +3 -0
  170. package/node_modules/assemblyscript/tsconfig-base.json +13 -0
  171. package/package.json +112 -0
  172. package/runtime/deps/assemblyscript/LICENSE +201 -0
  173. package/runtime/deps/assemblyscript/NOTICE +93 -0
  174. package/runtime/deps/assemblyscript/bin/asc.js +35 -0
  175. package/runtime/deps/assemblyscript/dist/asc.js +25035 -0
  176. package/runtime/deps/assemblyscript/dist/assemblyscript.js +337 -0
  177. package/runtime/deps/assemblyscript/node_modules/binaryen/LICENSE +201 -0
  178. package/runtime/deps/assemblyscript/node_modules/binaryen/index.js +28905 -0
  179. package/runtime/deps/assemblyscript/node_modules/binaryen/package.json +50 -0
  180. package/runtime/deps/assemblyscript/node_modules/long/LICENSE +202 -0
  181. package/runtime/deps/assemblyscript/node_modules/long/index.js +1581 -0
  182. package/runtime/deps/assemblyscript/node_modules/long/package.json +58 -0
  183. package/runtime/deps/assemblyscript/package.json +114 -0
  184. package/runtime/host/amxts.inc +85 -0
  185. package/runtime/licenses/AMXX-LICENSE.txt +34 -0
  186. package/runtime/licenses/AssemblyScript-LICENSE +201 -0
  187. package/runtime/licenses/AssemblyScript-NOTICE +93 -0
  188. package/runtime/licenses/Binaryen-LICENSE +201 -0
  189. package/runtime/licenses/Bun-LICENSE.md +84 -0
  190. package/runtime/licenses/GPL-3.0.txt +674 -0
  191. package/runtime/licenses/LLVM-LICENSE.TXT +279 -0
  192. package/runtime/licenses/README.md +25 -0
  193. package/runtime/licenses/WAMR-LICENSE +219 -0
  194. package/runtime/natives.txt +1095 -0
  195. package/runtime/patches/README.md +59 -0
  196. package/runtime/patches/assemblyscript-0.28.20-amxts.patch +14174 -0
  197. package/runtime/patches/wamr-2.4.5-amxts.patch +364 -0
  198. package/scripts/apply-docs.ts +508 -0
  199. package/scripts/asc.ts +27 -0
  200. package/scripts/auto-imports.ts +258 -0
  201. package/scripts/build-wasm.ts +595 -0
  202. package/scripts/check.ts +93 -0
  203. package/scripts/compile-cache.ts +179 -0
  204. package/scripts/compile.ts +401 -0
  205. package/scripts/docker-server.ts +73 -0
  206. package/scripts/docs/as/amxts.ts +210 -0
  207. package/scripts/docs/as/effects.ts +1684 -0
  208. package/scripts/docs/as/facade.ts +3302 -0
  209. package/scripts/docs/as/fs.ts +173 -0
  210. package/scripts/docs/as/lib/check.ts +68 -0
  211. package/scripts/docs/as/modules/http.ts +66 -0
  212. package/scripts/docs/as/os.ts +16 -0
  213. package/scripts/docs/as/promise.ts +132 -0
  214. package/scripts/docs/as/promise.types.ts +63 -0
  215. package/scripts/docs/as/vector.ts +48 -0
  216. package/scripts/docs/entities.ts +2338 -0
  217. package/scripts/docs/events.ts +245 -0
  218. package/scripts/docs/game.ts +497 -0
  219. package/scripts/docs/messages.ts +148 -0
  220. package/scripts/file-contents.ts +74 -0
  221. package/scripts/includes.ts +134 -0
  222. package/scripts/player-fields.ts +866 -0
  223. package/scripts/plugin-cache.ts +92 -0
  224. package/scripts/plugin-natives.ts +1157 -0
  225. package/scripts/prebuilt.ts +268 -0
  226. package/scripts/prepare.ts +134 -0
  227. package/scripts/project.ts +973 -0
  228. package/scripts/run.ts +28 -0
  229. package/scripts/shared-modules.ts +906 -0
  230. package/scripts/system.ts +33 -0
  231. package/scripts/tracked-fs.ts +115 -0
  232. package/scripts/typed-configs.ts +788 -0
  233. package/scripts/ui.ts +77 -0
  234. package/src/cli-api.mjs +175 -0
  235. package/src/parser/include-parser.ts +506 -0
  236. package/src/system.mjs +155 -0
  237. package/src/testing/compile-cache.ts +31 -0
  238. package/src/testing/compile.ts +222 -0
  239. package/src/testing/coroutines.ts +191 -0
  240. package/src/testing/index.ts +39 -0
  241. package/src/testing/kits.ts +55 -0
  242. package/src/testing/memory.ts +125 -0
  243. package/src/testing/natives.ts +925 -0
  244. package/src/testing/server.ts +1874 -0
  245. package/src/testing/setup.ts +63 -0
  246. package/src/testing/tables.ts +139 -0
  247. package/src/types.ts +51 -0
@@ -0,0 +1,355 @@
1
+ #if defined _menu_core_included
2
+ #endinput
3
+ #endif
4
+ #define _menu_core_included
5
+
6
+ /**
7
+ * Menu Core System — public API include
8
+ *
9
+ * Menu property constants for mc_set_menu_property / mc_set_menu_property_string
10
+ */
11
+ #define MP_LOCKED 0 // bool: lock menu item selection
12
+ #define MP_GLOBAL_TIMER 1 // bool: use global countdown timer
13
+ #define MP_TIMER_DURATION 2 // int: timer duration in seconds
14
+ #define MP_HIDE_BACK 3 // bool: hide the Back button
15
+ #define MP_HIDE_EXIT 4 // bool: hide the Exit button
16
+ #define MP_SECTION 5 // string (read via mc_get_menu_property_string)
17
+ #define MP_ON_TIMEOUT 5 // string (write via mc_set_menu_property_string): action on timer expiry
18
+ #define MP_ACTIVE_ON 6 // string (write via mc_set_menu_property_string): condition for menu visibility
19
+ #define MP_FILTER 7 // string (write via mc_set_menu_property_string): list filter "CONDITION|MSG_KEY"
20
+
21
+ /**
22
+ * Registers a condition that can be referenced in menu configs to control
23
+ * item visibility or availability.
24
+ *
25
+ * @param name Condition name (e.g. "IS_CHIEF", "IS_ALIVE").
26
+ * @param callback Name of the evaluator function.
27
+ * Signature: public callback(id)
28
+ * Returns true if the condition is met, false otherwise.
29
+ * @return Condition ID (>= 0) on success, -1 if the limit is reached.
30
+ */
31
+ native mc_register_condition(const name[], const callback[]);
32
+
33
+ /**
34
+ * Built-in actions (handled by the menu system — do NOT register these):
35
+ * - "SHOW_<SECTION>" — opens the menu section named by the suffix. The system
36
+ * strips the "SHOW_" prefix and calls mc_show_menu on the rest, so a menu item
37
+ * with action "SHOW_ADMIN_MENU" opens the "ADMIN_MENU" section automatically.
38
+ * Use this to chain into sub-menus instead of writing a wrapper action whose
39
+ * only job is to call mc_show_menu.
40
+ * - "CLOSE_MENU" — closes the player's current menu.
41
+ * Both work in STRICT and LIST menus and may be combined with other actions in a
42
+ * space-separated action list (e.g. "REPLACE_PLAYER_GAME CLOSE_MENU").
43
+ *
44
+ * Registers an action that is executed when a menu item is selected.
45
+ *
46
+ * @param name Action name (e.g. "GET_WEAPON_M4A1", "PLAYER_HEAL").
47
+ * @param callback Name of the handler function. Signature depends on menu type:
48
+ * - MENU_TYPE_STRICT: public callback(id, const key[])
49
+ * - MENU_TYPE_LIST: public callback(id, targetId)
50
+ * @param isCritical Prevents concurrent execution of other critical actions
51
+ * for the same player (default: false).
52
+ * @return Action ID (>= 0) on success, -1 if the limit is reached.
53
+ */
54
+ native mc_register_action(const name[], const callback[], bool:isCritical = false);
55
+
56
+ /**
57
+ * Registers a placeholder for dynamic text substitution in LIST-menu VIEW fields.
58
+ *
59
+ * @param name Placeholder name without surrounding '%' characters
60
+ * (e.g. "name", "health").
61
+ * @param callback Name of the value provider function.
62
+ * Signature: public callback(id, targetId, value[], len)
63
+ * @return Placeholder ID (>= 0) on success, -1 if the limit is reached.
64
+ */
65
+ native mc_register_placeholder(const name[], const callback[]);
66
+
67
+ /**
68
+ * Registers a menu section defined in the configuration file.
69
+ *
70
+ * @param section Section name in the config file (e.g. "CHOOSE_TEAM").
71
+ * @return Menu ID (>= 0) on success, -1 if the section is invalid
72
+ * or the menu limit is reached.
73
+ */
74
+ native mc_register_menu(const section[]);
75
+
76
+ /**
77
+ * Displays a menu to a player.
78
+ *
79
+ * @param id Player index.
80
+ * @param section Menu section name.
81
+ * @param time Optional. Display duration in seconds; -1 uses config value.
82
+ * @param targetId Optional. Target player for LIST-type menus (default: 0).
83
+ * @param resetHistory Optional. Reset navigation history before showing (default: false).
84
+ * @param forceOpen Optional. Force open, bypassing active-menu locks (default: false).
85
+ * @param ignoreHistory Optional. Do not add this menu to the navigation history (default: false).
86
+ * @return 1 on success, 0 if the player is invalid, the section is not
87
+ * registered, or the ACTIVE_ON condition is not met.
88
+ */
89
+ native mc_show_menu(id, const section[], time = -1, targetId = 0, bool:resetHistory = false, bool:forceOpen = false, bool:ignoreHistory = false);
90
+
91
+ /**
92
+ * Sets or updates the countdown timer for an active menu.
93
+ *
94
+ * @param section Menu section name.
95
+ * @param time New duration in seconds.
96
+ * @return 1 on success, 0 if the section is invalid or no timer is active.
97
+ */
98
+ native mc_set_menu_timer(const section[], time);
99
+
100
+ /**
101
+ * Notifies the menu system that a condition value has changed, triggering a
102
+ * refresh of all menus that depend on it.
103
+ *
104
+ * @param condition Condition name that has changed (e.g. "IS_CHIEF").
105
+ */
106
+ native mc_notify_condition_changed(const condition[]);
107
+
108
+ /**
109
+ * Refreshes one or more menus for players currently viewing them.
110
+ *
111
+ * @param sections Space-separated list of section names to refresh
112
+ * (e.g. "CHOOSE_TEAM LIST_PLAYER_HEAL").
113
+ * @return Number of menu views refreshed, 0 if none were refreshed.
114
+ */
115
+ native mc_refresh_menu(const sections[]);
116
+
117
+ /**
118
+ * Registers a restriction validator used in menu item access checks.
119
+ *
120
+ * @param name Restriction name (e.g. "ADMIN", "VIP").
121
+ * Use "*" as a wildcard to handle all restriction names.
122
+ * @param callback Name of the validator function.
123
+ * Signature: public callback(id, const restrictName[])
124
+ * Returns true if the player passes the restriction.
125
+ * @param message Optional default message shown when the restriction is not met.
126
+ * @return Restriction ID (>= 0) on success, -1 if the limit is reached.
127
+ */
128
+ native mc_register_restriction(const name[], const callback[], const message[] = "");
129
+
130
+ /**
131
+ * Registers an action condition validator.
132
+ * If the validator returns false, the menu item with this action will be rendered disabled (grayed out).
133
+ *
134
+ * @param menuSection Name of the menu section (e.g. "CHIEF_MENU"). If empty (""), matches all menus.
135
+ * @param actionName Name of the action (e.g. "CLOSE_CELLS"). If empty (""), matches all actions.
136
+ * @param callback Name of the callback function.
137
+ * Signature: public callback(id, const menuSection[], const actionName[])
138
+ * Returns true if the condition is met, false to disable/gray out.
139
+ * @return 1 on success.
140
+ */
141
+ native mc_register_action_condition(const menuSection[], const actionName[], const callback[]);
142
+
143
+ /**
144
+ * Registers a condition filter — a post-processor that can OVERRIDE the boolean result of a named
145
+ * condition (one registered via mc_register_condition) without owning that condition. Whenever the
146
+ * condition is evaluated during menu rendering, every filter registered for that condition name is
147
+ * called in turn, each receiving the running result, so a plugin can veto or extend another plugin's
148
+ * condition (e.g. forcing IS_TRAINING_ENABLED to false while a mix is in progress).
149
+ *
150
+ * @param condition Name of the condition to filter (must match a registered condition name).
151
+ * @param callback Name of the filter function.
152
+ * Signature: public bool:callback(id, viewerId, const condition[], bool:currentVal)
153
+ * Returns the (possibly overridden) value. Return currentVal to leave it unchanged.
154
+ * @return Filter ID (>= 0) on success, -1 if the limit is reached.
155
+ */
156
+ native mc_register_condition_filter(const condition[], const callback[]);
157
+
158
+ /**
159
+ * Registers a custom data source for a LIST-type menu.
160
+ * Allows LIST menus to display arbitrary entities (weapons, items, etc.)
161
+ * instead of the default player list.
162
+ *
163
+ * @param menuName Name of the LIST menu section (e.g. "LIST_GUARD_WEAPONS").
164
+ * @param callback Name of the data provider function.
165
+ * Signature: public callback(id, Array:items)
166
+ * id — player viewing the menu
167
+ * items — dynamic array to fill with item data
168
+ *
169
+ * Each item is a 289-cell array with the following layout:
170
+ * item[0] = Entity ID passed to action callbacks as targetId;
171
+ * use -2 to insert a display-only text row.
172
+ * item[1..64] = Action key / entity identifier (e.g. "weapon_ak47").
173
+ * item[65..128] = Display language key or raw text.
174
+ * item[129..160] = Restriction name, or empty string for none.
175
+ * item[161..288] = Message shown when the item is disabled by a restriction.
176
+ * @return Data source ID (>= 0) on success, -1 if the limit is reached.
177
+ */
178
+ native mc_register_list_data_source(const menuName[], const callback[]);
179
+
180
+ /**
181
+ * Registers a callback invoked when a menu is opened for a player.
182
+ *
183
+ * @param callback Name of the handler function.
184
+ * Signature: public callback(id, const section[])
185
+ * @return Callback ID (>= 0) on success, -1 if the limit is reached.
186
+ */
187
+ native mc_register_menu_open_callback(const callback[]);
188
+
189
+ /**
190
+ * Registers a callback invoked when a menu is closed for a player.
191
+ *
192
+ * @param callback Name of the handler function.
193
+ * Signature: public callback(id, bool:isTimeout, const section[])
194
+ * @return Callback ID (>= 0) on success, -1 if the limit is reached.
195
+ */
196
+ native mc_register_menu_close_callback(const callback[]);
197
+
198
+ /**
199
+ * Registers a show filter — a global veto invoked at the start of mc_show_menu, before the menu
200
+ * renders. If the callback returns false, the menu does NOT open (mc_show_menu returns 0). Use this
201
+ * to centrally gate ALL menu openings from one place (any command, key or sub-menu) and show the
202
+ * player a reason, instead of guarding every individual entry point.
203
+ *
204
+ * @param callback Name of the handler function.
205
+ * Signature: public bool:callback(id, const section[])
206
+ * Returns true to allow opening, false to block it (and typically notify the player).
207
+ * @return Filter ID (>= 0) on success, -1 if the limit is reached.
208
+ */
209
+ native mc_register_show_filter(const callback[]);
210
+
211
+ /**
212
+ * Cancels an active menu timer and closes the menu for all players viewing it.
213
+ *
214
+ * @param section Menu section name.
215
+ * @return 1 on success (timer was active and cancelled),
216
+ * 0 if the section is invalid or no timer is active.
217
+ */
218
+ native mc_cancel_menu_timer(const section[]);
219
+
220
+ /**
221
+ * Locks or unlocks the menu for a player.
222
+ * When locked the player cannot select any items.
223
+ *
224
+ * @param id Player index.
225
+ * @param lock true to lock, false to unlock (default: true).
226
+ */
227
+ native mc_lock_menu(id, bool:lock = true);
228
+
229
+ /**
230
+ * Hides the currently open menu for a player and resets their menu state.
231
+ *
232
+ * @param id Player index.
233
+ */
234
+ native mc_hide_menu(id);
235
+
236
+ /**
237
+ * Returns whether the menu is locked for a player.
238
+ *
239
+ * @param id Player index.
240
+ * @return true if locked, false otherwise.
241
+ */
242
+ native bool:mc_is_menu_locked(id);
243
+
244
+ /**
245
+ * Returns the index of the player's currently active menu.
246
+ *
247
+ * @param id Player index.
248
+ * @return Menu index (>= 0) if a menu is open, -1 if no menu is active.
249
+ */
250
+ native mc_get_active_menu(id);
251
+
252
+ /**
253
+ * Reads a string property of a menu by its runtime index.
254
+ *
255
+ * @param menuIdx Menu index (returned by mc_get_active_menu).
256
+ * @param property Property identifier (MP_SECTION, etc.).
257
+ * @param value Output buffer.
258
+ * @param len Maximum buffer length.
259
+ * @return 1 on success, 0 if the index or property is invalid.
260
+ */
261
+ native mc_get_menu_property_string(menuIdx, property, value[], len);
262
+
263
+ /**
264
+ * Sets an integer or boolean property of a menu.
265
+ *
266
+ * @param section Menu section name.
267
+ * @param property Property identifier (MP_LOCKED, MP_HIDE_BACK, etc.).
268
+ * @param value New value.
269
+ * @return 1 on success, 0 if the section is not found or the property
270
+ * is invalid.
271
+ */
272
+ native mc_set_menu_property(const section[], property, value);
273
+
274
+ /**
275
+ * Sets a string property of a menu.
276
+ *
277
+ * @param section Menu section name.
278
+ * @param property Property identifier (MP_ON_TIMEOUT, etc.).
279
+ * @param value New string value.
280
+ * @return 1 on success, 0 if the section is not found or the property
281
+ * is invalid.
282
+ */
283
+ native mc_set_menu_property_string(const section[], property, const value[]);
284
+
285
+ /**
286
+ * Programmatically adds an item to a menu section (without editing the config).
287
+ *
288
+ * @param section Menu section name.
289
+ * @param name Display name or language key. Supports variant syntax via "|".
290
+ * @param placeholder Placeholder text (default: "").
291
+ * @param condition Visibility condition name, or empty for always visible.
292
+ * @param action Action name on selection, or empty.
293
+ * @param restriction Restriction name, or empty for unrestricted.
294
+ * @param restrictMsg Message shown when the restriction blocks the item.
295
+ * @param iPosition Insertion index in the items list, or -1 to append to the end.
296
+ * @param emptyBefore Number of blank lines to insert before this item.
297
+ * @param emptyAfter Number of blank lines to insert after this item.
298
+ * @return 1 on success, 0 if the section is not found or the item
299
+ * data is invalid.
300
+ */
301
+ native mc_add_menu_item(const section[], const name[], const placeholder[] = "", const condition[] = "", const action[] = "", const restriction[] = "", const restrictMsg[] = "", iPosition = -1, emptyBefore = 0, emptyAfter = 0);
302
+
303
+ /**
304
+ * Adds a fixed-slot item to a menu section (always displayed at a specific slot).
305
+ *
306
+ * @param section Menu section name.
307
+ * @param slot Slot number (1–7).
308
+ * @param name Display name or language key.
309
+ * @param placeholder Placeholder text (default: "").
310
+ * @param action Action name on selection.
311
+ * @param condition Visibility condition name, or empty.
312
+ * @param restriction Restriction name, or empty.
313
+ * @param emptyBefore Number of blank lines to insert before this item.
314
+ * @param emptyAfter Number of blank lines to insert after this item.
315
+ * @return 1 on success, 0 if the section is not found or the item
316
+ * data is invalid.
317
+ */
318
+ native mc_add_fixed_menu_item(const section[], slot, const name[], const placeholder[] = "", const action[] = "", const condition[] = "", const restriction[] = "", emptyBefore = 0, emptyAfter = 0);
319
+
320
+ /**
321
+ * Inserts a display-only text row (separator / header) into a LIST-menu item array.
322
+ * Call this inside a data source callback.
323
+ *
324
+ * @param aItems The Array:items handle provided by the data source callback.
325
+ * @param text Text or language key to display.
326
+ * @param centered Center the text within the menu width (default: false).
327
+ * @return 1 on success.
328
+ */
329
+ native mc_add_list_text(Array:aItems, const text[], bool:centered = false);
330
+
331
+ /**
332
+ * Clears all items (regular and fixed) from a menu section.
333
+ *
334
+ * @param section Menu section name.
335
+ * @return 1 on success, 0 if the section is not found.
336
+ */
337
+ native mc_clear_menu_items(const section[]);
338
+
339
+ /**
340
+ * Creates a menu entirely in code (without a config file entry).
341
+ * The section name prefix "LIST_" automatically sets the type to MENU_TYPE_LIST.
342
+ *
343
+ * @param section Unique section name for the new menu.
344
+ * @param title Menu title (raw string or language key).
345
+ * @return 1 on success, 0 if a section with that name already exists.
346
+ */
347
+ native mc_create_menu(const section[], const title[]);
348
+
349
+ /**
350
+ * Sets the current page of a menu for a player.
351
+ *
352
+ * @param id Player index.
353
+ * @param page Zero-based page number.
354
+ */
355
+ native mc_set_menu_page(id, page);
@@ -0,0 +1,54 @@
1
+ # Which includes the host plugin pulls in, and in what order.
2
+ # This cannot be derived from the .inc files: an include may use reapi's
3
+ # constants without including reapi itself. Files missing from this list are still
4
+ # parsed for their natives — reapi.inc, for instance, already pulls in
5
+ # reapi_engine and reapi_gamedll.
6
+ amxmodx
7
+ cellarray
8
+ fun
9
+ cvars
10
+ float
11
+ reapi
12
+ hamsandwich
13
+ cstrike
14
+ engine
15
+ nvault
16
+ easy_http
17
+ resemiclip
18
+ universal_config
19
+ menu_core
20
+
21
+ # engine, nvault and geoip are stock AMX Mod X modules shipped with the server
22
+ # (addons/amxmodx/modules/); geoip is listed in modules.ini and the other two
23
+ # are auto-detected from the `#pragma reqlib` amxxpc writes into the .amxx.
24
+ # easy_http and resemiclip are third-party modules, both present as DLLs and
25
+ # both enabled explicitly in modules.ini.
26
+ #
27
+ # universal_config and menu_core are not modules: their natives come from
28
+ # universal_config.amxx and menu_core.amxx, which plugins.ini loads ahead of
29
+ # amxts_host.amxx. AMX Mod X resolves plugin-registered natives after every
30
+ # plugin has run plugin_natives(), so the host links against them fine - but a
31
+ # server without those two plugins must put a `-` back in front of them.
32
+
33
+ # A line starting with `-` is a deny marker: the include is still resolved and
34
+ # parsed (amxxpc needs the file on disk to compile reapi.inc, which #includes
35
+ # it unconditionally), but its natives are never pulled into the host's native
36
+ # table. A #include costs nothing; a reference in __pull_natives() does — it
37
+ # makes AMX Mod X refuse to load the plugin on a server that doesn't have the
38
+ # native, taking the whole runtime down with it. None of these three are safe
39
+ # to assume: vtc and rechecker are optional reapi add-ons, and reunion natives
40
+ # are only registered when reapi detects Reunion at runtime, so even a server
41
+ # that loads the Reunion metamod plugin cannot be assumed to expose them.
42
+ # A server that wants one of these removes its `-`.
43
+ # geoip is in modules.ini and its DLL is there, and it still cannot be pulled:
44
+ # the module disables its own natives when it cannot find the GeoIP2 databases,
45
+ # which it announces at startup and which this server does. A module being
46
+ # loaded is not the same as its natives existing, and the difference is only
47
+ # visible by starting the server - the host plugin refused to load with
48
+ # "unknown function (name geoip_continent_name)" and took the whole runtime
49
+ # with it. A server with the databases in place removes this marker.
50
+ -geoip
51
+
52
+ -reapi_vtc
53
+ -reapi_reunion
54
+ -reapi_rechecker
@@ -0,0 +1,27 @@
1
+ {
2
+ "reapi": {
3
+ "name": "ReAPI",
4
+ "version": "5.29.0.358",
5
+ "license": "GPL-3.0",
6
+ "home": "https://github.com/rehlds/ReAPI",
7
+ "url": "https://github.com/rehlds/ReAPI/releases/download/5.29.0.358/reapi-bin-5.29.0.358.zip",
8
+ "sha256": "f33a7435540bea8706db3fa948e51a85b511f5b18c383b97402a204dc5419195",
9
+ "include": "addons/amxmodx/scripting/include/"
10
+ },
11
+ "easy_http": {
12
+ "name": "AmxxEasyHttp",
13
+ "version": "1.4.0",
14
+ "license": "MIT",
15
+ "home": "https://github.com/Next21Team/AmxxEasyHttp",
16
+ "url": "https://github.com/Next21Team/AmxxEasyHttp/releases/download/1.4.0/easy_http.inc",
17
+ "sha256": "5196ae17ea58eeaebd293639f96e0c8bbfe06b40e28daab2c80395538b62f1d9"
18
+ },
19
+ "resemiclip": {
20
+ "name": "ReSemiclip AMXX",
21
+ "version": "2.3.9-amxx",
22
+ "license": "GPL-2.0",
23
+ "home": "https://github.com/Next21Team/resemiclip-amxx",
24
+ "url": "https://raw.githubusercontent.com/Next21Team/resemiclip-amxx/2.3.9-amxx/addons/amxmodx/scripting/include/resemiclip.inc",
25
+ "sha256": "f5f141d61bca1ea71b00e20c9dfbf80f06df66247ec43e41507954644afb35b4"
26
+ }
27
+ }