@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,3447 @@
1
+ // vim: set ts=4 sw=4 tw=99 noet:
2
+ //
3
+ // AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO").
4
+ // Copyright (C) The AMX Mod X Development Team.
5
+ //
6
+ // This software is licensed under the GNU General Public License, version 3 or higher.
7
+ // Additional exceptions apply. For full license details, see LICENSE.txt or visit:
8
+ // https://alliedmods.net/amxmodx-license
9
+
10
+ #if defined _amxmodx_included
11
+ #endinput
12
+ #endif
13
+ #define _amxmodx_included
14
+
15
+ #include <core>
16
+ #include <float>
17
+ #include <amxconst>
18
+ #include <string>
19
+ #include <file>
20
+ #include <vault>
21
+ #include <lang>
22
+ #include <messages>
23
+ #include <vector>
24
+ #include <sorting>
25
+ #include <cellarray>
26
+ #include <cellstack>
27
+ #include <celltrie>
28
+ #include <datapack>
29
+ #include <newmenus>
30
+ #include <textparse_smc>
31
+ #include <textparse_ini>
32
+ #include <cvars>
33
+ #include <gameconfig>
34
+
35
+ /**
36
+ * Called just after server activation.
37
+ *
38
+ * @note Good place to initialize most of the plugin, such as registering
39
+ * cvars, commands or forwards, creating data structures for later use, or
40
+ * generating and loading other required configurations.
41
+ *
42
+ * @noreturn
43
+ */
44
+ forward plugin_init();
45
+
46
+ /**
47
+ * Called just before the plugin is paused from execution.
48
+ *
49
+ * @noreturn
50
+ */
51
+ forward plugin_pause();
52
+
53
+ /**
54
+ * Called just after the plugin is unpaused.
55
+ *
56
+ * @noreturn
57
+ */
58
+ forward plugin_unpause();
59
+
60
+ /**
61
+ * Called when the mod tries to change the map.
62
+ *
63
+ * @note This is *only* called if the mod itself handles the map change. The
64
+ * server command "changelevel", which is used by many plugins, will not
65
+ * trigger this forward. Unfortunately, this means that in practice this
66
+ * forward can be unreliable and will not be called in many situations.
67
+ * @note AMXX 1.8.3 has added the engine_changelevel() function, which will utilize
68
+ * the correct engine function to change the map, and therefore trigger
69
+ * this forward.
70
+ *
71
+ * @param map Map that the mod tries to change to
72
+ *
73
+ * @return PLUGIN_CONTINUE to let the mod change the map
74
+ * PLUGIN_HANDLED or higher to prevent the map change
75
+ */
76
+ forward server_changelevel(map[]);
77
+
78
+ /**
79
+ * Called when all plugins went through plugin_init()
80
+ *
81
+ * @note When this forward is called, most plugins should have registered their
82
+ * cvars and commands already.
83
+ *
84
+ * @noreturn
85
+ */
86
+ forward plugin_cfg();
87
+
88
+ /**
89
+ * Called just before server deactivation and subsequent unloading of the
90
+ * plugin.
91
+ *
92
+ * @note The plugin is required to manually free Handles it has acquired, such
93
+ * as those from dynamic data structures. Failing to do that will result
94
+ * in the plugin and AMXX leaking memory.
95
+ *
96
+ * @noreturn
97
+ */
98
+ forward plugin_end();
99
+
100
+ /**
101
+ * Called when a message is about to be logged.
102
+ *
103
+ * @note Message data and information can be retrieved using the read_log* set
104
+ * of functions.
105
+ *
106
+ * @return PLUGIN_CONTINUE to let the log message through
107
+ * PLUGIN_HANDLED or higher to stop the log message
108
+ */
109
+ forward plugin_log();
110
+
111
+ /**
112
+ * This forward allows plugins to add models, sounds and generic files to the
113
+ * precache tables using the precache_* set of functions.
114
+ *
115
+ * @note Adding files to the precaching tables will trigger the client to
116
+ * download them to its local filesystem.
117
+ * @note There is a hard upper limit of entries in the precaching tables for
118
+ * every game, this limit is 512 in most cases. The entries will be filled
119
+ * and indexed incrementally. Going over this limit will crash the server.
120
+ *
121
+ * @noreturn
122
+ */
123
+ forward plugin_precache();
124
+
125
+ /**
126
+ * Called when a clients info has changed.
127
+ *
128
+ * @param id Client index
129
+ *
130
+ * @noreturn
131
+ */
132
+ forward client_infochanged(id);
133
+
134
+ /**
135
+ * Called when a client is connecting.
136
+ *
137
+ * @note This forward is called too early to do anything that directly affects
138
+ * the client.
139
+ *
140
+ * @param id Client index
141
+ *
142
+ * @noreturn
143
+ */
144
+ forward client_connect(id);
145
+
146
+ /**
147
+ * Called when a client is connecting.
148
+ *
149
+ * @note This forward is called too early to do anything that directly affects
150
+ * the client.
151
+ *
152
+ * @param id Client index
153
+ * @param name Client name
154
+ * @param ip Client ip address with port
155
+ * @param reason A reason that will be displayed when player gets rejected (can be overwritten)
156
+ *
157
+ * @return PLUGIN_CONTINUE to let a client join to the server
158
+ * PLUGIN_HANDLED or higher to prevent a client to join
159
+ */
160
+ forward client_connectex(id, const name[], const ip[], reason[128]);
161
+
162
+ /**
163
+ * Called when the client gets a valid SteamID.
164
+ *
165
+ * @note This may occur before or after client_putinserver has been called.
166
+ * @note This is called for bots, and the SteamID will be "BOT".
167
+ *
168
+ * @param id Client index
169
+ * @param authid Client auth
170
+ *
171
+ * @noreturn
172
+ */
173
+ forward client_authorized(id, const authid[]);
174
+
175
+ /**
176
+ * @deprecated This function does not catch all cases.
177
+ */
178
+ #pragma deprecated Use client_disconnected() instead.
179
+ forward client_disconnect(id);
180
+
181
+ /**
182
+ * Called when a client is disconnected from the server.
183
+ *
184
+ * @note This will be called in some additional cases that client_disconnect doesn't cover,
185
+ * most notably when a client aborts the connection process. It is guaranteed to pair
186
+ * with the client_connect() forward.
187
+ * @note When this fires the player entity is still valid (e.g. is_user_connected(id) will
188
+ * return true), but no networked commands will reach the client.
189
+ *
190
+ * @param id Client index
191
+ * @param drop If true, the game has explicitly dropped the client
192
+ * @param message If drop is true, a writable buffer containing the disconnect info message
193
+ * @param maxlen Maximum size of buffer
194
+ *
195
+ * @noreturn
196
+ */
197
+ forward client_disconnected(id, bool:drop, message[], maxlen);
198
+
199
+ /**
200
+ * Called when a client entity has been removed from the server.
201
+ *
202
+ * @note This fires after the client_disconnected() forward, when the player entity has been
203
+ * removed (e.g. is_user_connected(id) will return false).
204
+ *
205
+ * @param id Client index
206
+ * @param drop If true, the game has explicitly dropped the client
207
+ * @param message If drop is true, contains the disconnect info message
208
+ *
209
+ * @noreturn
210
+ */
211
+ forward client_remove(id, bool:drop, const message[]);
212
+
213
+
214
+ /**
215
+ * Called when a client attempts to execute a command.
216
+ *
217
+ * @note The command and its arguments can be read using the read_arg* set of
218
+ * functions.
219
+ *
220
+ * @param id Client index
221
+ *
222
+ * @return PLUGIN_CONTINUE to let the client execute the command
223
+ * PLUGIN_HANDLED or higher to stop the command
224
+ */
225
+ forward client_command(id);
226
+
227
+ /**
228
+ * Called when a client is entering the game.
229
+ *
230
+ * @note It is not defined whether the client already has a SteamID when this
231
+ * forward is called. client_authorized may occur either before or after
232
+ * this.
233
+ *
234
+ * @param id Client index
235
+ *
236
+ * @noreturn
237
+ */
238
+ forward client_putinserver(id);
239
+
240
+ /**
241
+ * Sets informations about the calling plugin.
242
+ *
243
+ * @param plugin_name Name of the plugin
244
+ * @param version Version of the plugin
245
+ * @param author Author of the plugin
246
+ * @param url URL of the plugin
247
+ * @param description Description of the plugin
248
+ *
249
+ * @return Plugin id of the calling plugin
250
+ */
251
+ native register_plugin(const plugin_name[], const version[], const author[], const url[] = "", const description[] = "");
252
+
253
+ /**
254
+ * Precaches a model file.
255
+ *
256
+ * @note Can only be used inside of the plugin_precache() forward.
257
+ *
258
+ * @param name Path to the model file
259
+ *
260
+ * @return Unique cache id of the model
261
+ * @error If called outside of the plugin_precache() forward, an error is
262
+ * thrown.
263
+ */
264
+ native precache_model(const name[]);
265
+
266
+ /**
267
+ * Precaches a sound file.
268
+ *
269
+ * @note Can only be used inside of the plugin_precache() forward.
270
+ * @note The filepath is always relative to the "sound" folder, and the file has
271
+ * to be a wav file. Precaching a file with this will add it to the engine
272
+ * sound table, making it available for usage in emit_sound() for example.
273
+ * @note Precaching other filetypes (such as mp3 music), optionally in different
274
+ * locations, has to be done with precache_generic()
275
+ *
276
+ * @param name Path to the sound file
277
+ *
278
+ * @return Unique cache id of the sound
279
+ * @error If called outside of the plugin_precache() forward, an error is
280
+ * thrown.
281
+ */
282
+ native precache_sound(const name[]);
283
+
284
+ /**
285
+ * Precaches a generic file.
286
+ *
287
+ * @note Can only be used inside of the plugin_precache() forward.
288
+ * @note Precaching sounds with this will not add them to the engine sound table.
289
+ *
290
+ * @param szFile Path to the file
291
+ *
292
+ * @return Unique cache id of the file
293
+ * @error If called outside of the plugin_precache() forward, an error
294
+ * is thrown.
295
+ */
296
+ native precache_generic(const szFile[]);
297
+
298
+ /**
299
+ * Precaches an event file.
300
+ *
301
+ * @note The event type should always be 1.
302
+ * @note Contrary to the other precache_* natives, this can be used outside of
303
+ * the plugin_precache() forward, e.g. in plugin_init() or plugin_cfg().
304
+ * A bug in some clients makes this necessary, as plugin_precache() is
305
+ * called before the mod has precached its own, default event files. This
306
+ * can cause the event table to be misaligned on the client, leading to
307
+ * visual and audio bugs that are hard to diagnose.
308
+ *
309
+ * @param type Event type
310
+ * @param Name Formatting rules, path to the event file
311
+ * @param ... Variable number of formatting parameters
312
+ *
313
+ * @return Unique cache id of the event
314
+ */
315
+ native precache_event(type, const Name[], any:...);
316
+
317
+ /**
318
+ * Changes the map.
319
+ *
320
+ * @note This calls the pfnChangelLevel engine function.
321
+ * @note This has the same behavior as using the "changelevel" server command,
322
+ * but will also trigger the server_changelevel() forward in AMXX
323
+ * plugins. It will also notify any Metamod plugins that are hooking
324
+ * the pfnChangeLevel function.
325
+ *
326
+ * @param map Map name to change to
327
+ *
328
+ * @noreturn
329
+ */
330
+ native engine_changelevel(const map[]);
331
+
332
+ /**
333
+ * Sets info on the client.
334
+ *
335
+ * @param index Client index
336
+ * @param info Info key
337
+ * @param value New value
338
+ *
339
+ * @noreturn
340
+ * @error If the index is not within the range of 1 to MaxClients or
341
+ * the client is not connected, an error will be thrown.
342
+ */
343
+ native set_user_info(index, const info[], const value[]);
344
+
345
+ /**
346
+ * Gets info from the client.
347
+ *
348
+ * @param index Client index
349
+ * @param info Info key
350
+ * @param output Buffer to copy value to
351
+ * @param len Maximum size of the buffer
352
+ *
353
+ * @return Number of cells written to buffer
354
+ * @error If the index is not within the range of 1 to MaxClients or
355
+ * the client is not connected, an error will be thrown.
356
+ */
357
+ native get_user_info(index, const info[], output[], len);
358
+
359
+ /**
360
+ * Sets info on the server.
361
+ *
362
+ * @param info Info key
363
+ * @param value New value
364
+ *
365
+ * @noreturn
366
+ */
367
+ native set_localinfo(const info[], const value[]);
368
+
369
+ /**
370
+ * Gets info from the server.
371
+ *
372
+ * @param info Info key
373
+ * @param output Buffer to copy value to
374
+ * @param len Maximum size of the buffer
375
+ *
376
+ * @return Number of cells written to buffer
377
+ */
378
+ native get_localinfo(const info[], output[], len);
379
+
380
+ /**
381
+ * Shows text or a file in MOTD window.
382
+ *
383
+ * @param player Client index, use 0 to display to all clients
384
+ * @param message Message to display inside the MOTD window, if this is a
385
+ * filename the contents of this file will be displayed
386
+ * @param header Text for the MOTD header, if empty the servers hostname will
387
+ * be displayed instead
388
+ *
389
+ * @noreturn
390
+ */
391
+ native show_motd(player, const message[], const header[] = "");
392
+
393
+ /**
394
+ * Sends a message to the client.
395
+ *
396
+ * @note This functions return value behaves differently depending on what is
397
+ * used as the client index: If 0 is specified, then the function will
398
+ * return 0 if nothing has been sent (no client connected). If either a
399
+ * single client is specified or there is at least one client connected,
400
+ * the number of printed characters will refer to the message that is sent
401
+ * last, to the client with the highest index.
402
+ *
403
+ * @param index Client index, use 0 to display to all clients
404
+ * @param type Message type, see print_* destination constants in
405
+ * amxconst.inc
406
+ * @param message Formatting rules
407
+ * @param ... Variable number of formatting parameters
408
+ *
409
+ * @return Number of printed characters
410
+ * @error If a single client is specified and the index is not within
411
+ * the range of 1 to MaxClients, an error will be thrown.
412
+ */
413
+ native client_print(index, type, const message[], any:...);
414
+
415
+ /**
416
+ * Sends colored chat messages to clients.
417
+ *
418
+ * @note This only works in Counter-Strike 1.6 and Condition Zero.
419
+ * @note The colors can be modified inside of the format string using special
420
+ * characters. These characters can be included using the escape character
421
+ * green x04 ; use location color from this point forward
422
+ * red/blue/grey x03 ; use team color from this point forward
423
+ * red/blue/grey x02 ; use team color to the end of the client name
424
+ * ; This only works at the start of the string,
425
+ * ; and precludes using other control characters
426
+ * default x01 ; use default color from this point forward
427
+ * @note The team color is defined by the sender's index. Alternatively, a
428
+ * specific team color can be enforced using the print_team_* constants in
429
+ * amxconst.inc
430
+ * @note Usage examples:
431
+ * client_print_color(id, print_team_red, "^4Green ^3Red ^1Default")
432
+ * client_print_color(id, id2, "^4Green ^3id2's team color, ^1Default")
433
+ * @note Including colors in ML can be done using the same escaping method:
434
+ * EXAMPLE_ML_KEY = ^4Green ^3Team color ^1Default
435
+ * @note This functions return value behaves differently depending on what is
436
+ * used as the client index: If 0 is specified, then the function will
437
+ * return 0 if nothing has been sent (no client connected). If either a
438
+ * single client is specified, or there is at least one client connected,
439
+ * the number of printed characters will refer to the message that is sent
440
+ * last, to the client with the highest index.
441
+ *
442
+ * @param index Client index, use 0 to display to all clients
443
+ * @param sender Client index used as the message sender
444
+ * @param fmt Formatting rules
445
+ * @param ... Variable number of formatting parameters
446
+ *
447
+ * @return Number of printed characters
448
+ * @error If a single client is specified and the index is not within
449
+ * the range of 1 to MaxClients, an error will be thrown.
450
+ */
451
+ native client_print_color(index, sender, const message[], any:...);
452
+
453
+ /**
454
+ * Sends a message to the client via the engine.
455
+ *
456
+ * @note This functions return value behaves differently depending on what is
457
+ * used as the client index: If 0 is specified, then the function will
458
+ * return 0 if nothing has been sent (no client connected). If either a
459
+ * single client is specified, or there is at least one client connected,
460
+ * the number of printed characters will refer to the message that is sent
461
+ * last, to the client with the highest index.
462
+ *
463
+ * @param player Client index, use 0 to display to all clients
464
+ * @param type Message type, see engprint_* destination constants in
465
+ * amxconst.inc
466
+ * @param message Formatting rules
467
+ * @param ... Variable number of formatting parameters
468
+ *
469
+ * @return Number of printed characters
470
+ * @error If a single client is specified and the index is not within
471
+ * the range of 1 to MaxClients, an error will be thrown.
472
+ */
473
+ native engclient_print(player, type, const message[], any:...);
474
+
475
+ /**
476
+ * Sends a message to the console of a client or the server.
477
+ *
478
+ * @param index Client index, or 0 to print to the server console
479
+ * @param message Formatting rules
480
+ * @param ... Variable number of formatting parameters
481
+ *
482
+ * @return Number of printed characters
483
+ * @error If a single client is specified and the index is not within
484
+ * the range of 1 to MaxClients, an error will be thrown.
485
+ */
486
+ native console_print(id, const message[], any:...);
487
+
488
+ /**
489
+ * Executes a command from the specified client or the server console.
490
+ *
491
+ * @param id Client index, or 0 to execute from the server console
492
+ * @param cmd Formatting rules
493
+ * @param ... Variable number of formatting parameters
494
+ *
495
+ * @return Length of the formatted command
496
+ */
497
+ native console_cmd(id, const cmd[], any:...);
498
+
499
+ /**
500
+ * Registers a function to be called on a given game event.
501
+ *
502
+ * @note Please consider using register_event_ex() instead which allows you to
503
+ * use named constants for flags instead of letters.
504
+ * @note Examples for event conditions:
505
+ * "2=c4" - Second parameter of message must be the string "c4"
506
+ * "3>10" - Third parameter of message must be greater than 10
507
+ * "3!4" - Third parameter of message must not be equal to 4
508
+ * "2&Buy" - Second parameter of message must contain "Buy" substring
509
+ * "2!Buy" - Second parameter of message must not equal "Buy"
510
+ * @note Due to a long-standing bug that would break compatibility with older
511
+ * plugins, the client id should be checked for alive/dead state if using
512
+ * flags "d" or "e".
513
+ * @note If multiple conditions are specified for a single parameter, only one
514
+ * of them has to hold true for the event function to be called.
515
+ *
516
+ * @param event Name of event that should be hooked
517
+ * @param function Name of callback function
518
+ * @param flags Flags used for filtering events, the valid flags are:
519
+ * "a" - Global event (sent to every client)
520
+ * "b" - Event sent to single client
521
+ * "c" - Call only once when repeated to multiple clients
522
+ * "d" - Call only if sent to dead client
523
+ * "e" - Call only if sent to alive client
524
+ * "f" - Call only if sent to human client ("b" flag required)
525
+ * "g" - Call only if sent to bot ("b" flag required)
526
+ * @param cond Condition string used for filtering events, built as:
527
+ * "<argument number><comparison operator><value>"
528
+ * Argument number is the argument position to be filtered
529
+ * The comparison operator may be:
530
+ * - "=" for equality comparison (all argument types)
531
+ * - "!" for inequality comparison (all argument types)
532
+ * - "&" for bitwise and (int argument) or substring
533
+ * comparison (string argument)
534
+ * - "<" for less than comparison (int/float arguments)
535
+ * - ">" for greater than comparison (int/float arguments)
536
+ * The argument is compared to the specified value accordingly
537
+ * @param ... Any number of additional conditions
538
+ *
539
+ * @return Event handle
540
+ * @error If an invalid event name or callback function is provided,
541
+ * an error will be thrown.
542
+ */
543
+ native register_event(const event[], const function[], const flags[], const cond[] = "", ...);
544
+
545
+ /**
546
+ * Registers a function to be called on a given game event.
547
+ *
548
+ * @note Examples for event conditions:
549
+ * "2=c4" - Second parameter of message must be the string "c4"
550
+ * "3>10" - Third parameter of message must be greater than 10
551
+ * "3!4" - Third parameter of message must not be equal to 4
552
+ * "2&Buy" - Second parameter of message must contain "Buy" substring
553
+ * "2!Buy" - Second parameter of message must not equal "Buy"
554
+ * @note Due to a long-standing bug that would break compatibility with older
555
+ * plugins, the client id should be checked for alive/dead state if using
556
+ * flags "d" or "e".
557
+ * @note If multiple conditions are specified for a single parameter, only one
558
+ * of them has to hold true for the event function to be called.
559
+ *
560
+ * @param event Name of event that should be hooked
561
+ * @param function Name of callback function
562
+ * @param flags Flags used for filtering events (enum RegisterEventFlags); the valid flags are:
563
+ * RegisterEvent_Global - Global event (sent to every client)
564
+ * RegisterEvent_Single - Event sent to single client
565
+ * RegisterEvent_OnceForMultiple - Call only once when repeated to multiple clients
566
+ * RegisterEvent_OnlyDead - Call only if sent to dead client
567
+ * RegisterEvent_OnlyAlive - Call only if sent to alive client
568
+ * RegisterEvent_OnlyHuman - Call only if sent to human client (RegisterEvent_Single required)
569
+ * RegisterEvent_OnlyBots - Call only if sent to bot (RegisterEvent_Single required)
570
+ * @param cond Condition string used for filtering events, built as:
571
+ * "<argument number><comparison operator><value>"
572
+ * Argument number is the argument position to be filtered
573
+ * The comparison operator may be:
574
+ * "=" for equality comparison (all argument types)
575
+ * "!" for inequality comparison (all argument types)
576
+ * "&" for bitwise and (int argument) or substring
577
+ * comparison (string argument)
578
+ * "<" for less than comparison (int/float arguments)
579
+ * ">" for greater than comparison (int/float arguments)
580
+ * The argument is compared to the specified value accordingly
581
+ * @param ... Any number of additional conditions
582
+ *
583
+ * @return Event handle
584
+ * @error If an invalid event name or callback function is provided,
585
+ * an error will be thrown.
586
+ */
587
+ native register_event_ex(const event[], const function[], RegisterEventFlags:flags, const cond[] = "", ...);
588
+
589
+ /**
590
+ * Enables a function hook of a game event which has been previously registered with register_event_ex().
591
+ *
592
+ * @param handle Value returned from register_event() or register_event_ex()
593
+ *
594
+ * @noreturn
595
+ * @error If an invalid handle is provided, an error will be thrown.
596
+ */
597
+ native enable_event(handle);
598
+
599
+ /**
600
+ * Disables a function hook of a game event which has been previously registered with register_event_ex().
601
+ *
602
+ * @param handle Value returned from register_event() or register_event_ex()
603
+ *
604
+ * @noreturn
605
+ * @error If an invalid handle is provided, an error will be thrown.
606
+ */
607
+ native disable_event(handle);
608
+
609
+ /**
610
+ * Registers a function to be called on a given log event.
611
+ *
612
+ * @note Examples for log conditions:
613
+ * "0 = World triggered" "1 = Game_Commencing"
614
+ * "1 = say"
615
+ * "3 = Terrorists_Win"
616
+ * "1 = entered the game"
617
+ * "0 = Server cvar"
618
+ *
619
+ * @param function Name of callback function
620
+ * @param argsnum Number of arguments of the log event
621
+ * @param ... Any number of conditions used for filtering events
622
+ * A condition string is built as:
623
+ * "<argument number><comparison operator><string>"
624
+ * Argument number is the argument position to be filtered
625
+ * The comparison operator may be:
626
+ * - "=" for equality comparison
627
+ * - "&" for substring comparison
628
+ * The argument is compared to the specified string accordingly
629
+ *
630
+ * @return Log event handle
631
+ * @error If an invalid callback function is provided, an error will
632
+ * be thrown.
633
+ */
634
+ native register_logevent(const function[], argsnum, ...);
635
+
636
+ /**
637
+ * Enables a function hook of a game log event which has been previously registered with register_logevent().
638
+ *
639
+ * @param handle Value returned from register_logevent()
640
+ *
641
+ * @noreturn
642
+ * @error If an invalid handle is provided, an error will be thrown.
643
+ */
644
+ native enable_logevent(handle);
645
+
646
+ /**
647
+ * Disables a function hook of a game log event which has been previously registered with register_logevent().
648
+ *
649
+ * @param handle Value returned from register_logevent()
650
+ *
651
+ * @noreturn
652
+ * @error If an invalid handle is provided, an error will be thrown.
653
+ */
654
+ native disable_logevent(handle);
655
+
656
+ /**
657
+ * Sets display parameters for hudmessages.
658
+ *
659
+ * @note As of AMXX 1.61, setting the channel to -1 will automatically choose
660
+ * the next available HUD channel for the client.
661
+ * @note There are four different HUD channels available on the client (1-4).
662
+ * Sending a hudmessage to a channel will overwrite any existing messages
663
+ * already displaying on that channel.
664
+ * @note If you plan to create a permanent message, don't forget to specify a
665
+ * specific channel to avoid possible flickering due to auto-channeling.
666
+ * @note For the hudmessage coordinates x and y, -1.0 will center the message
667
+ * on the respective axis.
668
+ * @note These parameters stay until the next call to set_hudmessage overwrites
669
+ * them. Multiple calls to show_hudmessage will therefore re-use the same
670
+ * parameters. The parameters are not stored per-plugin, so other plugins
671
+ * can overwrite them.
672
+ *
673
+ * @param red Red component of hudmessage color
674
+ * @param green Green component of hudmessage color
675
+ * @param blue Blue component of hudmessage color
676
+ * @param x Location of the message on the x axis in percent
677
+ * @param y Location of the message on the y axis in percent
678
+ * @param effects Display effect
679
+ * @param fxtime Duration of the effect
680
+ * @param holdtime Time the message stays on screen
681
+ * @param fadeintime Time it takes the message to fully appear (fade-in)
682
+ * @param fadeouttime Time it takes the message to fully disappear (fade-out)
683
+ * @param channel Channel to use on the client
684
+ * @param alpha1 Alpha component of hudmessage color
685
+ * @param color2[4] Color 2 array {r,g,b,a}
686
+ *
687
+ * @noreturn
688
+ */
689
+ native set_hudmessage(red = 200, green = 100, blue = 0, Float:x = -1.0, Float:y = 0.35, effects = 0, Float:fxtime = 6.0, Float:holdtime = 12.0, Float:fadeintime = 0.1, Float:fadeouttime = 0.2, channel = -1, alpha1 = 0, color2[4] = {255, 255, 250, 0});
690
+
691
+ /**
692
+ * Displays a message on the client HUD.
693
+ *
694
+ * @note Use set_hudmessage to define how the message should look on screen.
695
+ * @note This functions return value behaves differently depending on what is
696
+ * used as the client index: If 0 is specified, then the function will
697
+ * return 0 if nothing has been sent (no client connected). If either a
698
+ * single client is specified, or there is at least one client connected,
699
+ * the number of printed characters will refer to the message that is sent
700
+ * last, to the client with the highest index.
701
+ *
702
+ * @param index Client index, use 0 to display to all clients
703
+ * @param message Formatting rules
704
+ * @param ... Variable number of formatting parameters
705
+ *
706
+ * @return Number of printed characters
707
+ * @error If a single client is specified and the index is not within
708
+ * the range of 1 to MaxClients, an error will be thrown.
709
+ */
710
+ native show_hudmessage(index, const message[], any:...);
711
+
712
+ /**
713
+ * Sets display parameters for director hudmessages.
714
+ *
715
+ * @note For the hudmessage coordinates x and y, -1.0 will center the message
716
+ * on the respective axis.
717
+ * @note These parameters stay until the next call to set_dhudmessage overwrites
718
+ * them. Multiple calls to show_dhudmessage will therefore re-use the same
719
+ * parameters. The parameters are not stored per-plugin, so other plugins
720
+ * can overwrite them.
721
+ *
722
+ * @param red Red component of hudmessage color
723
+ * @param green Green component of hudmessage color
724
+ * @param blue Blue component of hudmessage color
725
+ * @param x Location of the message on the x axis in percent
726
+ * @param y Location of the message on the y axis in percent
727
+ * @param effects Display effect
728
+ * @param fxtime Duration of the effect
729
+ * @param holdtime Time the message stays on screen
730
+ * @param fadeintime Time it takes the message to fully appear (fade-in)
731
+ * @param fadeouttime Time it takes the message to fully disappear (fade-out)
732
+ *
733
+ * @noreturn
734
+ */
735
+ native set_dhudmessage(red = 200, green = 100, blue = 0, Float:x = -1.0, Float:y = 0.35, effects = 0, Float:fxtime = 6.0, Float:holdtime = 12.0, Float:fadeintime = 0.1, Float:fadeouttime = 0.2);
736
+
737
+ /**
738
+ * Displays a director message on the client HUD.
739
+ *
740
+ * @note Use set_dhudmessage to define how the message should look on screen.
741
+ * @note Unlike the classic HUD message, which is channel-based, director
742
+ * messages are stack-based. You can have up to 8 messages displaying at
743
+ * once. If more are added, they will be overwritten in the order they were
744
+ * sent. There is no way to clear a specific message.
745
+ * @note The message has a maximum length of 128 characters which this function
746
+ * will automatically enforce.
747
+ * @note This functions return value behaves differently depending on what is
748
+ * used as the client index: If 0 is specified, then the function will
749
+ * return 0 if nothing has been sent (no client connected). If either a
750
+ * single client is specified, or there is at least one client connected,
751
+ * the number of printed characters will refer to the message that is sent
752
+ * last, to the client with the highest index.
753
+ *
754
+ * @param index Client index, use 0 to display to all clients
755
+ * @param message Formatting rules
756
+ * @param ... Variable number of formatting parameters
757
+ *
758
+ * @return Number of printed characters
759
+ * @error If a single client is specified and the index is not within
760
+ * the range of 1 to MaxClients, an error will be thrown.
761
+ */
762
+ native show_dhudmessage(index, const message[], any:...);
763
+
764
+ /**
765
+ * Displays a menu to the client.
766
+ *
767
+ * @note Keys is a bitflag value that represents which keys the user can press
768
+ * on the menu. If you want to display disabled menu options, or skip
769
+ * certain number slots, you should exclude that key from the bitflag.
770
+ * amxconst.inc provides MENU_KEY_* constants for convenience.
771
+ * @note The title parameter is not displayed to the client and is only used for
772
+ * identifying menus internally and assigning them to their callbacks.
773
+ * The title corresponds to the menu name that you register with
774
+ * register_menuid()
775
+ *
776
+ * @param index Client to display menu to, use 0 to display to all clients
777
+ * @param keys Enabled keys
778
+ * @param menu Menu body
779
+ * @param time Menu timeout in seconds, -1 to disable
780
+ * @param title Name of the menu for internal tracking purposes
781
+ *
782
+ * @return 1 on success, 0 if menu could not be displayed (client not
783
+ * connected)
784
+ * @error If a single client is specified and the index is not within
785
+ * the range of 1 to MaxClients, an error will be thrown.
786
+ */
787
+ native show_menu(index, keys, const menu[], time = -1, const title[] = "");
788
+
789
+ /**
790
+ * Retrieves values from a client message.
791
+ *
792
+ * @note For use within callbacks registered with register_event_ex()
793
+ * @note Usage examples:
794
+ * value = read_data(1);
795
+ * read_data(2, floatvalue);
796
+ * written = read_data(3, buffer, buffersize);
797
+ *
798
+ * @param value Argument number to retrieve value from
799
+ * @param ... Changes the native's behavior depending on how many
800
+ * additional parameters are provided:
801
+ * 0 - Return the argument integer value directly
802
+ * 1 - Store the argument float value in the variable passed
803
+ * as the second parameter
804
+ * 2 - Copy the argument string value to the buffer provided
805
+ * in the second parameter, using the third as the
806
+ * maximum buffer size
807
+ *
808
+ * @return Changes depending on how many additional parameters are
809
+ * provided:
810
+ * 0 - Returns the argument integer value
811
+ * 1 - Returns the argument float value, converted
812
+ * (truncated) to an integer
813
+ * 2 - Returns the number of cells written to the buffer
814
+ */
815
+ native read_data(value, any:...);
816
+
817
+ /**
818
+ * Returns the number of values in the client message.
819
+ *
820
+ * @note For use within callbacks registered with register_event_ex()
821
+ *
822
+ * @return Number of values in client message
823
+ */
824
+ native read_datanum();
825
+
826
+ /**
827
+ * Returns the message id of the client message.
828
+ *
829
+ * @note For use within callbacks registered with register_event_ex()
830
+ *
831
+ * @return Message id of the client message
832
+ */
833
+ native read_datatype();
834
+
835
+ /**
836
+ * Retrieves current log message.
837
+ *
838
+ * @note Should only be used inside of the plugin_log() forward.
839
+ *
840
+ * @param output Buffer to copy log message to
841
+ * @param len Maximum buffer size
842
+ *
843
+ * @return Number of cells written to buffer
844
+ */
845
+ native read_logdata(output[], len);
846
+
847
+ /**
848
+ * Returns number of log message arguments.
849
+ *
850
+ * @note Should only be used inside of the plugin_log() forward.
851
+ *
852
+ * @return Number of arguments in the log message
853
+ */
854
+ native read_logargc();
855
+
856
+ /**
857
+ * Retrieves argument of log message.
858
+ *
859
+ * @note Should only be used inside of the plugin_log() forward.
860
+ *
861
+ * @param id Argument index, starting from 0
862
+ * @param output Buffer to copy log argument to
863
+ * @param len Maximum buffer size
864
+ *
865
+ * @return Number of cells written to buffer
866
+ */
867
+ native read_logargv(id, output[], len);
868
+
869
+ /**
870
+ * Parse log data about client.
871
+ *
872
+ * @note When client actions are logged, they appear in the the format
873
+ * "Name<#userid><SteamID><teamname>", this native extracts the individual
874
+ * pieces of information.
875
+ *
876
+ * @param text String to process
877
+ * @param name Buffer to copy client name to
878
+ * @param nlen Maximum name buffer size
879
+ * @param userid Variable to store userid in
880
+ * @param authid Buffer to copy client authid to
881
+ * @param alen Maximum auth buffer size
882
+ * @param team Buffer to copy client team to
883
+ * @param tlen Maximum team buffer size
884
+ *
885
+ * @noreturn
886
+ * @error If the provided string is not valid client log data, an
887
+ * error will be thrown.
888
+ */
889
+ native parse_loguser(const text[], name[], nlen, &userid =-2, authid[] = "", alen = 0, team[] = "", tlen = 0);
890
+
891
+ /**
892
+ * Sends a message to the console of the server.
893
+ *
894
+ * @param message Formatting rules
895
+ * @param ... Variable number of formatting parameters
896
+ *
897
+ * @return Number of printed characters
898
+ */
899
+ native server_print(const message[], any:...);
900
+
901
+ /**
902
+ * Returns if the given mapname is deemed valid by the engine.
903
+ *
904
+ * @param mapname Name of the map
905
+ *
906
+ * @return 1 if the map name is valid, 0 otherwise
907
+ */
908
+ native is_map_valid(const mapname[]);
909
+
910
+ /**
911
+ * Returns if the client is a bot.
912
+ *
913
+ * @param index Client index
914
+ *
915
+ * @return 1 if client is a bot, 0 otherwise
916
+ */
917
+ native is_user_bot(index);
918
+
919
+ /**
920
+ * Returns if the client is a HLTV proxy.
921
+ *
922
+ * @param index Client index
923
+ *
924
+ * @return 1 if client is a HLTV proxy, 0 otherwise
925
+ */
926
+ native is_user_hltv(index);
927
+
928
+ /**
929
+ * Returns if the client is authorized.
930
+ *
931
+ * @note This does not throw an error if the provided index is out of the
932
+ * 1 to MaxClients range. That means you can safely use this native
933
+ * without manually verifying that the index is a valid client index.
934
+ *
935
+ * @param index Client index
936
+ *
937
+ * @return 1 if client is authorized, 0 otherwise
938
+ */
939
+ native is_user_authorized(index);
940
+
941
+ /**
942
+ * Returns if the client is connected.
943
+ *
944
+ * @note This does not throw an error if the provided index is out of the
945
+ * 1 to MaxClients range. That means you can safely use this native
946
+ * without manually verifying that the index is a valid client index.
947
+ *
948
+ * @param index Client index
949
+ *
950
+ * @return 1 if client is connected, 0 otherwise
951
+ */
952
+ native is_user_connected(index);
953
+
954
+ /**
955
+ * Returns if the client is connecting.
956
+ *
957
+ * @param index Client index
958
+ *
959
+ * @return 1 if client is connecting, 0 otherwise
960
+ */
961
+ native is_user_connecting(index);
962
+
963
+ /**
964
+ * Returns if the client is alive.
965
+ *
966
+ * @note This will never return true if a client is not connected. If you need
967
+ * to know whether a client is alive, an additional call to
968
+ * is_user_connected() is unnecessary.
969
+ *
970
+ * @param index Client index
971
+ *
972
+ * @return 1 if client is alive, 0 otherwise
973
+ */
974
+ native is_user_alive(index);
975
+
976
+ /**
977
+ * Returns if the server is a dedicated server.
978
+ *
979
+ * @return 1 if server is a dedicated server, 0 otherwise
980
+ */
981
+ native is_dedicated_server();
982
+
983
+ /**
984
+ * Returns if the server is running on Linux.
985
+ *
986
+ * @return 1 if server is running on Linux, 0 otherwise
987
+ */
988
+ native is_linux_server();
989
+
990
+ /**
991
+ * Returns if the AMXX installation has the JIT enabled.
992
+ *
993
+ * @return 1 if JIT is enabled, 0 otherwise
994
+ */
995
+ native is_jit_enabled();
996
+
997
+ /**
998
+ * Retrieves the version string of the AMXX installation.
999
+ *
1000
+ * @param buffer Buffer to copy version to
1001
+ * @param length Maximum buffer size
1002
+ *
1003
+ * @return Number of cells written to the buffer
1004
+ */
1005
+ native get_amxx_verstring(buffer[], length);
1006
+
1007
+ /**
1008
+ * Returns the last known attacker of a client.
1009
+ *
1010
+ * @note As of AMXX 1.75 this can return a non-client entity index if the client
1011
+ * was attacked by a non-client entity.
1012
+ *
1013
+ * @param index Client index
1014
+ * @param ... If provided, the attacker weapon will be stored in an
1015
+ * optional second parameter, and the body hit place will be
1016
+ * stored in an optional third parameter
1017
+ *
1018
+ * @return Attacker client index, a non-client entity or 0 if no
1019
+ * attacker was found
1020
+ * @error If the client index is not within the range of 1 to
1021
+ * MaxClients, an error will be thrown.
1022
+ */
1023
+ native get_user_attacker(index, ...);
1024
+
1025
+ /**
1026
+ * Traces the client's current aim vector to see if it hits something.
1027
+ *
1028
+ * @note If the trace does not hit a client, id and body will be set to 0.
1029
+ * @note If the trace hits nothing within the specified distance, 0 is returned.
1030
+ * @note For a list of possible body hitplaces see the HIT_* constants in amxconst.inc.
1031
+ *
1032
+ * @param index Client index to trace aim from
1033
+ * @param id Variable to store hit client index (if applicable)
1034
+ * @param body Variable to store hit client body part (if applicable)
1035
+ * @param dist Maximum distance of the trace
1036
+ *
1037
+ * @return Distance between the trace start and end point
1038
+ * @error If the client index is not within the range of 1 to
1039
+ * MaxClients, an error will be thrown.
1040
+ */
1041
+ native Float:get_user_aiming(index, &id, &body = HIT_GENERIC, dist = 9999);
1042
+
1043
+ /**
1044
+ * Returns the client's frags.
1045
+ *
1046
+ * @note While this is mod-independent, the mod may track frag count differently,
1047
+ * so it can only be retrieved using another native or other methods.
1048
+ * @note This will actually return the client's overall score, which may or may
1049
+ * not be equal to their scored frags depending on the mod.
1050
+ *
1051
+ * @param index Client index
1052
+ *
1053
+ * @return Frags/Score of the client. Also returns 0 if the client is
1054
+ * not connected or the index is not within the range of
1055
+ * 1 to MaxClients
1056
+ */
1057
+ native get_user_frags(index);
1058
+
1059
+ /**
1060
+ * Returns the client's armor value.
1061
+ *
1062
+ * @note While this is mod-independent, the mod may track armor data differently,
1063
+ * so it can only be retrieved using another native or other methods.
1064
+ *
1065
+ * @param index Client index
1066
+ *
1067
+ * @return Amount of armor the client has. Also returns 0 if the client
1068
+ * is not connected or the index is not within the range of
1069
+ * 1 to MaxClients
1070
+ */
1071
+ native get_user_armor(index);
1072
+
1073
+ /**
1074
+ * Returns the client's death count.
1075
+ *
1076
+ * @note While this is mod-independent, the mod may track death count differently,
1077
+ * so it can only be retrieved using another native or other methods.
1078
+ *
1079
+ * @param index Client index
1080
+ *
1081
+ * @return Amount of deaths the client has. Also returns 0 if the
1082
+ * client is not connected or the index is not within the range
1083
+ * of 1 to MaxClients
1084
+ */
1085
+ native get_user_deaths(index);
1086
+
1087
+ /**
1088
+ * Returns the client's health points.
1089
+ *
1090
+ * @note While this is mod-independent, the mod may track health points
1091
+ * differently, so it can only be retrieved using another native or other
1092
+ * methods.
1093
+ *
1094
+ * @param index Client index
1095
+ *
1096
+ * @return Amount of health points the client has. Also returns 0 if
1097
+ * the client is not connected or the index is not within the
1098
+ * range of 1 to MaxClients
1099
+ */
1100
+ native get_user_health(index);
1101
+
1102
+ /**
1103
+ * Retrieves a client's index by name.
1104
+ *
1105
+ * @param name Name to search for
1106
+ *
1107
+ * @return Client index on success, 0 otherwise
1108
+ */
1109
+ native get_user_index(const name[]);
1110
+
1111
+ /**
1112
+ * Retrieves the IP of a client or the server.
1113
+ *
1114
+ * @param index Client index, use 0 to retrieve the server IP
1115
+ * @param ip Buffer to copy IP to
1116
+ * @param len Maximum buffer size
1117
+ * @param without_port Remove the port from the IP if nonzero
1118
+ *
1119
+ * @return Number of cells written to the buffer
1120
+ */
1121
+ native get_user_ip(index, ip[], len, without_port = 0);
1122
+
1123
+ /**
1124
+ * Returns if the client has the specified weapon in their inventory.
1125
+ *
1126
+ * @param index Client index
1127
+ * @param weapon Weapon index
1128
+ * @param setweapon If zero the weapon bit will be removed from the client's
1129
+ * inventory, if 1 it will be set
1130
+ *
1131
+ * @return 1 if the weapon is present, 0 if it is not
1132
+ * @error If the client index is not within the range of 1 to
1133
+ * MaxClients, an error will be thrown.
1134
+ */
1135
+ native user_has_weapon(index, weapon, setweapon = -1);
1136
+
1137
+ /**
1138
+ * Returns weapon index of the currently carried weapon. Also allows retrieval
1139
+ * of ammo in the clip and backpack.
1140
+ *
1141
+ * @param index Client index
1142
+ * @param clip Optional variable to store clip ammo to
1143
+ * @param ammo Optional variable to store backpack ammo to
1144
+ *
1145
+ * @return Weapon index on success or 0 if the client is not connected
1146
+ * @error If the client index is not within the range of 1 to
1147
+ * MaxClients, an error will be thrown.
1148
+ */
1149
+ native get_user_weapon(index, &clip = 0, &ammo = 0);
1150
+
1151
+ /**
1152
+ * Retrieves ammo in the clip and backpack of the specified weapon.
1153
+ *
1154
+ * @param index Client index
1155
+ * @param weapon Weapon index
1156
+ * @param clip Variable to store clip ammo to
1157
+ * @param ammo Variable to store backpack ammo to
1158
+ *
1159
+ * @return 1 on success or 0 if the client is not connected
1160
+ * @error If the client index is not within the range of 1 to
1161
+ * MaxClients or the weapon index is invalid, an error will
1162
+ * be thrown.
1163
+ */
1164
+ native get_user_ammo(index, weapon, &clip, &ammo);
1165
+
1166
+ /**
1167
+ * Converts an integer to a text string.
1168
+ *
1169
+ * @note The conversion algorithm is limited to a certain range of numbers, but
1170
+ * is guaranteed to work correctly for all numbers from 0 to 999. Outside
1171
+ * of that range, the conversion will result in an incorrect string, but
1172
+ * will not fail.
1173
+ * @note The conversion is to english text, there is no way to change this.
1174
+ *
1175
+ * @param num Integer to convert
1176
+ * @param output Buffer to copy string to
1177
+ * @param len Maximum buffer size
1178
+ *
1179
+ * @return Number of cells written to buffer
1180
+ */
1181
+ native num_to_word(num, output[], len);
1182
+
1183
+ /**
1184
+ * Returns the team id of the client, and optionally retrieves the name of
1185
+ * the team.
1186
+ *
1187
+ * @param index Client index
1188
+ * @param team Buffer to copy team name to
1189
+ * @param len Maximum size of buffer
1190
+ *
1191
+ * @return Team index on success, -1 if client index is invalid or
1192
+ * the client is not connected
1193
+ */
1194
+ native get_user_team(index, team[] = "", len = 0);
1195
+
1196
+ /**
1197
+ * Returns client's playing time in seconds.
1198
+ *
1199
+ * @param index Client index
1200
+ * @param flag If nonzero, the result will not include the time it took
1201
+ * the client to connect.
1202
+ *
1203
+ * @return Connection time in seconds, 0 if client index is invalid or
1204
+ * client is not connected
1205
+ */
1206
+ native get_user_time(index, flag = 0);
1207
+
1208
+ /**
1209
+ * Retrieves the ping and loss of a client.
1210
+ *
1211
+ * @param index Client index
1212
+ * @param ping Variable to store ping in
1213
+ * @param loss Variable to store loss in
1214
+ *
1215
+ * @return 1 on success, 0 if client index is invalid or the client
1216
+ * is not connected
1217
+ */
1218
+ native get_user_ping(index, &ping, &loss);
1219
+
1220
+ /**
1221
+ * Retrieves an origin related to the client.
1222
+ *
1223
+ * @note For a list of possible modes see the Origin_* constants in amxconst.inc.
1224
+ *
1225
+ * @param index Client index
1226
+ * @param origin Array to store origin in
1227
+ * @param mode What type of origin to retrieve:
1228
+ * Origin_Client - current position
1229
+ * Origin_Eyes - position of eyes (and weapon)
1230
+ * Origin_AimEndClient - aim end position from client position
1231
+ * Origin_AimEndEyes - aim end position from eyes (hit point for weapon)
1232
+ * Origin_CS_LastBullet - position of last bullet hit (only for Counter-Strike)
1233
+ *
1234
+ * @return 1 on success, 0 if client is not connected
1235
+ * @error If the client index is not within the range of 1 to
1236
+ * MaxClients, an error will be thrown.
1237
+ */
1238
+ native get_user_origin(index, origin[3], mode = 0);
1239
+
1240
+ /**
1241
+ * Retrieves all weapons in the client inventory, stores them in an array, and
1242
+ * returns the inventory as a bitflag sum.
1243
+ *
1244
+ * @note Make sure that num has an initial value of 0 or the native will not
1245
+ * work correctly.
1246
+ *
1247
+ * @param index Client index
1248
+ * @param weapons Array to store weapon indexes in
1249
+ * @param num Variable to store number of weapons in the inventory to
1250
+ *
1251
+ * @return Bitflag sum of weapon indexes, 0 if client is not connected
1252
+ * @error If the client index is not within the range of 1 to
1253
+ * MaxClients, an error will be thrown.
1254
+ */
1255
+ native get_user_weapons(index, weapons[32], &num);
1256
+
1257
+ /**
1258
+ * Retrieves the full name of a weapon.
1259
+ *
1260
+ * @param id Weapon index
1261
+ * @param weapon Buffer to copy name to
1262
+ * @param len Maximum buffer size
1263
+ *
1264
+ * @return Number of cells written to buffer
1265
+ */
1266
+ native get_weaponname(id, weapon[], len);
1267
+
1268
+ /**
1269
+ * Retrieves the name of a client or the server.
1270
+ *
1271
+ * @param index Client index, or 0 to retrieve the server hostname
1272
+ * @param name Buffer to copy name to
1273
+ * @param len Maximum buffer size
1274
+ *
1275
+ * @return Number of cells written to buffer
1276
+ */
1277
+ native get_user_name(index, name[], len);
1278
+
1279
+ /**
1280
+ * Retrieves the SteamID of a client.
1281
+ *
1282
+ * @note The SteamID is only available once the client_authorized() forward has
1283
+ * been called for the client.
1284
+ *
1285
+ * @param index Client index
1286
+ * @param authid Buffer to copy auth to
1287
+ * @param len Maximum buffer size
1288
+ *
1289
+ * @return Number of cells written to buffer
1290
+ */
1291
+ native get_user_authid(index, authid[], len);
1292
+
1293
+ /**
1294
+ * Returns the userid of a client.
1295
+ *
1296
+ * @param index Client index
1297
+ *
1298
+ * @return Client userid, 0 if the userid is not available or the
1299
+ * client index is invalid
1300
+ */
1301
+ native get_user_userid(index);
1302
+
1303
+ /**
1304
+ * Slaps the client with specified power. Killing the client if applicable.
1305
+ *
1306
+ * @note This removes "power" amount of health from the client, performing
1307
+ * a kill if they have no health left after the slap.
1308
+ * @note The function will apply a velocity to the client that is independent
1309
+ * of the slap power. The slap direction can be influenced by the third
1310
+ * parameter.
1311
+ *
1312
+ * @param index Client index
1313
+ * @param power Power of the slap
1314
+ * @param rnddir If set to zero the player will be slapped along it's aim
1315
+ * vector, otherwise the direction will be randomized
1316
+ *
1317
+ * @return 1 if user is alive and slap succeeded, 0 otherwise
1318
+ */
1319
+ native user_slap(index, power, rnddir = 1);
1320
+
1321
+ /**
1322
+ * Kills a client.
1323
+ *
1324
+ * @param index Client index
1325
+ * @param flag If nonzero, the death will not affect the client's score
1326
+ *
1327
+ * @return 1 on success, 0 if client index is invalid or the client
1328
+ * is not connected
1329
+ */
1330
+ native user_kill(index, flag = 0);
1331
+
1332
+ /**
1333
+ * Logs a message to the current AMXX log file.
1334
+ *
1335
+ * @note The message will automatically be tagged with the plugin's name and the
1336
+ * log will include a timestamp with the message.
1337
+ *
1338
+ * @param string Formatting rules
1339
+ * @param ... Variable number of formatting parameters
1340
+ *
1341
+ * @noreturn
1342
+ */
1343
+ native log_amx(const string[], any:...);
1344
+
1345
+ /**
1346
+ * Logs a message to the current server log file.
1347
+ *
1348
+ * @note The log will include a timestamp with the message.
1349
+ *
1350
+ * @param string Formatting rules
1351
+ * @param ... Variable number of formatting parameters
1352
+ *
1353
+ * @return Number of printed characters
1354
+ */
1355
+ native log_message(const message[], any:...);
1356
+
1357
+ /**
1358
+ * Logs a message hookable by plugins to the current server log file.
1359
+ *
1360
+ * @note The log will include a timestamp with the message.
1361
+ * @note The message can be hooked using "register_logevent".
1362
+ *
1363
+ * @param string Formatting rules
1364
+ * @param ... Variable number of formatting parameters
1365
+ *
1366
+ * @return Number of printed characters
1367
+ */
1368
+ native elog_message(const message[], any:...);
1369
+
1370
+ /**
1371
+ * Logs a message to the specified file
1372
+ *
1373
+ * @note The log will include a timestamp with the message.
1374
+ *
1375
+ * @param string Formatting rules
1376
+ * @param ... Variable number of formatting parameters
1377
+ *
1378
+ * @noreturn
1379
+ */
1380
+ native log_to_file(const file[], const message[], any:...);
1381
+
1382
+ /**
1383
+ * Returns the number of clients on the server.
1384
+ *
1385
+ * @param flag Count clients still in the connecting process if nonzero
1386
+ *
1387
+ * @return Number of clients on the server
1388
+ */
1389
+ native get_playersnum(flag = 0);
1390
+
1391
+ /**
1392
+ * Stores a filtered list of client indexes to an array.
1393
+ *
1394
+ * @note Please consider using get_players_ex() instead which allows you to
1395
+ * use named constants for flags instead of letters.
1396
+ * @note Example retrieving all alive CTs: get_players(players, num "ae", "CT")
1397
+ *
1398
+ * @param players Array to store indexes to
1399
+ * @param num Variable to store number of indexes to
1400
+ * @param flags Optional list of filtering flags:
1401
+ * "a" - do not include dead clients
1402
+ * "b" - do not include alive clients
1403
+ * "c" - do not include bots
1404
+ * "d" - do not include human clients
1405
+ * "e" - match with team
1406
+ * "f" - match with part of name
1407
+ * "g" - match case insensitive
1408
+ * "h" - do not include HLTV proxies
1409
+ * "i" - include connecting clients
1410
+ * @param team String to match against if the "e" or "f" flag is specified
1411
+ *
1412
+ * @noreturn
1413
+ */
1414
+ native get_players(players[MAX_PLAYERS], &num, const flags[] = "", const team[] = "");
1415
+
1416
+ /**
1417
+ * Retrieves argument of client command as string.
1418
+ *
1419
+ * @note Should only be used inside of the client_command() forward.
1420
+ *
1421
+ * @param id Argument index starting from 1, 0 returns the command itself
1422
+ * @param output Buffer to copy command argument to
1423
+ * @param len Maximum buffer size
1424
+ *
1425
+ * @return Number of cells written to buffer
1426
+ */
1427
+ native read_argv(id, output[], len);
1428
+
1429
+ /**
1430
+ * Retrieves argument of client command as integer value.
1431
+ *
1432
+ * @note Should only be used inside of the client_command() forward.
1433
+ *
1434
+ * @param id Argument index starting from 1
1435
+ *
1436
+ * @return Integer value
1437
+ */
1438
+ native read_argv_int(id);
1439
+
1440
+ /**
1441
+ * Retrieves argument of client command as float value.
1442
+ *
1443
+ * @note Should only be used inside of the client_command() forward.
1444
+ *
1445
+ * @param id Argument index starting from 1
1446
+ *
1447
+ * @return Float value
1448
+ */
1449
+ native Float:read_argv_float(id);
1450
+
1451
+ /**
1452
+ * Retrieves full client command string.
1453
+ *
1454
+ * @note Should only be used inside of the client_command() forward.
1455
+ *
1456
+ * @param output Buffer to copy command line to
1457
+ * @param len Maximum buffer size
1458
+ *
1459
+ * @return Number of cells written to buffer
1460
+ */
1461
+ native read_args(output[], len);
1462
+
1463
+ /**
1464
+ * Returns number of client command arguments.
1465
+ *
1466
+ * @note Should only be used inside of the client_command() forward.
1467
+ * @note This count includes the command itself. I.e. in a command with 4
1468
+ * arguments, this will return 5.
1469
+ *
1470
+ * @return Number of arguments in the command
1471
+ */
1472
+ native read_argc();
1473
+
1474
+ /**
1475
+ * Converts a flag string to a bitflag value.
1476
+ *
1477
+ * @note Example: The string "abcd" represents the sum of 1, 2, 4, and 8 - or
1478
+ * (1<<0)|(1<<1)|(1<<2)|(1<<3). The function will return 15.
1479
+ *
1480
+ * @param flags Flag string to convert
1481
+ *
1482
+ * @return Bitflag value
1483
+ */
1484
+ native read_flags(const flags[]);
1485
+
1486
+ /**
1487
+ * Converts a bitflag value to a flag string.
1488
+ *
1489
+ * @note Example: The value 3 will yield the string "ab"
1490
+ *
1491
+ * @param flags Bitflag value to convert
1492
+ * @param output Buffer to copy flag string to
1493
+ * @param len Maximum buffer size
1494
+ *
1495
+ * @return Number of cells written to buffer
1496
+ */
1497
+ native get_flags(flags, output[], len);
1498
+
1499
+ /**
1500
+ * Find a player given a filter.
1501
+ *
1502
+ * @note Please consider using find_player_ex() instead which allows you to
1503
+ * use named constants for flags instead of letters.
1504
+ * @note If matching by userid, do not also specify the "a", "b" or "c" flags,
1505
+ * or the function may not return a correct result.
1506
+ *
1507
+ * @param flags List of filtering flags:
1508
+ * "a" - match with name
1509
+ * "b" - match with name substring
1510
+ * "c" - match with authid
1511
+ * "d" - match with ip
1512
+ * "e" - match with team name
1513
+ * "f" - do not include dead clients
1514
+ * "g" - do not include alive clients
1515
+ * "h" - do not include bots
1516
+ * "i" - do not include human clients
1517
+ * "j" - return last matched client instead of the first
1518
+ * "k" - match with userid
1519
+ * "l" - match case insensitively
1520
+ * "m" - include connecting clients
1521
+ * @param ... String to match against (integer if "k" flag is specified)
1522
+ *
1523
+ * @return Client index, or 0 if no client was found
1524
+ */
1525
+ native find_player(const flags[], ...);
1526
+
1527
+ /**
1528
+ * Find a player given a filter.
1529
+ *
1530
+ * @note If matching by userid, do not also specify FindPlayer_MatchName, FindPlayer_MatchNameSubstring
1531
+ * or FindPlayer_MatchAuthId, or the function may not return a correct result.
1532
+ *
1533
+ * @param flags Filtering flags (enum FindPlayerFlags); valid flags are:
1534
+ * FindPlayer_MatchName - match with name
1535
+ * FindPlayer_MatchNameSubstring - match with name substring
1536
+ * FindPlayer_MatchAuthId - match with authid
1537
+ * FindPlayer_MatchIP - match with ip
1538
+ * FindPlayer_MatchTeam - match with team name
1539
+ * FindPlayer_ExcludeDead - do not include dead clients
1540
+ * FindPlayer_ExcludeAlive - do not include alive clients
1541
+ * FindPlayer_ExcludeBots - do not include bots
1542
+ * FindPlayer_ExcludeHuman - do not include human clients
1543
+ * FindPlayer_LastMatched - return last matched client instead of the first
1544
+ * FindPlayer_MatchUserId - match with userid
1545
+ * FindPlayer_CaseInsensitive - match case insensitively
1546
+ * FindPlayer_IncludeConnecting - include connecting clients
1547
+ * @param ... String to match against (integer if FindPlayer_MatchUserId is specified)
1548
+ *
1549
+ * @return Client index, or 0 if no client was found
1550
+ */
1551
+ native find_player_ex(FindPlayerFlags:flags, ...);
1552
+
1553
+ /**
1554
+ * Removes double-quotes from the beginning and end of a string.
1555
+ *
1556
+ * @note If the string only has a double-quote at either the start *or* the end,
1557
+ * and not both, the function will do nothing.
1558
+ * @note The function does not perform any trimming per-se. But if a
1559
+ * double-quote is found at the beginning of the string, it will remove
1560
+ * one ^r (carriage return) character at the end of the string if present,
1561
+ * even if no matching double-quote is found. This is for convenience.
1562
+ *
1563
+ * @param text String to remove double-quotes from
1564
+ *
1565
+ * @return 1 if matching double-quotes have been removed, 0 otherwise
1566
+ */
1567
+ native remove_quotes(text[]);
1568
+
1569
+ /**
1570
+ * Executes a command on the client.
1571
+ *
1572
+ * @note Executing malicious commands on the client ("slowhacking") is frowned
1573
+ * upon.
1574
+ * @note Valve has introduced a command filter to Counter-Strike 1.6. It is not
1575
+ * possible to execute many commands if the client has opted in to this.
1576
+ *
1577
+ * @param index Client index, use 0 to execute on all clients
1578
+ * @param command Formatting rules
1579
+ * @param ... Variable number of formatting parameters
1580
+ *
1581
+ * @return Length of formatted command string
1582
+ * @error If a single client is specified and the index is not within
1583
+ * the range of 1 to MaxClients, an error will be thrown.
1584
+ */
1585
+ native client_cmd(index, const command[], any:...);
1586
+
1587
+ /**
1588
+ * Execute a command from the client without actually sending it to the client's
1589
+ * DLL.
1590
+ *
1591
+ * @note This emulates a client command on the server side, and is an excellent
1592
+ * tool to force a client to do certain actions related to the game.
1593
+ * @note The command has to stand alone in the command parameter, only add
1594
+ * arguments using the designated parameters.
1595
+ * @note Commands emulated using this function will not trigger plugin command
1596
+ * hooks. For an alternative that does, see amxclient_cmd()
1597
+ *
1598
+ * @param index Client index, use 0 to execute from all clients
1599
+ * @param command Client command to execute on
1600
+ * @param arg1 Optional command arguments
1601
+ * @param arg2 Optional command arguments
1602
+ *
1603
+ * @noreturn
1604
+ * @error If a single client is specified and the index is not within
1605
+ * the range of 1 to MaxClients, an error will be thrown.
1606
+ */
1607
+ native engclient_cmd(index, const command[], const arg1[] = "", const arg2[] = "");
1608
+
1609
+ /**
1610
+ * Execute a command from the client without actually sending it to the client's
1611
+ * DLL. This triggers plugin command hooks.
1612
+ *
1613
+ * @note This emulates a client command on the server side, and is an excellent
1614
+ * tool to force a client to do certain actions related to the game.
1615
+ * @note The command has to stand alone in the command parameter, only add
1616
+ * arguments using the designated parameters.
1617
+ * @note Commands emulated using this function will trigger other plugin's
1618
+ * command hooks. For an alternative that doesn't, see engclient_cmd()
1619
+ *
1620
+ * @param index Client index, use 0 to execute from all clients
1621
+ * @param command Client command to execute on
1622
+ * @param arg1 Optional command arguments
1623
+ * @param arg2 Optional command arguments
1624
+ *
1625
+ * @noreturn
1626
+ * @error If a single client is specified and the index is not within
1627
+ * the range of 1 to MaxClients, an error will be thrown.
1628
+ */
1629
+ native amxclient_cmd(index, const command[], const arg1[] = "", const arg2[] = "");
1630
+
1631
+ /**
1632
+ * Queues a command to be executed from the server console.
1633
+ *
1634
+ * @note Warning: This is a potential source of command injection. Do not feed
1635
+ * client-controlled input (including client names) to this function
1636
+ * without sanitizing it first.
1637
+ * @note The queued commands will be executed by the engine on the next frame.
1638
+ * If you require them to be executed immediately, see server_exec()
1639
+ *
1640
+ * @param command Formatting rules
1641
+ * @param ... Variable number of formatting parameters
1642
+ *
1643
+ * @noreturn
1644
+ */
1645
+ native server_cmd(const command[], any:...);
1646
+
1647
+ /**
1648
+ * Retrieves the name of the currently played map.
1649
+ *
1650
+ * @param name Buffer to copy map name to
1651
+ * @param len Maximum buffer size
1652
+ *
1653
+ * @return Number of cells written to buffer
1654
+ */
1655
+ native get_mapname(name[], len);
1656
+
1657
+ /**
1658
+ * Returns time remaining on map.
1659
+ *
1660
+ * @return Time left on map, in seconds
1661
+ */
1662
+ native get_timeleft();
1663
+
1664
+ /**
1665
+ * Returns the game time based on the game tick.
1666
+ *
1667
+ * @note This time is counted up from map start. If the engine is not processing
1668
+ * this function will return the same value between calls, which makes it
1669
+ * unusable for profiling purposes.
1670
+ *
1671
+ * @return Game time, in seconds
1672
+ */
1673
+ native Float:get_gametime();
1674
+
1675
+ /**
1676
+ * Returns the maxplayers setting of the current server, that is how many
1677
+ * clients it supports.
1678
+ *
1679
+ * @note As of AMXX 1.8.3, this value is also exposed through a dynamic constant
1680
+ * via the MaxClients variable, declared in amxconst.inc
1681
+ *
1682
+ * @return Maxplayers setting
1683
+ */
1684
+ native get_maxplayers();
1685
+
1686
+ /**
1687
+ * Retrieves the name of the currently played mod.
1688
+ *
1689
+ * @note This retrieves the short name of the mod. Example: for Counter-Strike,
1690
+ * it will copy "cstrike" to the buffer.
1691
+ *
1692
+ * @param name Buffer to copy mod name to
1693
+ * @param len Maximum size of the buffer
1694
+ *
1695
+ * @return Number of cells written to buffer
1696
+ */
1697
+ native get_modname(name[], len);
1698
+
1699
+ /**
1700
+ * Retrieves the current time using the specified format string.
1701
+ *
1702
+ * @note Uses the strftime C function. For a list of valid format parameters,
1703
+ * see: http://cplusplus.com/reference/clibrary/ctime/strftime.html
1704
+ * A common example for a format string would be: "%m/%d/%Y - %H:%M:%S"
1705
+ *
1706
+ * @param format Format string
1707
+ * @param output Buffer to copy formatted time string to
1708
+ * @param len Maximum size of buffer
1709
+ *
1710
+ * @return Number of cells written to buffer
1711
+ */
1712
+ native get_time(const format[], output[], len);
1713
+
1714
+ /**
1715
+ * Retrieves the provided time using the specified format string.
1716
+ *
1717
+ * @note Uses the strftime C function. For a list of valid format parameters,
1718
+ * see: http://cplusplus.com/reference/clibrary/ctime/strftime.html
1719
+ * A common example for a format string would be: "%m/%d/%Y - %H:%M:%S"
1720
+ *
1721
+ * @param output Buffer to copy formatted time string to
1722
+ * @param len Maximum size of buffer
1723
+ * @param format Format string
1724
+ * @param time Unix timestamp, use -1 to use the current time
1725
+ *
1726
+ * @return Number of cells written to buffer
1727
+ * @error If the conversion process fails, an error will be thrown.
1728
+ */
1729
+ native format_time(output[], len, const format[], time = -1);
1730
+
1731
+ /**
1732
+ * Returns the system time as a unix timestamp (number of seconds since unix
1733
+ * epoch).
1734
+ *
1735
+ * @param offset Optional offset value in seconds
1736
+ *
1737
+ * @return Unix time stamp
1738
+ */
1739
+ native get_systime(offset = 0);
1740
+
1741
+ /**
1742
+ * Converts time strings to unix time stamp.
1743
+ *
1744
+ * @note Uses the strptime C function. For a list of valid format parameters,
1745
+ * see: http://www.cplusplus.com/reference/ctime/strftime/
1746
+ * An example for a input/format combination would be:
1747
+ * Input: "10:32:54 04/02/2013" Format: "%H:%M:%S %m:%d:%Y"
1748
+ * @note Information missing from the input will be filled with the current
1749
+ * time and date.
1750
+ *
1751
+ * @param input Time string to convert
1752
+ * @param format Formatting information for conversion
1753
+ * @param time If different from -1, the converted time will be added to
1754
+ * this time stamp
1755
+ *
1756
+ * @return Unix time stamp
1757
+ * @error If the conversion process fails, an error will be thrown.
1758
+ */
1759
+ native parse_time(const input[], const format[], time = -1);
1760
+
1761
+ /**
1762
+ * Calls a function after a specified time has elapsed.
1763
+ *
1764
+ * @note Please consider using set_task_ex() instead which allows you to
1765
+ * use named constants for flags instead of letters.
1766
+ *
1767
+ * @note The function is called in the following manner if data is passed:
1768
+ * data[] - Data passed
1769
+ * id - Task index
1770
+ *
1771
+ * @note The function is called in the following manner if no data is passed:
1772
+ * id - Task index
1773
+ *
1774
+ * @param time Time interval to assign
1775
+ * @param function Function to execute
1776
+ * @param id Task id to assign
1777
+ * @param parameter Data to pass through to callback
1778
+ * @param len Size of data
1779
+ * @param flags Optional set of flags:
1780
+ * "a" - repeat timer a set amount of times
1781
+ * "b" - loop indefinitely until timer is stopped
1782
+ * "c" - time interval is treated as absolute time after
1783
+ * map start
1784
+ * "d" - time interval is treated as absolute time before
1785
+ * map change
1786
+ * @param repeat If the "a" flag is set, the task will be repeated this
1787
+ * many times
1788
+ *
1789
+ * @noreturn
1790
+ * @error If an invalid callback function is provided, an error is
1791
+ * thrown.
1792
+ */
1793
+ native set_task(Float:time, const function[], id = 0, const any:parameter[] = "", len = 0, const flags[] = "", repeat = 0);
1794
+
1795
+ /**
1796
+ * Removes all tasks with the specified id.
1797
+ *
1798
+ * @param id Task id to search for
1799
+ * @param outside Will remove tasks set by other plugins if nonzero
1800
+ *
1801
+ * @return Number of removed tasks
1802
+ */
1803
+ native remove_task(id = 0, outside = 0);
1804
+
1805
+ /**
1806
+ * Modifies the time interval of all tasks with the specified id.
1807
+ *
1808
+ * @param id Task id to search for
1809
+ * @param newTime New time interval to set
1810
+ * @param outside Will affect tasks set by other plugins if nonzero
1811
+ *
1812
+ * @return Number of affected tasks
1813
+ */
1814
+ native change_task(id = 0, Float:newTime = 1.0, outside = 0);
1815
+
1816
+ /**
1817
+ * Returns if a task with the specified id exists.
1818
+ *
1819
+ * @param id Task id to search for
1820
+ * @param outside Search for tasks set by other plugins if nonzero
1821
+ *
1822
+ * @return 1 if a task was found, 0 otherwise
1823
+ */
1824
+ native task_exists(id = 0, outside = 0);
1825
+
1826
+ /**
1827
+ * Sets the specified admin flags to a client.
1828
+ *
1829
+ * @note For a list of possible flags, see the ADMIN_* constants in amxconst.inc
1830
+ * @note This function just adds the flags using a bitwise-or operation. After it
1831
+ * has run, the flags may not exactly equal the specified bitflag sum.
1832
+ * @note AMXX stores multiple sets of flags internally, but only flag set
1833
+ * 0 is actively used. You should not change the value of the third
1834
+ * parameter from the default.
1835
+ *
1836
+ * @param index Client index, 0 to set flags of server
1837
+ * @param flags Admin flags
1838
+ * @param id Flag set id, ranging from 0 to 31
1839
+ *
1840
+ * @noreturn
1841
+ * @error If the index is not within the range of 0 to MaxClients, an
1842
+ * error will be thrown.
1843
+ */
1844
+ native set_user_flags(index, flags = -1, id = 0);
1845
+
1846
+ /**
1847
+ * Returns the client's admin flags as a bitflag sum.
1848
+ *
1849
+ * @note For a list of possible flags, see the ADMIN_* constants in amxconst.inc
1850
+ * @note AMXX stores multiple sets of flags internally, but only flag set
1851
+ * 0 is actively used. You should not change the value of the second
1852
+ * parameter from the default.
1853
+ *
1854
+ * @param index Client index, 0 to get flags of server
1855
+ * @param id Flag set id, ranging from 0 to 31
1856
+ *
1857
+ * @return Bitflag sum of client's admin flags
1858
+ * @error If the index is not within the range of 0 to MaxClients, an
1859
+ * error will be thrown.
1860
+ */
1861
+ native get_user_flags(index, id = 0);
1862
+
1863
+ /**
1864
+ * Removes the specified admin flags from a client.
1865
+ *
1866
+ * @note For a list of possible flags, see the ADMIN_* constants in amxconst.inc
1867
+ * @note This function just removes the flags using a bitwise-and operation.
1868
+ * @note AMXX stores multiple sets of flags internally, but only flag set
1869
+ * 0 is actively used. You should not change the value of the third
1870
+ * parameter from the default.
1871
+ *
1872
+ * @param index Client index, 0 to set flags of server
1873
+ * @param flags Admin flags
1874
+ * @param id Flag set id, ranging from 0 to 31
1875
+ *
1876
+ * @noreturn
1877
+ * @error If the index is not within the range of 0 to MaxClients, an
1878
+ * error will be thrown.
1879
+ */
1880
+ native remove_user_flags(index, flags = -1, id = 0);
1881
+
1882
+ /**
1883
+ * Registers a callback to be called when the client executes a command from the
1884
+ * console.
1885
+ *
1886
+ * @note For a list of possible access flags, see the ADMIN_* constants in
1887
+ * amxconst.inc
1888
+ * @note Opting in to FlagManager enables the admin privileges to be overwritten
1889
+ * by the end user via the cmdaccess.ini config file.
1890
+ * @note Automatic detection for FlagManager will only include a command if it
1891
+ * has required privileges (flags is not -1) and it is not a command
1892
+ * starting with "say".
1893
+ *
1894
+ * @param client_cmd Command to register
1895
+ * @param function Callback function
1896
+ * @param flags Admin privilege flags required
1897
+ * @param info Command description
1898
+ * @param FlagManager 0 opts out of flag manager, 1 opts in, -1 selects
1899
+ * automatically
1900
+ * @param info_ml If true, the parameter "info" will be looked up as multilingual key
1901
+ *
1902
+ * @return Command id, 0 on failure
1903
+ * @error If an invalid callback function is specified, an error
1904
+ * will be thrown.
1905
+ */
1906
+ native register_clcmd(const client_cmd[], const function[], flags = -1, const info[] = "", FlagManager = -1, bool:info_ml = false);
1907
+
1908
+ /**
1909
+ * Registers a callback to be called when the client or server executes a
1910
+ * command from the console.
1911
+ *
1912
+ * @note For a list of possible access flags, see the ADMIN_* constants in
1913
+ * amxconst.inc
1914
+ * @note Opting in to FlagManager enables the admin privileges to be overwritten
1915
+ * by the end user via the cmdaccess.ini config file.
1916
+ * @note Automatic detection for FlagManager will only include a command if it
1917
+ * has required privileges (flags is not -1) and it is not a command
1918
+ * starting with "say".
1919
+ *
1920
+ * @param client_cmd Command to register
1921
+ * @param function Callback function
1922
+ * @param flags Admin privilege flags required
1923
+ * @param info Command description
1924
+ * @param FlagManager 0 opts out of flag manager, 1 opts in, -1 selects
1925
+ * automatically
1926
+ * @param info_ml If true, the parameter "info" will be looked up as multilingual key
1927
+ *
1928
+ * @return Command id, 0 on failure
1929
+ * @error If an invalid callback function is specified, an error
1930
+ * will be thrown.
1931
+ */
1932
+ native register_concmd(const cmd[], const function[], flags = -1, const info[] = "", FlagManager = -1, bool:info_ml = false);
1933
+
1934
+ /**
1935
+ * Registers a callback to be called when the server executes a command from the
1936
+ * console.
1937
+ *
1938
+ * @note For a list of possible access flags, see the ADMIN_* constants in
1939
+ * amxconst.inc
1940
+ *
1941
+ * @param client_cmd Command to register
1942
+ * @param function Callback function
1943
+ * @param flags Admin privilege flags required
1944
+ * @param info Command description
1945
+ * @param info_ml If true, the parameter "info" will be looked up as multilingual key
1946
+ *
1947
+ * @return Command id, 0 on failure
1948
+ * @error If an invalid callback function is specified, an error
1949
+ * will be thrown.
1950
+ */
1951
+ native register_srvcmd(const server_cmd[], const function[], flags = -1, const info[] = "", bool:info_ml = false);
1952
+
1953
+ /**
1954
+ * Retrieves information about a client command.
1955
+ *
1956
+ * @note For a list of possible access flags, see the ADMIN_* constants in
1957
+ * amxconst.inc
1958
+ *
1959
+ * @param index Command index
1960
+ * @param command Buffer to copy command name to
1961
+ * @param len1 Maximum name buffer size
1962
+ * @param flags Variable to store privilege flags to
1963
+ * @param info Buffer to copy command description to
1964
+ * @param len2 Maximum description buffer size
1965
+ * @param flag Only considers commands that can be accessed with
1966
+ * the specified privilege flags
1967
+ * @param info_ml Variable to store whether the parameter "info" is a multilingual key
1968
+ *
1969
+ * @return 1 on success, 0 if command was not found
1970
+ */
1971
+ native get_clcmd(index, command[], len1, &flags, info[], len2, flag, &bool:info_ml = false);
1972
+
1973
+ /**
1974
+ * Returns number of registered client commands.
1975
+ *
1976
+ * @note For a list of possible access flags, see the ADMIN_* constants in
1977
+ * amxconst.inc
1978
+ *
1979
+ * @param flag Only considers commands that can be accessed with
1980
+ * the specified privilege flags
1981
+ *
1982
+ * @return Number of registered client commands
1983
+ */
1984
+ native get_clcmdsnum(flag);
1985
+
1986
+ /**
1987
+ * Retrieves information about a server command.
1988
+ *
1989
+ * @note For a list of possible access flags, see the ADMIN_* constants in
1990
+ * amxconst.inc
1991
+ *
1992
+ * @param index Command index
1993
+ * @param command Buffer to copy command name to
1994
+ * @param len1 Maximum name buffer size
1995
+ * @param flags Variable to store privilege flags to
1996
+ * @param info Buffer to copy command description to
1997
+ * @param len2 Maximum description buffer size
1998
+ * @param flag Only considers commands that can be accessed with
1999
+ * the specified privilege flags
2000
+ * @param info_ml Variable to store whether the parameter "info" is a multilingual key
2001
+ *
2002
+ * @return 1 on success, 0 if command was not found
2003
+ */
2004
+ native get_srvcmd(index, server_cmd[], len1, &flags, info[], len2, flag, &bool:info_ml = false);
2005
+
2006
+ /**
2007
+ * Returns number of registered server commands.
2008
+ *
2009
+ * @note For a list of possible access flags, see the ADMIN_* constants in
2010
+ * amxconst.inc
2011
+ *
2012
+ * @param flag Only considers commands that can be accessed with
2013
+ * the specified privilege flags
2014
+ *
2015
+ * @return Number of registered server commands
2016
+ */
2017
+ native get_srvcmdsnum(flag);
2018
+
2019
+ /**
2020
+ * Retrieves information about a console command.
2021
+ *
2022
+ * @note For a list of possible access flags, see the ADMIN_* constants in
2023
+ * amxconst.inc
2024
+ *
2025
+ * @param index Command index
2026
+ * @param command Buffer to copy command name to
2027
+ * @param len1 Maximum name buffer size
2028
+ * @param flags Variable to store privilege flags to
2029
+ * @param info Buffer to copy command description to
2030
+ * @param len2 Maximum description buffer size
2031
+ * @param flag Only considers commands that can be accessed with
2032
+ * the specified privilege flags
2033
+ * @param id If set to 0 only server commands will be considered,
2034
+ * positive will only consider client commands, otherwise
2035
+ * all console commands will be considered
2036
+ * @param info_ml Variable to store whether the parameter "info" is a multilingual key
2037
+ *
2038
+ * @return 1 on success, 0 if command was not found
2039
+ */
2040
+ native get_concmd(index, cmd[], len1, &flags, info[], len2, flag, id = -1, &bool:info_ml = false);
2041
+
2042
+ /**
2043
+ * Returns the parent plugin id of a console command.
2044
+ *
2045
+ * @note For a list of possible access flags, see the ADMIN_* constants in
2046
+ * amxconst.inc
2047
+ *
2048
+ * @param cid Command index
2049
+ * @param flag_mask Only considers commands that can be accessed with
2050
+ * the specified privilege flags.
2051
+ * @param id_type If set to 0 only server commands will be considered,
2052
+ * positive will only consider client commands, otherwise
2053
+ * all console commands will be considered.
2054
+ *
2055
+ * @return Plugin id
2056
+ */
2057
+ native get_concmd_plid(cid, flag_mask, id_type);
2058
+
2059
+ /**
2060
+ * Returns number of registered console commands.
2061
+ *
2062
+ * @note For a list of possible access flags, see the ADMIN_* constants in
2063
+ * amxconst.inc
2064
+ *
2065
+ * @param flag Only considers commands that can be accessed with
2066
+ * the specified privilege flags
2067
+ * @param id If set to 0 only server commands will be considered,
2068
+ * positive will only consider client commands, otherwise
2069
+ * all console commands will be considered
2070
+ *
2071
+ * @return Number of registered console commands
2072
+ */
2073
+ native get_concmdsnum(flag, id = -1);
2074
+
2075
+ /**
2076
+ * Returns unique menu id of a menu.
2077
+ *
2078
+ * @param menu Menu name
2079
+ * @param outside Catch menus outside the calling plugin
2080
+ *
2081
+ * @return Menu id
2082
+ */
2083
+ native register_menuid(const menu[], outside = 0);
2084
+
2085
+ /**
2086
+ * Registers a callback function to a menu id and keys.
2087
+ *
2088
+ * @param menuid Menu id
2089
+ * @param keys Key flags
2090
+ * @param function Callback function
2091
+ *
2092
+ * @noreturn
2093
+ * @error If an invalid callback function is specified, an error
2094
+ * will be thrown.
2095
+ */
2096
+ native register_menucmd(menuid, keys, const function[]);
2097
+
2098
+ /**
2099
+ * Returns if the client is watching a menu.
2100
+ *
2101
+ * @note If there is no menu, the id is 0. If the id is negative, then the client
2102
+ * views a VGUI menu. Otherwise, the id is an id acquired from the
2103
+ * register_menuid() function.
2104
+ *
2105
+ * @param index Client index
2106
+ * @param id Variable to store menu id to
2107
+ * @param keys Variable to store menu keys to
2108
+ *
2109
+ * @return 1 if client views a menu, 0 otherwise
2110
+ * @error If the client index is not within the range of 1 to
2111
+ * MaxClients, an error will be thrown.
2112
+ */
2113
+ native get_user_menu(index, &id, &keys);
2114
+
2115
+ /**
2116
+ * Forces the server to execute the command queue immediately.
2117
+ *
2118
+ * @note Commands can be added to the queue using server_cmd()
2119
+ *
2120
+ * @noreturn
2121
+ */
2122
+ native server_exec();
2123
+
2124
+ /**
2125
+ * Emits a sound from an entity from the engine.
2126
+ *
2127
+ * @note The sample must be precached using precache_sound() so it is available
2128
+ * in the engine's sound table.
2129
+ * @note For a list of available channels, see CHAN_* constants in amxconst.inc,
2130
+ * sounds emitted from the same channel will override each other.
2131
+ * @note There are helpful reference constants in amxconst.inc for sound volume
2132
+ * (VOL_*), attenuation (ATTN_*), flags (SND_*), and pitch (PITCH_*).
2133
+ *
2134
+ * @param index Entity index, use 0 to emit from all clients
2135
+ * @param channel Channel to emit from
2136
+ * @param sample Sound file to emit
2137
+ * @param vol Volume in percent
2138
+ * @param att Sound attenuation
2139
+ * @param flags Emit flags
2140
+ * @param pitch Sound pitch
2141
+ *
2142
+ * @noreturn
2143
+ */
2144
+ native emit_sound(index, channel, const sample[], Float:vol, Float:att, flags, pitch);
2145
+
2146
+ /**
2147
+ * Returns a random floating point value generated by the engine.
2148
+ *
2149
+ * @param a Minimum value (inclusive)
2150
+ * @param b Maximum value (inclusive)
2151
+ *
2152
+ * @return Generated random value
2153
+ */
2154
+ native Float:random_float(Float:a, Float:b);
2155
+
2156
+ /**
2157
+ * Returns a random integer value generated by the engine.
2158
+ *
2159
+ * @param a Minimum value (inclusive)
2160
+ * @param b Maximum value (inclusive)
2161
+ *
2162
+ * @return Generated random value
2163
+ */
2164
+ native random_num(a, b);
2165
+
2166
+ /**
2167
+ * Returns unique id of a client message.
2168
+ *
2169
+ * @note Example usage: get_user_msgid("TextMsg")
2170
+ * @note The message id is unique as long as the server is running, but might
2171
+ * change between updates. They should not be hardcoded into plugins.
2172
+ * @note On first server start, this function will return 0 if used inside
2173
+ * plugin_precache(). Consider hooking RegUserMsg in order to retrieve
2174
+ * the correct message id.
2175
+ *
2176
+ * @param name Client message name
2177
+ *
2178
+ * @return Message id, 0 if message was not found
2179
+ */
2180
+ native get_user_msgid(const name[]);
2181
+
2182
+ /**
2183
+ * Retrieves the client message name from a message id.
2184
+ *
2185
+ * @param msgid Client message id
2186
+ * @param name Buffer to copy message name to
2187
+ * @param len Maximum buffer size
2188
+ *
2189
+ * @return Number of cells written to buffer, 0 on invalid message id
2190
+ */
2191
+ native get_user_msgname(msgid, name[], len);
2192
+
2193
+ /**
2194
+ * Returns a unique id for a public variable.
2195
+ *
2196
+ * @note Variables declared with the "public" specifier are accessible by-name
2197
+ * from outside of the declaring plugin.
2198
+ * @note If multiple plugins declare the same public variable, this native will
2199
+ * still return a unique id.
2200
+ *
2201
+ * @param name Variable name
2202
+ *
2203
+ * @return Xvar id on success, -1 on failure
2204
+ */
2205
+ native get_xvar_id(const name[]);
2206
+
2207
+ /**
2208
+ * Returns if a public variable exists in any loaded plugin.
2209
+ *
2210
+ * @param name Variable name
2211
+ *
2212
+ * @return 1 if public cvar exists, 0 otherwise
2213
+ */
2214
+ native xvar_exists(const name[]);
2215
+
2216
+ /**
2217
+ * Returns the integer value of a public variable.
2218
+ *
2219
+ * @note If multiple plugins declare the same public variable, they are not
2220
+ * automatically synchronized. The xvar system accesses only one of all
2221
+ * public variables directly. Xvars have to be read through the natives or
2222
+ * the value will be incorrect.
2223
+ *
2224
+ * @param id Xvar id, an xvar id can be retrieved using get_xvar_id()
2225
+ *
2226
+ * @return Xvar integer value
2227
+ */
2228
+ native get_xvar_num(id);
2229
+
2230
+ /**
2231
+ * Returns the float value of a public variable.
2232
+ *
2233
+ * @note If multiple plugins declare the same public variable, they are not
2234
+ * automatically synchronized. The xvar system accesses only one of all
2235
+ * public variables directly. Xvars have to be read through the natives or
2236
+ * the value will be incorrect.
2237
+ *
2238
+ * @param id Xvar id, an xvar id can be retrieved using get_xvar_id()
2239
+ *
2240
+ * @return Xvar float value
2241
+ */
2242
+ native Float:get_xvar_float(id);
2243
+
2244
+ /**
2245
+ * Sets the integer value of a public variable.
2246
+ *
2247
+ * @note If multiple plugins declare the same public variable, they are not
2248
+ * automatically synchronized. The xvar system accesses only one of all
2249
+ * public variables directly. Xvars have to be set through the natives or
2250
+ * the xvar will not be updated.
2251
+ *
2252
+ * @param id Xvar id, an xvar id can be retrieved using get_xvar_id()
2253
+ * @param value Value to set
2254
+ *
2255
+ * @noreturn
2256
+ * @error If an invalid xvar id is specified, an error will be thrown.
2257
+ */
2258
+ native set_xvar_num(id, value = 0);
2259
+
2260
+ /**
2261
+ * Sets the float value of a public variable.
2262
+ *
2263
+ * @note If multiple plugins declare the same public variable, they are not
2264
+ * automatically synchronized. The xvar system accesses only one of all
2265
+ * public variables directly. Xvars have to be set through the natives or
2266
+ * the xvar will not be updated.
2267
+ *
2268
+ * @param id Xvar id, an xvar id can be retrieved using get_xvar_id()
2269
+ * @param value Value to set
2270
+ *
2271
+ * @noreturn
2272
+ * @error If an invalid xvar id is specified, an error will be thrown.
2273
+ */
2274
+ native set_xvar_float(id, Float:value = 0.0);
2275
+
2276
+ /**
2277
+ * Returns if a module is loaded.
2278
+ *
2279
+ * @param name Module name
2280
+ *
2281
+ * @return Module id of the matching module, -1 otherwise
2282
+ */
2283
+ native is_module_loaded(const name[]);
2284
+
2285
+ /**
2286
+ * Retrieves info about a module by module index.
2287
+ *
2288
+ * @note For a list of possible status flags, see module_* constants in
2289
+ * amxconst.inc
2290
+ *
2291
+ * @param id Module id
2292
+ * @param name Buffer to copy module name to
2293
+ * @param nameLen Maximum name buffer size
2294
+ * @param author Buffer to copy module author to
2295
+ * @param authorLen Maximum author buffer size
2296
+ * @param version Buffer to copy module version to
2297
+ * @param versionLen Maximum version buffer size
2298
+ * @param status Variable to store module status to
2299
+ *
2300
+ * @return Module id on success, -1 on invalid module
2301
+ */
2302
+ native get_module(id, name[], nameLen, author[], authorLen, version[], versionLen, &status);
2303
+
2304
+ /**
2305
+ * Returns the number of currently registered modules.
2306
+ *
2307
+ * @return Number of modules
2308
+ */
2309
+ native get_modulesnum();
2310
+
2311
+ /**
2312
+ * Returns if a plugin is loaded by registered name or filename.
2313
+ *
2314
+ * @note An example for a registered name would be "Admin Base", while a possible
2315
+ * filename would be "admin.amxx".
2316
+ * @note Prior to AMXX 1.80, this function would only search for plugins
2317
+ * registered names, not the filename.
2318
+ * @note The plugin name matching is case insensitive, while the filename
2319
+ * matching is case sensitive.
2320
+ *
2321
+ * @param name Plugin name or filename
2322
+ * @param usefilename If true searches for plugin filename, false searches for
2323
+ * plugin name
2324
+ *
2325
+ * @return Plugin id of the matching plugin, -1 otherwise
2326
+ */
2327
+ native is_plugin_loaded(const name[], bool:usefilename = false);
2328
+
2329
+ /**
2330
+ * Retrieves info about a plugin by plugin index.
2331
+ *
2332
+ * @param index Plugin index, -1 to target calling plugin
2333
+ * @param filename Buffer to copy plugin filename to
2334
+ * @param len1 Maximum filename buffer size
2335
+ * @param name Buffer to copy plugin name to
2336
+ * @param len2 Maximum name buffer size
2337
+ * @param version Buffer to copy plugin version to
2338
+ * @param len3 Maximum version buffer size
2339
+ * @param author Buffer to copy plugin author to
2340
+ * @param len4 Maximum author buffer size
2341
+ * @param status Buffer to copy plugin status flags to
2342
+ * @param len5 Maximum status buffer size
2343
+ * @param url Buffer to copy plugin url to
2344
+ * @param len6 Maximum url buffer size
2345
+ * @param desc Buffer to copy plugin description to
2346
+ * @param len7 Maximum description buffer size
2347
+ *
2348
+ * @return Plugin index on success, -1 if there is no plugin with given
2349
+ * index
2350
+ */
2351
+ native get_plugin(index, filename[] = "", len1 = 0, name[] = "", len2 = 0, version[] = "", len3 = 0, author[] = "", len4 = 0, status[] = "", len5 = 0, url[] = "", len6 = 0, desc[] = "", len7 = 0);
2352
+
2353
+ /**
2354
+ * Returns the number of loaded AMXX plugins.
2355
+ *
2356
+ * @return Number of loaded plugins
2357
+ */
2358
+ native get_pluginsnum();
2359
+
2360
+ /**
2361
+ * Pauses a plugin so it will not be executed until it is unpaused.
2362
+ *
2363
+ * @note This used to be able to pause specific functions, but this functionality
2364
+ * (along with the flags "b" and "e") has been deprecated.
2365
+ * @note If used without flag "c" this will pause the calling plugin.
2366
+ *
2367
+ * @param flag Pause flags
2368
+ * "a" - pause plugin
2369
+ * "c" - search for other plugins using param1
2370
+ * "d" - stop plugin, making it unavailable to unpause
2371
+ * @param param1 Plugin filename
2372
+ * @param param2 Unused and ignored
2373
+ *
2374
+ * @return 1 on success, 0 otherwise
2375
+ * @error If it is attempted to use the deprecated functionality,
2376
+ * an error is thrown.
2377
+ */
2378
+ native pause(const flag[], const param1[] = "", const param2[] = "");
2379
+
2380
+ /**
2381
+ * Unpauses a plugin so it will resume execution if it was previously paused.
2382
+ *
2383
+ * @note This used to be able to unpause specific functions, but this
2384
+ * functionality (along with the flags "b" and "e") has been deprecated.
2385
+ * @note Without specifying flag "c" this function will do nothing, as a plugin
2386
+ * is incapable of unpausing itself. This is a relict of the deprecated
2387
+ * functionality.
2388
+ *
2389
+ * @param flag Pause flags
2390
+ * "a" - pause plugin
2391
+ * "c" - search for other plugins using param1
2392
+ * @param param1 Plugin filename
2393
+ * @param param2 Unused and ignored
2394
+ *
2395
+ * @return 1 on success, 0 otherwise
2396
+ * @error If it is attempted to use the deprecated functionality,
2397
+ * an error is thrown.
2398
+ */
2399
+ native unpause(const flag[], const param1[] = "", const param2[] = "");
2400
+
2401
+ /**
2402
+ * Initiates a function call to this or another plugin by function name.
2403
+ *
2404
+ * @note This only sets up the function call and covers the pre-requisites.
2405
+ * Push parameters using the callfunc_push_* set of functions. The call
2406
+ * will be executed only upon using callfunc_end()
2407
+ *
2408
+ * @param func Function name
2409
+ * @param plugin Plugin filename, if empty the calling plugin is targeted
2410
+ * The filename has to be the full exact name (e.g. stats.amxx)
2411
+ *
2412
+ * @return 1 on success
2413
+ * 0 on runtime error
2414
+ * -1 if plugin was not found
2415
+ * -2 if function was not found
2416
+ * @error If called while another callfunc has not yet been finished,
2417
+ * an error is thrown.
2418
+ */
2419
+ native callfunc_begin(const func[], const plugin[] = "");
2420
+
2421
+ /**
2422
+ * Initiates a function call to this or another plugin by function id.
2423
+ *
2424
+ * @note This only sets up the function call and covers the pre-requisites.
2425
+ * Push parameters using the callfunc_push_* set of functions. The call
2426
+ * will be executed only upon using callfunc_end()
2427
+ * @note The function id can be retrieved by get_func_id()
2428
+ *
2429
+ * @param func Function id
2430
+ * @param plugin Plugin filename, if empty the calling plugin is targeted
2431
+ * The filename has to be the full exact name (e.g. stats.amxx)
2432
+ *
2433
+ * @return 1 on success
2434
+ * -1 if plugin was not found
2435
+ * -2 if function is not executable
2436
+ * @error If called while another callfunc has not yet been finished,
2437
+ * or the specified function is invalid, an error is thrown.
2438
+ */
2439
+ native callfunc_begin_i(func, plugin = -1);
2440
+
2441
+ /**
2442
+ * Retrieves a functions id for use with callfunc_begin_i()
2443
+ *
2444
+ * @param funcName Function name
2445
+ * @param pluginId Plugin id, if -1 the calling plugin is targeted
2446
+ * The plugin id can be retrieved using find_plugin_byfile()
2447
+ *
2448
+ * @return >=0 Function id on success
2449
+ * -1 if plugin or function was not found
2450
+ */
2451
+ native get_func_id(const funcName[], pluginId = -1);
2452
+
2453
+ /**
2454
+ * Pushes an int value onto the current call.
2455
+ *
2456
+ * @param value Int value to push
2457
+ *
2458
+ * @noreturn
2459
+ * @error If called without initiating a callfunc, or the maximum
2460
+ * amount of parameters is reached, an error is thrown.
2461
+ */
2462
+ native callfunc_push_int(value);
2463
+
2464
+ /**
2465
+ * Pushes a float value onto the current call.
2466
+ *
2467
+ * @param value Float value to push
2468
+ *
2469
+ * @noreturn
2470
+ * @error If called without initiating a callfunc, or the maximum
2471
+ * amount of parameters is reached, an error is thrown.
2472
+ */
2473
+ native callfunc_push_float(Float: value);
2474
+
2475
+ /**
2476
+ * Pushes an int value reference onto the current call.
2477
+ *
2478
+ * @note Changes made to this value by the called function will be reflected
2479
+ * in the calling plugin.
2480
+ *
2481
+ * @param value Int value to push
2482
+ *
2483
+ * @noreturn
2484
+ * @error If called without initiating a callfunc, or the maximum
2485
+ * amount of parameters is reached, an error is thrown.
2486
+ */
2487
+ native callfunc_push_intrf(&value);
2488
+
2489
+ /**
2490
+ * Pushes a float value reference onto the current call.
2491
+ *
2492
+ * @note Changes made to this value by the called function will be reflected
2493
+ * in the calling plugin.
2494
+ *
2495
+ * @param value Float value to push
2496
+ *
2497
+ * @noreturn
2498
+ * @error If called without initiating a callfunc, or the maximum
2499
+ * amount of parameters is reached, an error is thrown.
2500
+ */
2501
+ native callfunc_push_floatrf(&Float:value);
2502
+
2503
+ /**
2504
+ * Pushes a string onto the current call.
2505
+ *
2506
+ * @note This will defy the "const" specifier if copyback is true, which is
2507
+ * only kept for special backwards compatibility.
2508
+ *
2509
+ * @param VALUE String to push
2510
+ * @param copyback If true, any changes made in the called function will be
2511
+ * copied back to the calling plugin
2512
+ *
2513
+ * @noreturn
2514
+ * @error If called without initiating a callfunc, or the maximum
2515
+ * amount of parameters is reached, an error is thrown.
2516
+ */
2517
+ native callfunc_push_str(const VALUE[], bool:copyback = true);
2518
+
2519
+ /**
2520
+ * Pushes an array onto the current call.
2521
+ *
2522
+ * @note This will defy the "const" specifier if copyback is true, which is
2523
+ * only kept for special backwards compatibility.
2524
+ *
2525
+ * @param VALUE Array to push
2526
+ * @param array_size Size of the array
2527
+ * @param copyback If true, any changes made in the called function will be
2528
+ * copied back to the calling plugin
2529
+ *
2530
+ * @noreturn
2531
+ * @error If called without initiating a callfunc, or the maximum
2532
+ * amount of parameters is reached, an error is thrown.
2533
+ */
2534
+ native callfunc_push_array(const VALUE[], array_size, bool:copyback = true);
2535
+
2536
+ /**
2537
+ * Completes the call to a function.
2538
+ *
2539
+ * @return 1 on success
2540
+ * -1 if the plugin was not found
2541
+ * -2 if the function was not found
2542
+ * @error If called without initiating a callfunc, an error is thrown.
2543
+ */
2544
+ native callfunc_end();
2545
+
2546
+ /**
2547
+ * Called when an inconsistent file is encountered by the engine.
2548
+ *
2549
+ * @param id Client index
2550
+ * @param filename Detected file
2551
+ * @param reason Buffer storing the disconnect reason (can be overwritten)
2552
+ *
2553
+ * @return PLUGIN_CONTINUE to let the engine kick the client
2554
+ * PLUGIN_HANDLED to block the inconsistency kick
2555
+ */
2556
+ forward inconsistent_file(id, const filename[], reason[64]);
2557
+
2558
+ /**
2559
+ * Forces the clients and server to be running with the same version of a
2560
+ * specified file.
2561
+ *
2562
+ * @note For a list of possible enforcement types, see the force_* constants
2563
+ * in amxconst.inc
2564
+ *
2565
+ * @param force_type Enforcement type
2566
+ * @param mins Bounding box mins vector
2567
+ * @param maxs Bounding box maxs vector
2568
+ * @param filename Filename
2569
+ *
2570
+ * @return 1 on success, 0 otherwise
2571
+ */
2572
+ native force_unmodified(force_type, const mins[3], const maxs[3], const filename[]);
2573
+
2574
+ /**
2575
+ * Calculates the MD5 keysum of a string.
2576
+ *
2577
+ * @param szString String to calculate keysum of
2578
+ * @param md5buffer Buffer to copy the MD5 hash to
2579
+ *
2580
+ * @return Number of cells written to the buffer (always 32)
2581
+ */
2582
+ #pragma deprecated Use hash_string() function. Also, see Hash_* constants.
2583
+ native md5(const szString[], md5buffer[34]);
2584
+
2585
+ /**
2586
+ * Calculates the MD5 keysum of a file.
2587
+ *
2588
+ * @param file Path to file to calculate keysum of
2589
+ * @param md5buffer Buffer to copy the MD5 hash to
2590
+ *
2591
+ * @return Number of cells written to the buffer (always 32)
2592
+ * @error If the file can not be opened, and error is thrown.
2593
+ */
2594
+ #pragma deprecated Use hash_file() function. Also, see Hash_* constants.
2595
+ native md5_file(const file[], md5buffer[34]);
2596
+
2597
+ /**
2598
+ * Generate a hash value (message digest)
2599
+ *
2600
+ * @param string String to be hashed.
2601
+ * @param type Type of selected hashing algorithm. See Hash_* constants in amxconst.inc file.
2602
+ * @param output Output string to store hash in.
2603
+ * @param outputSize The maximum size of the output string to store hash in.
2604
+ *
2605
+ * @return Number of written bytes.
2606
+ */
2607
+ native hash_string(const string[], const HashType:type, output[], const outputSize);
2608
+
2609
+ /**
2610
+ * Generate a hash value using the contents of a given file
2611
+ *
2612
+ * @param fileName Path of file to be hashed.
2613
+ * @param type Type of selected hashing algorithm. See Hash_* constants in amxconst.inc file.
2614
+ * @param output Output string to store hash in.
2615
+ * @param outputSize The maximum size of the output string to store hash in.
2616
+ *
2617
+ * @return Number of written bytes.
2618
+ * @error If the file couldn't be opened, an error is thrown.
2619
+ */
2620
+ native hash_file(const fileName[], const HashType:type, output[], const outputSize);
2621
+
2622
+ /**
2623
+ * Returns the internal flags set on the plugin's state.
2624
+ *
2625
+ * @param hdr If nonzero, the function will return the pcode rather than
2626
+ * state flags
2627
+ * @param plid Plugin id, -1 to target calling plugin
2628
+ *
2629
+ * @return Plugin flags
2630
+ */
2631
+ native plugin_flags(hdr = 0, plid = -1);
2632
+
2633
+ /**
2634
+ * Allows plugins to declare module dependencies using require_module()
2635
+ *
2636
+ * @deprecated Module dependency has been automatically handled by the compiler
2637
+ * since AMXX 1.50, released in 2005. This forward is no longer
2638
+ * called.
2639
+ *
2640
+ * @noreturn
2641
+ */
2642
+ #pragma deprecated Module dependency is now automatically handled by the compiler. This forward is no longer called.
2643
+ forward plugin_modules();
2644
+
2645
+ /**
2646
+ * Adds a module dependency.
2647
+ *
2648
+ * @deprecated Module dependency has been automatically handled by the compiler
2649
+ * since AMXX 1.50, released in 2005. This native has no effect.
2650
+ *
2651
+ * @noreturn
2652
+ */
2653
+ #pragma deprecated Module dependency is now automatically handled by the compiler. This native has no effect.
2654
+ native require_module(const module[]);
2655
+
2656
+ /**
2657
+ * Returns if the server is 64 bit.
2658
+ *
2659
+ * @deprecated As a result of Valve dropping support for 64bit binaries, AMXX is
2660
+ * also not shipping 64bit builds anymore. This native is basically
2661
+ * guaranteed to return 0.
2662
+ *
2663
+ * @return 1 if the server is 64 bit, 0 otherwise
2664
+ */
2665
+ #pragma deprecated AMXX is not shipping 64bits builds anymore. This native is basically guaranteed to return 0.
2666
+ native is_amd64_server();
2667
+
2668
+ /**
2669
+ * Returns plugin id by filename.
2670
+ *
2671
+ * @param filename Filename to match
2672
+ * @param ignoreCase If nonzero matches case insensitively, case sensitively
2673
+ * otherwise
2674
+ *
2675
+ * @return Plugin id, -1 (INVALID_PLUGIN_ID) on failure
2676
+ */
2677
+ native find_plugin_byfile(const filename[], ignoreCase = 1);
2678
+
2679
+ /**
2680
+ * Called before plugin_init(), allows the plugin to register natives.
2681
+ *
2682
+ * @noreturn
2683
+ */
2684
+ forward plugin_natives();
2685
+
2686
+ /**
2687
+ * Registers a native.
2688
+ *
2689
+ * @note Style 0 natives call the handler in the following manner:
2690
+ *
2691
+ * public native_handler(plugin_id, argc)
2692
+ *
2693
+ * plugin_id - plugin calling the native
2694
+ * argc - number of parameters
2695
+ *
2696
+ * @note Style 1 natives are deprecated. Plugins should not use them, they might
2697
+ * break.
2698
+ * @note Style 1 natives work a little different. Instead of passing plugin id
2699
+ * and number of parameters, the handler should be prototyped just like the
2700
+ * native would be called. For each by-reference parameter, the plugin
2701
+ * then has to use param_convert() to properly use them.
2702
+ * @note A native should *never* recurse. Bad things will happen.
2703
+ *
2704
+ * @param name Native name
2705
+ * @param handler Callback function
2706
+ * @param style Native style
2707
+ *
2708
+ * @noreturn
2709
+ * @error If an invalid callback is specified, an error is thrown.
2710
+ */
2711
+ native register_native(const name[], const handler[], style = 0);
2712
+
2713
+ /**
2714
+ * Registers the plugin as a library.
2715
+ *
2716
+ * @note To mark a library as required, place the following in the include
2717
+ * file:
2718
+ * #pragma reqlib <name>
2719
+ * #if !defined AMXMODX_NOAUTOLOAD
2720
+ * #pragma loadlib <name>
2721
+ * #endif
2722
+ *
2723
+ * @noreturn
2724
+ */
2725
+ native register_library(const library[]);
2726
+
2727
+ /**
2728
+ * Logs an error in the native and breaks into the AMXX debugger.
2729
+ *
2730
+ * @note This acts as if the calling plugin - the plugin that is calling the
2731
+ * native, not the plugin calling this function - triggered the error,
2732
+ * just like when AMXX natives error.
2733
+ *
2734
+ * @param error Error number
2735
+ * @param fmt Formatting rules
2736
+ * @param ... Variable number of formatting parameters
2737
+ *
2738
+ * @noreturn
2739
+ * @error The function is guaranteed to throw an error, but will make
2740
+ * it appear as if the plugin calling the native triggered it.
2741
+ */
2742
+ native log_error(error, const fmt[], any:...);
2743
+
2744
+ /**
2745
+ * Converts a parameter to work as a by-reference parameter.
2746
+ *
2747
+ * @deprecated Style 1 natives are deprecated and should be converted to
2748
+ * style 0. This should not be used.
2749
+ *
2750
+ * @note This only needs to be called if the native was registered with style 1.
2751
+ * @note Remember that arrays (and strings) are always by-reference and need to
2752
+ * be converted.
2753
+ *
2754
+ * @param num Argument to convert, starting from 1
2755
+ *
2756
+ * @noreturn
2757
+ * @error If used outside of a native callback, or the native was
2758
+ * created with style 0, an error will be thrown.
2759
+ */
2760
+ native param_convert(num);
2761
+
2762
+ /**
2763
+ * Retrieves a string from the plugin calling the native.
2764
+ *
2765
+ * @param param Argument to retrieve, starting from 1
2766
+ * @param dest Buffer to copy string to
2767
+ * @param maxlen Maximum size of buffer
2768
+ *
2769
+ * @return Number of cells copied to buffer
2770
+ * @error If used outside of a native callback, or the native was
2771
+ * created with style 1, an error will be thrown.
2772
+ */
2773
+ native get_string(param, dest[], maxlen);
2774
+
2775
+ /**
2776
+ * Copies a string to the plugin calling the native.
2777
+ *
2778
+ * @param param Argument to set, starting from 1
2779
+ * @param dest Buffer to copy string from
2780
+ * @param maxlen Maximum size of buffer
2781
+ *
2782
+ * @return Number of cells copied from buffer
2783
+ * @error If used outside of a native callback, or the native was
2784
+ * created with style 1, an error will be thrown.
2785
+ */
2786
+ native set_string(param, dest[], maxlen);
2787
+
2788
+ /**
2789
+ * Returns the integer value of a parameter from the plugin calling the native.
2790
+ *
2791
+ * @param param Argument to retrieve, starting from 1
2792
+ *
2793
+ * @return Integer value
2794
+ * @error If used outside of a native callback, or the native was
2795
+ * created with style 1, an error will be thrown.
2796
+ */
2797
+ native get_param(param);
2798
+
2799
+ /**
2800
+ * Returns the float value of a parameter from the plugin calling the native.
2801
+ *
2802
+ * @param param Argument to retrieve, starting from 1
2803
+ *
2804
+ * @return Float value
2805
+ * @error If used outside of a native callback, or the native was
2806
+ * created with style 1, an error will be thrown.
2807
+ */
2808
+ native Float:get_param_f(param);
2809
+
2810
+ /**
2811
+ * Returns the integer value of a by-reference parameter from the plugin calling
2812
+ * the native.
2813
+ *
2814
+ * @param param Argument to retrieve, starting from 1
2815
+ *
2816
+ * @return Integer value
2817
+ * @error If used outside of a native callback, or the native was
2818
+ * created with style 1, an error will be thrown.
2819
+ */
2820
+ native get_param_byref(param);
2821
+
2822
+ /**
2823
+ * Returns the float value of a by-reference parameter from the plugin calling
2824
+ * the native.
2825
+ *
2826
+ * @param param Argument to retrieve, starting from 1
2827
+ *
2828
+ * @return Float value
2829
+ * @error If used outside of a native callback, or the native was
2830
+ * created with style 1, an error will be thrown.
2831
+ */
2832
+ native Float:get_float_byref(param);
2833
+
2834
+ /**
2835
+ * Sets the integer value of a by-reference parameter to the plugin calling the
2836
+ * native.
2837
+ *
2838
+ * @param param Argument to set, starting from 1
2839
+ * @param value Value to set parameter to
2840
+ *
2841
+ * @noreturn
2842
+ * @error If used outside of a native callback, or the native was
2843
+ * created with style 1, an error will be thrown.
2844
+ */
2845
+ native set_param_byref(param, value);
2846
+
2847
+ /**
2848
+ * Sets the float value of a by-reference parameter to the plugin calling the
2849
+ * native.
2850
+ *
2851
+ * @param param Argument to set, starting from 1
2852
+ * @param value Value to set parameter to
2853
+ *
2854
+ * @noreturn
2855
+ * @error If used outside of a native callback, or the native was
2856
+ * created with style 1, an error will be thrown.
2857
+ */
2858
+ native set_float_byref(param, Float:value);
2859
+
2860
+ /**
2861
+ * Retrieves an array from the plugin calling the native.
2862
+ *
2863
+ * @param param Argument to retrieve, starting from 1
2864
+ * @param dest Buffer to copy array to
2865
+ * @param maxlen Size of buffer
2866
+ *
2867
+ * @noreturn
2868
+ * @error If used outside of a native callback, or the native was
2869
+ * created with style 1, an error will be thrown.
2870
+ */
2871
+ native get_array(param, dest[], size);
2872
+
2873
+ /**
2874
+ * Retrieves a float array from the plugin calling the native.
2875
+ *
2876
+ * @param param Argument to retrieve, starting from 1
2877
+ * @param dest Buffer to copy array to
2878
+ * @param maxlen Size of buffer
2879
+ *
2880
+ * @noreturn
2881
+ * @error If used outside of a native callback, or the native was
2882
+ * created with style 1, an error will be thrown.
2883
+ */
2884
+ native get_array_f(param, Float:dest[], size);
2885
+
2886
+ /**
2887
+ * Copies an array to the plugin calling the native.
2888
+ *
2889
+ * @param param Argument to set, starting from 1
2890
+ * @param source Buffer to copy array from
2891
+ * @param maxlen Size of buffer
2892
+ *
2893
+ * @noreturn
2894
+ * @error If used outside of a native callback, or the native was
2895
+ * created with style 1, an error will be thrown.
2896
+ */
2897
+ native set_array(param, const source[], size);
2898
+
2899
+ /**
2900
+ * Copies a float array to the plugin calling the native.
2901
+ *
2902
+ * @param param Argument to set, starting from 1
2903
+ * @param source Buffer to copy array from
2904
+ * @param maxlen Size of buffer
2905
+ *
2906
+ * @noreturn
2907
+ * @error If used outside of a native callback, or the native was
2908
+ * created with style 1, an error will be thrown.
2909
+ */
2910
+ native set_array_f(param, const Float:source[], size);
2911
+
2912
+ /**
2913
+ * Allows to trap error messages that occur in a plugin.
2914
+ *
2915
+ * @note This can be used to override the debug messages that occur when the
2916
+ * plugin causes some kind of runtime error.
2917
+ * @note The handler will be called in the following manner:
2918
+ *
2919
+ * public error_filter(error_code, bool:debugging, message[])
2920
+ *
2921
+ * error_code - AMX_ERR_* code.
2922
+ * debugging - True if the plugin is in debug mode, false otherwise
2923
+ * message[] - Message sent along with the error
2924
+ *
2925
+ * @note The handler should return PLUGIN_CONTINUE to let the error through the
2926
+ * filter, or PLUGIN_HANDLED to block the error from displaying.
2927
+ *
2928
+ * @param handler Function name to call
2929
+ *
2930
+ * @noreturn
2931
+ * @error If an invalid callback function is provided, an error
2932
+ * is thrown.
2933
+ */
2934
+ native set_error_filter(const handler[]);
2935
+
2936
+ /**
2937
+ * Returns a trace handle for the item at the top of the traced call stack.
2938
+ *
2939
+ * @note Intended for use inside an error handler set with set_error_filter()
2940
+ *
2941
+ * @return Trace handle, 0 if no debugging information is available
2942
+ */
2943
+ native dbg_trace_begin();
2944
+
2945
+ /**
2946
+ * Returns the next item in a traced call stack.
2947
+ *
2948
+ * @param trace Trace handle
2949
+ *
2950
+ * @return New trace handle, 0 if no more traces exist
2951
+ */
2952
+ native dbg_trace_next(trace);
2953
+
2954
+ /**
2955
+ * Retrieves the call stack info for a trace.
2956
+ *
2957
+ * @param trace Trace handle
2958
+ * @param line Variable to set line at which plugin failed to
2959
+ * @param function Buffer to copy function to
2960
+ * @param maxLength1 Maximum function buffer size
2961
+ * @param file Buffer to copy filename to
2962
+ * @param maxLength2 Maximum filename buffer size
2963
+ *
2964
+ * @return 1 on success, 0 if no trace data is available
2965
+ */
2966
+ native dbg_trace_info(trace, &line, function[], maxLength1, file[], maxLength2);
2967
+
2968
+ /**
2969
+ * Retrieves the formatted error string from a trace.
2970
+ *
2971
+ * @note The string format is generally: "Run time error <errno>: <description>"
2972
+ *
2973
+ * @param buffer Buffer to copy error message to
2974
+ * @param maxLength Maximum buffer size
2975
+ *
2976
+ * @return 1 on success, 0 if no trace data is available
2977
+ */
2978
+ native dbg_fmt_error(buffer[], maxLength);
2979
+
2980
+ /**
2981
+ * Sets a native filter, letting the plugin intercept and handle an
2982
+ * automatic native requirement.
2983
+ *
2984
+ * @note This has to be used inside the plugin_native() forward, otherwise it
2985
+ * has no effect.
2986
+ * @note This is useful for creating plugins that can dynamically decide which
2987
+ * modules or features to use at runtime, often necessary for cross-mod
2988
+ * plugins. It allows to deploy a single version of the plugin instead
2989
+ * of compiling multiple versions for each use-case.
2990
+ * @note The handler will be called in the following manner:
2991
+ *
2992
+ * public native_filter(const native[], index, trap)
2993
+ *
2994
+ * native - Native name
2995
+ * index - Native index
2996
+ * trap - 0 if native couldn't be found, 1 if native use was attempted
2997
+ *
2998
+ * @note The handler should return PLUGIN_CONTINUE to let the error through the
2999
+ * filter (which will throw a run-time error), or return PLUGIN_HANDLED
3000
+ * to continue operation.
3001
+ * @note Returning PLUGIN_CONTINUE if trap is 0 will result in the plugin
3002
+ * failing to load!
3003
+ *
3004
+ * @param handler Function name to call
3005
+ *
3006
+ * @return 1 if handler is set successfully, 0 otherwise (called
3007
+ * outside of plugin_native() forward)
3008
+ * @error If an invalid callback function is provided, an error is
3009
+ * thrown.
3010
+ */
3011
+ native set_native_filter(const handler[]);
3012
+
3013
+ /**
3014
+ * Sets a module/library filter, letting the plugin intercept and handle an
3015
+ * automatic module requirement.
3016
+ *
3017
+ * @note This has to be used inside the plugin_native() forward, otherwise it
3018
+ * has no effect.
3019
+ * @note This is useful for creating plugins that can dynamically decide which
3020
+ * modules or features to use at runtime, often necessary for cross-mod
3021
+ * plugins. It allows to deploy a single version of the plugin instead
3022
+ * of compiling multiple versions for each use-case.
3023
+ * @note For a list of possible libtypes see the LibType enum in amxconst.inc
3024
+ * @note The handler will be called in the following manner:
3025
+ *
3026
+ * public module_filter(const library[], LibType:type)
3027
+ *
3028
+ * library - Shortname of library or class that is required
3029
+ * libtrype - Type of requirement being checked (library/module or class)
3030
+ *
3031
+ * @note The handler should return PLUGIN_CONTINUE to let the error through the
3032
+ * filter (which will result in the plugin failing to load), or
3033
+ * PLUGIN_HANDLED to imply that load can continue without the module.
3034
+ * @note Errors occuring inside the handler will not be filtered and cause the
3035
+ * plugin to fail load as if the handler returned PLUGIN_CONTINUE.
3036
+ *
3037
+ * @return 0 on success, -1 if filtering is not available, -2 if handler
3038
+ * could not be found.
3039
+ */
3040
+ native set_module_filter(const handler[]);
3041
+
3042
+ /**
3043
+ * Aborts execution of the current callback by throwing an error.
3044
+ *
3045
+ * @note Warning: This function should not be used inside error filters, module
3046
+ * filters (native filters are safe if trap equals 1) or the
3047
+ * plugin_natives() forward.
3048
+ * @note The message will automatically be tagged with the plugin's name and the
3049
+ * log will include a timestamp with the message.
3050
+ * @note For a list of possible error codes, see AMX_* constants in amxconst.inc
3051
+ *
3052
+ * @param error Error code
3053
+ * @param fmt Formatting rules
3054
+ * @param ... Variable list of formatting parameters
3055
+ *
3056
+ * @noreturn
3057
+ * @error The function is guaranteed to throw an error, using the
3058
+ * specified custom log message.
3059
+ */
3060
+ native abort(error, const fmt[] = "", any:...);
3061
+
3062
+ /**
3063
+ * Returns if a specific module is loaded.
3064
+ *
3065
+ * @note This uses the same method AMXX uses internally to see if a module is
3066
+ * required by a plugin.
3067
+ * @note Example usage: module_exists("cstrike")
3068
+ *
3069
+ * @param logtag Module shortname
3070
+ *
3071
+ * @return 1 if module is loaded, 0 otherwise
3072
+ */
3073
+ native module_exists(const logtag[]);
3074
+
3075
+ /**
3076
+ * Returns if a specific library or class is loaded.
3077
+ *
3078
+ * @note This is the newer version of module_exists(), enabling users to
3079
+ * distinguish between libraries and classes, while module_exists() always
3080
+ * checks for both types.
3081
+ * @note For a list of possible types, see the LibType enum in amxconst.inc
3082
+ *
3083
+ * @param library Library/Class shortname
3084
+ * @param type Type to search for
3085
+ *
3086
+ * @return 1 if module is loaded, 0 otherwise
3087
+ */
3088
+ native LibraryExists(const library[], LibType:type);
3089
+
3090
+ /**
3091
+ * Returns the next valid hudchannel for the client.
3092
+ *
3093
+ * @note This function uses the same method set_hudmessage() uses to determine
3094
+ * the next channel if it is set to auto-select.
3095
+ *
3096
+ * @param player Client index
3097
+ *
3098
+ * @return Valid hudchannel (1-4)
3099
+ * @error If the index is not within the range of 1 to MaxClients or
3100
+ * the client is not connected, an error will be thrown.
3101
+ */
3102
+ native next_hudchannel(player);
3103
+
3104
+ /**
3105
+ * Creates a HUD synchronization object.
3106
+ *
3107
+ * @note Create one of these for each section of the screen that contains
3108
+ * overlapping HUD messages. For example, if using both sides of the
3109
+ * screen to display three messages that could potentially overlap,
3110
+ * each side is considered a synchronizable area. You can then use
3111
+ * ShowSyncHudMsg() to correctly synchronize displaying the HUD message
3112
+ * with any other messages potentially in its class.
3113
+ * @note This does not do anything like reserving screen area. Its sole
3114
+ * purpose is to be able to wipe an old message on an auto-channel and
3115
+ * ensure that it will not clear a message from another plugin.
3116
+ *
3117
+ * @param num Unused and ignored
3118
+ * @param ... Unused and ignored
3119
+ *
3120
+ * @return HUD sync object handle
3121
+ */
3122
+ native CreateHudSyncObj(num = 0, ...);
3123
+
3124
+ /**
3125
+ * Displays a synchronized HUD message.
3126
+ *
3127
+ * @note This will check that the HUD object has its previous display on the
3128
+ * screen cleared before it proceeds to write another message. It will
3129
+ * only do this in the case of that channel not having been cleared
3130
+ * already.
3131
+ * @note This uses the display parameters set with set_hudmessage(), ignoring
3132
+ * the selected channel in favor of its own synchronization.
3133
+ * @note This functions return value behaves differently depending on what is
3134
+ * used as the client index: If 0 is specified, then the function will
3135
+ * return 0 if nothing has been sent (no client connected). If either a
3136
+ * single client is specified, or there is at least one client connected,
3137
+ * the number of printed characters will refer to the message that is sent
3138
+ * last, to the client with the highest index.
3139
+ *
3140
+ * @param target Client index, use 0 to display to all clients
3141
+ * @param syncObj HUD sync object handle
3142
+ * @param fmt Formatting rules
3143
+ * @param ... Variable number of formatting parameters
3144
+ *
3145
+ * @return Number of printed characters
3146
+ * @error If a single client is specified and the index is not within
3147
+ * the range of 1 to MaxClients, an error will be thrown.
3148
+ */
3149
+ native ShowSyncHudMsg(target, syncObj, const fmt[], any:...);
3150
+
3151
+ /**
3152
+ * Clears the display on a HUD sync object.
3153
+ *
3154
+ * @note This sends an empty message to the previously occupied HUD channel.
3155
+ * It is not quite the same as manually sending an empty message to the
3156
+ * sync object as that would send out two separate messages, one for
3157
+ * clearing the occupied channel and another using a new channel, which
3158
+ * will subsequently not mark the sync object as cleared.
3159
+ *
3160
+ * @param target Client index, use 0 to display to all clients
3161
+ * @param syncObj HUD sync object handle
3162
+ *
3163
+ * @noreturn
3164
+ * @error If a single client is specified and the index is not within
3165
+ * the range of 1 to MaxClients, an error will be thrown.
3166
+ */
3167
+ native ClearSyncHud(target, syncObj);
3168
+
3169
+ /**
3170
+ * Triggers the software interrupt 3, used for breaking into an attached
3171
+ * debugger.
3172
+ *
3173
+ * @note Warning: This is a debugging function that is not intended for general
3174
+ * plugin use. Using this function will either halt the server and break
3175
+ * into the attached debugger, or outright crash the server if no
3176
+ * debugger is attached.
3177
+ *
3178
+ * @noreturn
3179
+ */
3180
+ native int3();
3181
+
3182
+ /**
3183
+ * Sets the calling plugin to a failed state.
3184
+ *
3185
+ * @note Calling this will cause the calling plugin to completely cease
3186
+ * operation. It is not possible to recover.
3187
+ * @note This should be used to gracefully handle fatal errors. The log message
3188
+ * will appear in the AMXX error log.
3189
+ *
3190
+ * @param fmt Formatting rules
3191
+ * @param ... Variable number of formatting parameters
3192
+ *
3193
+ * @noreturn
3194
+ * @error The function is guaranteed to throw a fatal error, ceasing
3195
+ * further operation of the plugin.
3196
+ */
3197
+ native set_fail_state(const fmt[], any:...);
3198
+
3199
+ /**
3200
+ * Returns the reference address of the variable passed in.
3201
+ *
3202
+ * @note Addresses are local to the plugin and do not represent a full CPU
3203
+ * address.
3204
+ *
3205
+ * @param ... Variable to retrieve address from
3206
+ *
3207
+ * @return Variable address
3208
+ */
3209
+ native get_var_addr(any:...);
3210
+
3211
+ /**
3212
+ * Returns the value of an address.
3213
+ *
3214
+ * @note Addresses can be acquired using get_var_addr()
3215
+ *
3216
+ * @param addr Variable address
3217
+ *
3218
+ * @return Value at address
3219
+ * @error If the plugin attempts to access an address outside of the
3220
+ * stack or heap limits of the plugin, an error will be thrown.
3221
+ */
3222
+ native get_addr_val(addr);
3223
+
3224
+ /**
3225
+ * Sets the value of an address.
3226
+ *
3227
+ * @note Addresses can be acquired using get_var_addr()
3228
+ *
3229
+ * @param addr Variable address
3230
+ * @param val Value to set
3231
+ *
3232
+ * @noreturn
3233
+ * @error If the plugin attempts to access an address outside of the
3234
+ * stack or heap limits of the plugin, an error will be thrown.
3235
+ */
3236
+ native set_addr_val(addr, val);
3237
+
3238
+ /**
3239
+ * Creates a global forward that will be called in all plugins.
3240
+ *
3241
+ * @note For a list of valid stop types, see the ET_* constants in amxconst.inc
3242
+ * @note For a list of valid parameter types, see the FP_* constants in
3243
+ * amxconst.inc
3244
+ *
3245
+ * @param name Function name to call
3246
+ * @param stop_type Treatment of the plugin return values
3247
+ * @param ... List of parameter types
3248
+ *
3249
+ * @return Forward handle, -1 on failure
3250
+ */
3251
+ native CreateMultiForward(const name[], stop_type, ...);
3252
+
3253
+ /**
3254
+ * Creates a private forward that will be called in a single plugin.
3255
+ *
3256
+ * @note Unlike other natives expecting a plugin id, specifying -1 will not
3257
+ * select the calling plugin, and instead throw an error.
3258
+ *
3259
+ * @param plugin_id Plugin to call forward in. The plugin id can be
3260
+ * retrieved using find_plugin_byfile()
3261
+ * @param name Function name to call
3262
+ * @param ... List of parameter types
3263
+ *
3264
+ * @return Forward handle, -1 on failure
3265
+ * @error If an invalid plugin id is specified, an error will be
3266
+ * thrown.
3267
+ */
3268
+ native CreateOneForward(plugin_id, const name[], ...);
3269
+
3270
+ /**
3271
+ * Prepares an array for use in a forward. Pass the result ExecuteForward()
3272
+ * instead of the array itself.
3273
+ *
3274
+ * @param array Array to prepare
3275
+ * @param size Size of array
3276
+ * @param copyback If nonzero, modifications made by the called plugin(s)
3277
+ * will be copied back to the caller
3278
+ *
3279
+ * @return Special handle for use in ExecuteForward()
3280
+ */
3281
+ native PrepareArray(const array[], size, copyback = 0);
3282
+
3283
+ /**
3284
+ * Executes a forward.
3285
+ *
3286
+ * @note Passing arrays requires them to be prepared using PrepareArray()
3287
+ *
3288
+ * @param forward_handle Forward handle
3289
+ * @param ret Optional variable to store return value in
3290
+ * @param ... Variable number of parameters to pass through
3291
+ *
3292
+ * @return 1 on success, 0 if forward can't be executed
3293
+ * @error If the number of parameters mismatch from the number
3294
+ * of parameters that the forward was declared with,
3295
+ * an error is thrown.
3296
+ */
3297
+ native ExecuteForward(forward_handle, &ret = 0, any:...);
3298
+
3299
+ /**
3300
+ * Destroys and deallocates a forward.
3301
+ *
3302
+ * @note Does not distinguish between private and global forwards.
3303
+ *
3304
+ * @param forward_handle Forward handle
3305
+ *
3306
+ * @noreturn
3307
+ */
3308
+ native DestroyForward(forward_handle);
3309
+
3310
+ /**
3311
+ * Sets all elements of array to a specified value.
3312
+ *
3313
+ * @param array Array to modify
3314
+ * @param value Value to set each element to
3315
+ * @param size Size of array
3316
+ *
3317
+ * @noreturn
3318
+ */
3319
+ native arrayset(any:array[], any:value, size);
3320
+
3321
+ /**
3322
+ * Returns the weapon id associated with a weapon name.
3323
+ *
3324
+ * @note The weapon name is case sensitive and has the weapon_* form.
3325
+ *
3326
+ * @param name Weapon name
3327
+ *
3328
+ * @return Weapon id, or 0 if no id was found
3329
+ */
3330
+ native get_weaponid(const name[]);
3331
+
3332
+ /**
3333
+ * Adds an admin to the dynamic admin storage for lookup at a later time.
3334
+ *
3335
+ * @note For a list of possible access flags, see the ADMIN_* constants in
3336
+ * amxconst.inc
3337
+ * @note For a list of possible auth flags, see the FLAG_* constants in
3338
+ * amxconst.inc
3339
+ *
3340
+ * @param AuthData Auth information to set (can be name, IP or SteamID)
3341
+ * @param Password Password to set
3342
+ * @param Access Admin access flags
3343
+ * @param Flags Auth behavior flags
3344
+ *
3345
+ * @noreturn
3346
+ */
3347
+ native admins_push(const AuthData[], const Password[], Access, Flags);
3348
+
3349
+ /**
3350
+ * Returns the number of admins in the dynamic admin storage.
3351
+ *
3352
+ * @return Number of admins
3353
+ */
3354
+ native admins_num();
3355
+
3356
+ /**
3357
+ * Retrieves information about a dynamically stored admin.
3358
+ *
3359
+ * @note For a list of possible props, see the AdminProp enum in amxconst.inc
3360
+ *
3361
+ * @param num Admin storage index
3362
+ * @param Property Admin property to retrieve
3363
+ * @param Buffer Buffer to copy property information to, if AdminProp_Auth
3364
+ * or AdminProp_Password is specified
3365
+ * @param BufferSize Maximum buffer size
3366
+ *
3367
+ * @return Property value if AdminProp_Access or AdminProp_Flags
3368
+ * is requested, 0 otherwise
3369
+ * @error If an invalid storage index is specified, an error will
3370
+ * be thrown.
3371
+ */
3372
+ native admins_lookup(num, AdminProp:Property, Buffer[] = "", BufferSize = 0);
3373
+
3374
+ /**
3375
+ * Clears the list of dynamically stored admins.
3376
+ *
3377
+ * @noreturn
3378
+ */
3379
+ native admins_flush();
3380
+
3381
+ /**
3382
+ * Returns if a map contains at least one entity with the provided class name.
3383
+ *
3384
+ * @param classname Entity classname to match
3385
+ *
3386
+ * @return True if an entity is found, false otherwise
3387
+ */
3388
+ native bool:has_map_ent_class(const classname[]);
3389
+
3390
+
3391
+ /**
3392
+ * Called when the map has loaded, and all configs are done executing.
3393
+ * This includes servercfgfile (server.cfg), amxx.cfg, plugin's config, and
3394
+ * per-map config.
3395
+ *
3396
+ * @note This is best place to initialize plugin functions which are based on cvar data.
3397
+ * @note This will always be called once and only once per map. It will be
3398
+ * called few seconds after plugin_cfg().
3399
+ *
3400
+ * @noreturn
3401
+ */
3402
+ forward OnConfigsExecuted();
3403
+
3404
+ /**
3405
+ * Called when the map has loaded, right after plugin_cfg() but any time
3406
+ * before OnConfigsExecuted. It's called after amxx.cfg and all
3407
+ * AutoExecConfig() exec commands have been added to the server command buffer.
3408
+ *
3409
+ * @note This will always be called once and only once per map.
3410
+ *
3411
+ * @noreturn
3412
+ */
3413
+ forward OnAutoConfigsBuffered();
3414
+
3415
+ /**
3416
+ * Specifies that the given config file should be executed after plugin load.
3417
+ *
3418
+ * @note OnConfigsExecuted() will not be called until the config file has executed,
3419
+ * but it will be called if the execution fails.
3420
+ * @note The name parameter should not contain dots, otherwise file will not be executed.
3421
+ *
3422
+ * @param autoCreate If true, and the config file does not exist, such a config
3423
+ * file will be automatically created and populated with
3424
+ * information from the plugin's registered cvars.
3425
+ * @param name Name of the config file, excluding the .cfg extension.
3426
+ * If empty, <plugin.filename.cfg> is assumed.
3427
+ * @param folder Folder under plugins/ to use.
3428
+ *
3429
+ * @noreturn
3430
+ */
3431
+ native AutoExecConfig(bool:autoCreate = true, const name[] = "", const folder[] = "");
3432
+
3433
+ /**
3434
+ * Creates a single use hook for the next frame.
3435
+ *
3436
+ * @param callback Function to be executed on the next frame.
3437
+ * @param data Optional data to be passed to the callback function.
3438
+ *
3439
+ * @note Callback function prototype:
3440
+ * public function(data)
3441
+ *
3442
+ * @noreturn
3443
+ */
3444
+ native RequestFrame(const callback[], any:data = 0);
3445
+
3446
+ // Always keep this at the bottom of this file
3447
+ #include <message_stocks>