@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,3302 @@
1
+ // The tooltips of as/facade.ts, in both languages: scripts/apply-docs.ts writes the
2
+ // one AMXTS_DOCS_LANG picks into the JSDoc above each element.
3
+ export default {
4
+ 'Handler': {
5
+ en: `A handler that takes a player \`id\` and returns nothing — what player events and commands call.`,
6
+ ru: `Обработчик, который получает \`id\` игрока и ничего не возвращает, — так вызываются события игрока и команды.`,
7
+ },
8
+ 'WideHandler': {
9
+ en: `
10
+ A handler that takes up to four numbers and returns nothing: for a forward
11
+ that passes more than a player \`id\`, and for a hookchain.
12
+
13
+ A string argument arrives as a number: read it with \`argString\`. To stop
14
+ the event, or to block what a hookchain hooks, call \`handled()\`.
15
+ `,
16
+ ru: `
17
+ Обработчик, который получает до четырёх чисел и ничего не возвращает: для
18
+ форварда, который передаёт больше, чем \`id\` игрока, и для хукчейна.
19
+
20
+ Строковый аргумент приходит числом: прочитайте его через \`argString\`.
21
+ Чтобы остановить событие или заблокировать то, что перехватывает хукчейн,
22
+ вызовите \`handled()\`.
23
+ `,
24
+ },
25
+ 'hostIndex': {
26
+ en: `@hidden For the hood: what the server calls for \`handler\`.`,
27
+ ru: `@hidden Для капота: что сервер вызывает вместо \`handler\`.`,
28
+ },
29
+ 'handled': {
30
+ en: `
31
+ Stops the event: AMX Mod X passes it to no one else, and a hookchain does
32
+ not call what it hooked. Applies only to the handler that is running.
33
+
34
+ function onSay(id: number) {
35
+ if (muted(id)) handled();
36
+ }
37
+
38
+ Pawn: \`return PLUGIN_HANDLED\`
39
+ `,
40
+ ru: `
41
+ Останавливает событие: AMX Mod X больше никому его не передаёт, а хукчейн
42
+ не вызывает то, что перехватил. Действует только на выполняющийся
43
+ обработчик.
44
+
45
+ function onSay(id: number) {
46
+ if (muted(id)) handled();
47
+ }
48
+
49
+ Pawn: \`return PLUGIN_HANDLED\`
50
+ `,
51
+ },
52
+
53
+ 'floatCell': {
54
+ en: `
55
+ Converts a number to a Pawn \`Float:\` cell, for a raw native or \`ret()\`:
56
+
57
+ ret(floatCell(2.5));
58
+ rg_round_end(floatCell(5.0), ...);
59
+ `,
60
+ ru: `
61
+ Переводит число в ячейку \`Float:\` для Pawn — для сырого натива или \`ret()\`:
62
+
63
+ ret(floatCell(2.5));
64
+ rg_round_end(floatCell(5.0), ...);
65
+ `,
66
+ },
67
+ 'rounded': {
68
+ en: `
69
+ Rounds a number to the nearest whole number: a round time of 59.6 seconds
70
+ is \`60\`, not \`59\`.
71
+
72
+ Pawn: \`floatround\`
73
+ `,
74
+ ru: `
75
+ Округляет число до ближайшего целого: время раунда 59.6 секунды — это \`60\`,
76
+ а не \`59\`.
77
+
78
+ Pawn: \`floatround\`
79
+ `,
80
+ },
81
+ 'cellFloat': {
82
+ en: `Converts a Pawn \`Float:\` cell back to a number.`,
83
+ ru: `Переводит ячейку \`Float:\` из Pawn обратно в число.`,
84
+ },
85
+ 'ret': {
86
+ en: `Sets the value an exported native returns to the plugin that called it.`,
87
+ ru: `Задаёт значение, которое экспортированный натив возвращает вызвавшему его плагину.`,
88
+ },
89
+ 'publicFor': {
90
+ en: `
91
+ A public name that calls \`handler\`, for an AMX Mod X native that takes a
92
+ callback by name: \`register_think\`, \`set_native_filter\`.
93
+
94
+ \`\`\`ts
95
+ const pub = publicFor(onThink, "think:myplugin_box");
96
+ if (pub.length > 0) register_think("myplugin_box", pub);
97
+ \`\`\`
98
+
99
+ An empty name means “already registered”: such a registration cannot be
100
+ undone and survives a hot reload, so registering again would call the
101
+ handler twice. \`key\` identifies the registration across reloads — any name
102
+ unique within the plugin. \`fallback\` is the answer when the handler returns
103
+ nothing: \`0\` for most natives, \`1\` where the native expects the event handled.
104
+
105
+ Register from the \`"cfg"\` event, not at the top of the file: a console
106
+ command registered that early (\`register_concmd\`, \`register_srvcmd\`) crashes
107
+ the server when typed.
108
+ `,
109
+ ru: `
110
+ Имя паблика, который вызывает \`handler\`, — для натива AMX Mod X,
111
+ принимающего колбэк по имени: \`register_think\`, \`set_native_filter\`.
112
+
113
+ \`\`\`ts
114
+ const pub = publicFor(onThink, "think:myplugin_box");
115
+ if (pub.length > 0) register_think("myplugin_box", pub);
116
+ \`\`\`
117
+
118
+ Пустое имя значит «уже зарегистрировано»: такую регистрацию нельзя
119
+ отменить, она переживает горячую перезагрузку, и повторная вызывала бы
120
+ обработчик дважды. \`key\` опознаёт регистрацию между перезагрузками — любое
121
+ имя, уникальное в пределах плагина. \`fallback\` — ответ, если обработчик
122
+ ничего не вернул: \`0\` почти везде, \`1\` там, где натив ждёт обработанное событие.
123
+
124
+ Регистрируйте из события \`"cfg"\`, а не с верхнего уровня файла: консольная
125
+ команда, зарегистрированная так рано (\`register_concmd\`, \`register_srvcmd\`),
126
+ роняет сервер, когда её вводят.
127
+ `,
128
+ },
129
+ 'nativeFn': {
130
+ en: `
131
+ Exports a native for other plugins - Pawn ones included - to call.
132
+
133
+ nativeFn("myplugin_get_mode", getGameMode)
134
+
135
+ function getGameMode(a: number, b: number, c: number, d: number) {
136
+ ret(mode);
137
+ }
138
+
139
+ The handler gets the first four arguments as numbers; \`arg(i)\` and
140
+ \`argText(i)\` read any of them, \`setArg\` and \`setArgText\` write back.
141
+ Simpler: an \`export function\` of the entry file is a native with real
142
+ types (see the Natives page).
143
+
144
+ Call it at the top level of the file: AMX Mod X asks every plugin for its
145
+ natives before it starts any of them.
146
+
147
+ Pawn: \`register_native\`
148
+ `,
149
+ ru: `
150
+ Экспортирует натив, который могут вызывать другие плагины, в том числе на
151
+ Pawn.
152
+
153
+ nativeFn("myplugin_get_mode", getGameMode)
154
+
155
+ function getGameMode(a: number, b: number, c: number, d: number) {
156
+ ret(mode);
157
+ }
158
+
159
+ Обработчик получает первые четыре аргумента числами; \`arg(i)\` и
160
+ \`argText(i)\` читают любой из них, \`setArg\` и \`setArgText\` пишут обратно.
161
+ Проще так: \`export function\` входного файла — это натив с настоящими
162
+ типами (см. страницу «Нативы»).
163
+
164
+ Вызывайте на верхнем уровне файла: AMX Mod X спрашивает у каждого плагина
165
+ нативы до того, как запустит хоть один.
166
+
167
+ Pawn: \`register_native\`
168
+ `,
169
+ },
170
+ 'Float': {
171
+ en: `
172
+ A number that a plugin's own native passes to Pawn as \`Float:\`.
173
+
174
+ To TypeScript it is \`number\`. Write it only in the signature of an exported
175
+ native, where Pawn has to know which numbers are fractional; everywhere
176
+ else a number is \`number\`.
177
+
178
+ \`\`\`ts
179
+ export function cfg_get_float(file: string, key: string): Float { ... }
180
+ // native Float:cfg_get_float(const file[], const key[]);
181
+ export function set_speed(id: number, speed: Float) { ... }
182
+ // native set_speed(id, Float:speed);
183
+ \`\`\`
184
+ `,
185
+ ru: `
186
+ Число, которое собственный натив плагина передаёт в Pawn как \`Float:\`.
187
+
188
+ Для TypeScript это \`number\`. Пишется только в сигнатуре экспортированного
189
+ натива, где Pawn нужно знать, какие числа дробные; в остальном коде число —
190
+ это \`number\`.
191
+
192
+ \`\`\`ts
193
+ export function cfg_get_float(file: string, key: string): Float { ... }
194
+ // native Float:cfg_get_float(const file[], const key[]);
195
+ export function set_speed(id: number, speed: Float) { ... }
196
+ // native set_speed(id, Float:speed);
197
+ \`\`\`
198
+ `,
199
+ },
200
+ 'CellArray': {
201
+ en: `
202
+ A dynamic array of AMX Mod X, for returning a list to a Pawn plugin that
203
+ expects an \`Array:\` handle.
204
+
205
+ \`\`\`ts
206
+ export function cfg_get_value_array(section: ConfigSection, key: string) {
207
+ const words = lookup(section, key); // string[] | null
208
+ return words != null ? CellArray.fromStrings(words) : null;
209
+ }
210
+ // native Array:cfg_get_value_array(ConfigSection:section, const key[]);
211
+ \`\`\`
212
+
213
+ The Pawn plugin that gets the array owns it and destroys it; \`null\` reaches
214
+ it as \`Invalid_Array\`. Inside TypeScript a list is a \`string[]\` or a
215
+ \`number[]\`: this class is only for handing one to Pawn.
216
+
217
+ Pawn: \`ArrayCreate\`, \`Array:\`
218
+ `,
219
+ ru: `
220
+ Динамический массив AMX Mod X — чтобы вернуть список Pawn-плагину, который
221
+ ждёт хэндл \`Array:\`.
222
+
223
+ \`\`\`ts
224
+ export function cfg_get_value_array(section: ConfigSection, key: string) {
225
+ const words = lookup(section, key); // string[] | null
226
+ return words != null ? CellArray.fromStrings(words) : null;
227
+ }
228
+ // native Array:cfg_get_value_array(ConfigSection:section, const key[]);
229
+ \`\`\`
230
+
231
+ Pawn-плагин, получивший массив, владеет им и сам его удаляет; \`null\`
232
+ приходит к нему как \`Invalid_Array\`. Внутри TypeScript список — это
233
+ \`string[]\` или \`number[]\`: этот класс нужен только для передачи в Pawn.
234
+
235
+ Pawn: \`ArrayCreate\`, \`Array:\`
236
+ `,
237
+ },
238
+ 'CellArray.handle': {
239
+ en: `The array's handle, the \`Array:\` Pawn gets.`,
240
+ ru: `Хэндл массива — \`Array:\`, который получает Pawn.`,
241
+ },
242
+ 'CellArray.fromStrings': {
243
+ en: `A new array of strings, each up to \`cellSize - 1\` bytes.`,
244
+ ru: `Новый массив строк, каждая до \`cellSize - 1\` байт.`,
245
+ },
246
+ 'CellArray.fromFloats': {
247
+ en: `A new array of fractional numbers, which Pawn reads as \`Float:\`.`,
248
+ ru: `Новый массив дробных чисел, которые Pawn читает как \`Float:\`.`,
249
+ },
250
+ 'CellArray.length': {
251
+ en: `The number of items in the array.`,
252
+ ru: `Число элементов в массиве.`,
253
+ },
254
+ 'CellArray.pushString': {
255
+ en: `Adds a string; it must fit in \`cellSize - 1\` bytes of UTF-8.`,
256
+ ru: `Добавляет строку; она должна уместиться в \`cellSize - 1\` байт UTF-8.`,
257
+ },
258
+ 'CellArray.pushCell': {
259
+ en: `Adds a whole number, or another array's handle.`,
260
+ ru: `Добавляет целочисленное значение или хэндл другого массива.`,
261
+ },
262
+ 'CellArray.pushFloat': {
263
+ en: `Adds a fractional number, which Pawn reads as \`Float:\`.`,
264
+ ru: `Добавляет дробное число, которое Pawn читает как \`Float:\`.`,
265
+ },
266
+ 'CellArray.pushCells': {
267
+ en: `Adds one item of several numbers: \`[a, b]\` into an array made with \`new CellArray(2)\`.`,
268
+ ru: `Добавляет один элемент из нескольких чисел: \`[a, b]\` в массив, созданный через \`new CellArray(2)\`.`,
269
+ },
270
+ 'arg': {
271
+ en: `
272
+ Reads an argument of the running handler by position; \`0\` is its first
273
+ parameter. Useful past the fourth, which a handler does not get as a
274
+ parameter.
275
+
276
+ function onSomething(a: number, b: number, c: number, d: number) {
277
+ const fifth = arg(4);
278
+ }
279
+ `,
280
+ ru: `
281
+ Читает аргумент выполняющегося обработчика по номеру; \`0\` — его первый
282
+ параметр. Нужна для аргументов после четвёртого, которых обработчик
283
+ параметрами не получает.
284
+
285
+ function onSomething(a: number, b: number, c: number, d: number) {
286
+ const fifth = arg(4);
287
+ }
288
+ `,
289
+ },
290
+ 'argText': {
291
+ en: `
292
+ Reads an argument of the running callback as a string.
293
+
294
+ A forward's strings need no call: its handler gets them as text already.
295
+ `,
296
+ ru: `
297
+ Читает аргумент выполняющегося колбэка как строку.
298
+
299
+ Форварду это не нужно: его обработчик получает строки уже текстом.
300
+ `,
301
+ },
302
+ 'argc': {
303
+ en: `
304
+ The number of arguments the running call actually carried.
305
+
306
+ A handler always gets four, padded with zeros, so a native with optional
307
+ arguments tells a passed zero from a missing one by this:
308
+
309
+ const flashes = argc() >= 2 ? arg(1) : -1;
310
+ `,
311
+ ru: `
312
+ Число аргументов, которые на самом деле пришли в выполняющийся вызов.
313
+
314
+ Обработчик всегда получает четыре, дополненные нулями, поэтому натив с
315
+ необязательными аргументами по этому числу отличает переданный ноль от
316
+ непереданного:
317
+
318
+ const flashes = argc() >= 2 ? arg(1) : -1;
319
+ `,
320
+ },
321
+ 'caller': {
322
+ en: `
323
+ The \`id\` of the plugin that called the running exported native, or \`-1\`.
324
+
325
+ For a native that is about its caller: a cvar registered by a plugin, a
326
+ chat prefix set for one.
327
+ `,
328
+ ru: `
329
+ \`id\` плагина, который вызвал выполняющийся экспортированный натив, или \`-1\`.
330
+
331
+ Для натива, который касается вызывающего: квар, зарегистрированный
332
+ плагином, префикс чата, заданный для него.
333
+ `,
334
+ },
335
+ 'setArg': {
336
+ en: `
337
+ Writes a number back through an argument passed by reference (\`&value\`
338
+ in Pawn).
339
+
340
+ Pawn: \`set_param_byref\`
341
+ `,
342
+ ru: `
343
+ Записывает число обратно через аргумент, переданный по ссылке (\`&value\`
344
+ в Pawn).
345
+
346
+ Pawn: \`set_param_byref\`
347
+ `,
348
+ },
349
+ 'setArgText': {
350
+ en: `
351
+ Writes text back through a string argument.
352
+
353
+ For a callback that hands over a buffer to fill rather than text to read.
354
+ \`max\` is the room the caller gave, usually the argument right after the
355
+ buffer.
356
+
357
+ function placeholder(id: number, target: number, out: number, max: number) {
358
+ setArgText(2, "ready", max);
359
+ }
360
+ `,
361
+ ru: `
362
+ Записывает текст обратно через строковый аргумент.
363
+
364
+ Для колбэка, который передаёт не текст для чтения, а буфер для заполнения.
365
+ \`max\` — место, которое дал вызывающий; обычно это аргумент сразу после
366
+ буфера.
367
+
368
+ function placeholder(id: number, target: number, out: number, max: number) {
369
+ setArgText(2, "ready", max);
370
+ }
371
+ `,
372
+ },
373
+ 'argString': {
374
+ en: `Reads a string argument that a wide handler got as a number.`,
375
+ ru: `Читает строковый аргумент, который широкий обработчик получил числом.`,
376
+ },
377
+ 'cellsToString': {
378
+ en: `Reads the text a raw native from \`~/natives\` wrote into a cell array. \`stringToCells\` is the other way.`,
379
+ ru: `Читает текст, который сырой натив из \`~/natives\` записал в массив ячеек. Обратно — \`stringToCells\`.`,
380
+ },
381
+ 'stringToCells': {
382
+ en: `Writes text into a cell array as a Pawn string, for a raw native.`,
383
+ ru: `Записывает текст в массив ячеек как строку Pawn — для сырого натива.`,
384
+ },
385
+ 'cells': {
386
+ en: `
387
+ Passes a string to a raw native from \`~/natives\` without declaring a
388
+ buffer for it:
389
+
390
+ cfg_set_base_dir(cells("myplugin"));
391
+
392
+ Up to eight strings in one call; a ninth overwrites the first. Only for
393
+ arguments going in: a native that writes text back needs \`out()\`.
394
+ `,
395
+ ru: `
396
+ Передаёт строку сырому нативу из \`~/natives\` без объявления буфера под неё:
397
+
398
+ cfg_set_base_dir(cells("myplugin"));
399
+
400
+ До восьми строк в одном вызове; девятая затирает первую. Только для
401
+ входящих аргументов: нативу, который пишет текст обратно, нужен \`out()\`.
402
+ `,
403
+ },
404
+ 'out': {
405
+ en: `
406
+ A buffer for a raw native to write text into; \`text()\` reads it back.
407
+
408
+ const name = out();
409
+ get_user_name(id, name, TEXT_MAX);
410
+ console.log(text(name));
411
+
412
+ Up to four at once. A number a native writes through a \`&reference\` needs
413
+ one too; \`cell()\` reads it back.
414
+ `,
415
+ ru: `
416
+ Буфер, в который сырой натив пишет текст; прочитать его — \`text()\`.
417
+
418
+ const name = out();
419
+ get_user_name(id, name, TEXT_MAX);
420
+ console.log(text(name));
421
+
422
+ Одновременно — до четырёх. Числу, которое натив пишет через \`&ссылку\`,
423
+ тоже нужен такой буфер; прочитать его — \`cell()\`.
424
+ `,
425
+ },
426
+ 'text': {
427
+ en: `Reads the text a native wrote into an \`out()\` buffer.`,
428
+ ru: `Читает текст, который натив записал в буфер \`out()\`.`,
429
+ },
430
+ 'CellBuffer': {
431
+ en: `
432
+ A row of numbers for a native to read from or write into: a vector, a list
433
+ of players, a line of text. Used like an ordinary array - \`buffer[0]\`,
434
+ \`buffer.float(2)\`, \`buffer.text()\` - and its \`address\` is what the native
435
+ takes.
436
+
437
+ const origin = new CellBuffer(3);
438
+ entity_set_origin(cube, origin.address);
439
+ `,
440
+ ru: `
441
+ Ряд чисел, из которого натив читает или в который пишет: вектор, список
442
+ игроков, строка текста. Пользуются им как обычным массивом — \`buffer[0]\`,
443
+ \`buffer.float(2)\`, \`buffer.text()\`, — а натив принимает его \`address\`.
444
+
445
+ const origin = new CellBuffer(3);
446
+ entity_set_origin(cube, origin.address);
447
+ `,
448
+ },
449
+ 'CellBuffer.vector': {
450
+ en: `A buffer of three fractional numbers, for a native that takes a vector: an origin, a size, a colour.`,
451
+ ru: `Буфер из трёх дробных чисел для натива, который принимает вектор: позицию, размер, цвет.`,
452
+ },
453
+ 'CellBuffer.length': {
454
+ en: `The number of cells in the buffer.`,
455
+ ru: `Число ячеек в буфере.`,
456
+ },
457
+ 'CellBuffer.address': {
458
+ en: `The buffer's address, the argument a native that takes an array needs.`,
459
+ ru: `Адрес буфера — аргумент для натива, который принимает массив.`,
460
+ },
461
+ 'CellBuffer.get': {
462
+ en: `The whole number in the cell at \`index\`: \`buffer[0]\`.`,
463
+ ru: `Целочисленное значение в ячейке с номером \`index\`: \`buffer[0]\`.`,
464
+ },
465
+ 'CellBuffer.set': {
466
+ en: `Puts a whole number in the cell at \`index\`: \`buffer[0] = 5\`.`,
467
+ ru: `Кладёт целочисленное значение в ячейку с номером \`index\`: \`buffer[0] = 5\`.`,
468
+ },
469
+ 'CellBuffer.float': {
470
+ en: `The fractional number in the cell at \`index\`, which a native wrote as \`Float:\`.`,
471
+ ru: `Дробное число в ячейке с номером \`index\`, которое натив записал как \`Float:\`.`,
472
+ },
473
+ 'CellBuffer.setFloat': {
474
+ en: `Puts a fractional number in the cell at \`index\`, for a native that reads \`Float:\`.`,
475
+ ru: `Кладёт дробное число в ячейку с номером \`index\` — для натива, который читает \`Float:\`.`,
476
+ },
477
+ 'CellBuffer.text': {
478
+ en: `The text a native wrote into the buffer.`,
479
+ ru: `Текст, который натив записал в буфер.`,
480
+ },
481
+ 'CellBuffer.write': {
482
+ en: `Writes text into the buffer from the cell \`at\`, as a Pawn string.`,
483
+ ru: `Записывает текст в буфер начиная с ячейки \`at\`, как строку Pawn.`,
484
+ },
485
+ 'CellBuffer.fill': {
486
+ en: `Sets every cell to \`value\`: \`buffer.fill(0)\` clears it.`,
487
+ ru: `Записывает \`value\` во все ячейки: \`buffer.fill(0)\` очищает буфер.`,
488
+ },
489
+ 'arrayOf': {
490
+ en: `An array of \`length\` copies of \`value\`: \`arrayOf(33, 0)\`. Every slot is the same \`value\` - for objects, give each slot its own.`,
491
+ ru: `Массив из \`length\` копий \`value\`: \`arrayOf(33, 0)\`. Во всех ячейках одно и то же \`value\` — объектам дайте каждой ячейке свой.`,
492
+ },
493
+ 'cell': {
494
+ en: `Reads the number a native wrote through an \`out()\` buffer passed as a \`&reference\`.`,
495
+ ru: `Читает число, которое натив записал в буфер \`out()\`, переданный как \`&ссылка\`.`,
496
+ },
497
+ 'putCell': {
498
+ en: `Puts a number in an \`out()\` buffer, for a reference a native reads as well as writes.`,
499
+ ru: `Кладёт число в буфер \`out()\` — для ссылки, которую натив и читает, и пишет.`,
500
+ },
501
+ 'noOrigin': {
502
+ en: `
503
+ An empty origin for a message sent to one player:
504
+
505
+ message_begin(MSG_ONE, msgid, noOrigin(), id);
506
+
507
+ Only messages sent to players near a point read the origin.
508
+ `,
509
+ ru: `
510
+ Пустая точка для сообщения одному игроку:
511
+
512
+ message_begin(MSG_ONE, msgid, noOrigin(), id);
513
+
514
+ Точку читают только сообщения игрокам рядом с ней.
515
+ `,
516
+ },
517
+ 'TEXT_MAX': {
518
+ en: `The length of text an \`out()\` buffer holds: \`255\`.`,
519
+ ru: `Длина текста, который вмещает буфер \`out()\`: \`255\`.`,
520
+ },
521
+ 'Team': {
522
+ en: `A Counter-Strike team, by the name the game gives it: one of \`"TERRORIST"\`, \`"CT"\`, \`"SPECTATOR"\`, \`"UNASSIGNED"\`.`,
523
+ ru: `Команда Counter-Strike под именем, которое даёт ей игра: одно из \`"TERRORIST"\`, \`"CT"\`, \`"SPECTATOR"\`, \`"UNASSIGNED"\`.`,
524
+ },
525
+ 'WeaponName': {
526
+ en: `A weapon a player can hold, by its class name, e.g. \`"weapon_ak47"\` or \`"weapon_knife"\`.`,
527
+ ru: `Оружие, которое может держать игрок, по имени класса, например \`"weapon_ak47"\` или \`"weapon_knife"\`.`,
528
+ },
529
+ 'ItemName': {
530
+ en: `An item \`player.give\` hands over: a weapon, armour (\`"item_kevlar"\`, \`"item_assaultsuit"\`) or the defuse kit (\`"item_thighpack"\`).`,
531
+ ru: `Предмет, который выдаёт \`player.give\`: оружие, броня (\`"item_kevlar"\`, \`"item_assaultsuit"\`) или набор сапёра (\`"item_thighpack"\`).`,
532
+ },
533
+ 'PlayerFilter': {
534
+ en: `
535
+ The filter of \`Player.all\`; every field is optional, e.g.
536
+ \`Player.all({ alive: true, team: "CT" })\`.
537
+ `,
538
+ ru: `
539
+ Фильтр \`Player.all\`; все поля необязательны, например
540
+ \`Player.all({ alive: true, team: "CT" })\`.
541
+ `,
542
+ },
543
+ 'PlayerFilter.alive': {
544
+ en: `Only living players.`,
545
+ ru: `Только живые игроки.`,
546
+ },
547
+ 'PlayerFilter.dead': {
548
+ en: `Only dead players.`,
549
+ ru: `Только мёртвые игроки.`,
550
+ },
551
+ 'PlayerFilter.team': {
552
+ en: `Only players of this team, e.g. \`"CT"\`.`,
553
+ ru: `Только игроки этой команды, например \`"CT"\`.`,
554
+ },
555
+ 'PlayerFilter.bots': {
556
+ en: `Only bots.`,
557
+ ru: `Только боты.`,
558
+ },
559
+ 'PlayerFilter.humans': {
560
+ en: `Only people, no bots.`,
561
+ ru: `Только люди, без ботов.`,
562
+ },
563
+ 'ModuleName': {
564
+ en: `An AMX Mod X module a plugin can check for, one of \`"reapi"\`, \`"cstrike"\`, \`"fun"\`, \`"hamsandwich"\`, \`"engine"\`, \`"fakemeta"\`.`,
565
+ ru: `Модуль AMX Mod X, наличие которого плагин может проверить, — одно из \`"reapi"\`, \`"cstrike"\`, \`"fun"\`, \`"hamsandwich"\`, \`"engine"\`, \`"fakemeta"\`.`,
566
+ },
567
+ 'hasModule': {
568
+ en: `
569
+ \`true\` when the server has the module: \`if (hasModule("reapi")) ...\`.
570
+ Check it before a native that only one module has.
571
+
572
+ Pawn: \`LibraryExists\`, \`module_exists\`
573
+ `,
574
+ ru: `
575
+ \`true\`, если на сервере есть модуль: \`if (hasModule("reapi")) ...\`.
576
+ Проверяйте перед нативом, который есть только в одном модуле.
577
+
578
+ Pawn: \`LibraryExists\`, \`module_exists\`
579
+ `,
580
+ },
581
+ 'KillOptions': {
582
+ en: `The options of \`player.kill()\`.`,
583
+ ru: `Параметры \`player.kill()\`.`,
584
+ },
585
+ 'KillOptions.keepFrags': {
586
+ en: `Keeps the player's frags: no penalty for the suicide.`,
587
+ ru: `Фраги игрока не меняются: штрафа за самоубийство нет.`,
588
+ },
589
+ 'Client': {
590
+ en: `
591
+ A connecting player, in \`"connect"\`, \`"authorized"\` and \`"putinserver"\`: name,
592
+ address, SteamID and team, but no health or weapons yet. Every Player is a
593
+ Client too.
594
+
595
+ \`\`\`ts
596
+ server.addEventListener("putinserver", (event) => {
597
+ print(event.player, \`Welcome, \${event.player.name}!\`);
598
+ });
599
+ \`\`\`
600
+ `,
601
+ ru: `
602
+ Подключающийся игрок — в \`"connect"\`, \`"authorized"\` и \`"putinserver"\`: имя,
603
+ адрес, SteamID и команда, но ещё без здоровья и оружия. Любой Player — тоже
604
+ Client.
605
+
606
+ \`\`\`ts
607
+ server.addEventListener("putinserver", (event) => {
608
+ print(event.player, \`Welcome, \${event.player.name}!\`);
609
+ });
610
+ \`\`\`
611
+ `,
612
+ },
613
+ 'Client.id': {
614
+ en: `The player's slot, \`1\` to \`32\`.`,
615
+ ru: `Слот игрока, от \`1\` до \`32\`.`,
616
+ },
617
+ 'Client.name': {
618
+ en: `The player's name.`,
619
+ ru: `Имя игрока.`,
620
+ },
621
+ 'Client.ip': {
622
+ en: `The player's IP address without the port, e.g. \`"192.168.0.10"\`.`,
623
+ ru: `IP-адрес игрока без порта, например \`"192.168.0.10"\`.`,
624
+ },
625
+ 'Client.authid': {
626
+ en: `The player's SteamID, e.g. \`"STEAM_0:1:12345"\`. A bot has \`"BOT"\`, HLTV has \`"HLTV"\`; until Steam confirms the player it is \`"STEAM_ID_PENDING"\` (wait for the \`"authorized"\` event), and on a LAN server \`"STEAM_ID_LAN"\`.`,
627
+ ru: `SteamID игрока, например \`"STEAM_0:1:12345"\`. У бота — \`"BOT"\`, у HLTV — \`"HLTV"\`; пока Steam не подтвердил игрока — \`"STEAM_ID_PENDING"\` (дождитесь события \`"authorized"\`), на LAN-сервере — \`"STEAM_ID_LAN"\`.`,
628
+ },
629
+ 'Client.isBot': {
630
+ en: `\`true\` for a bot.`,
631
+ ru: `\`true\`, если это бот.`,
632
+ },
633
+ 'Client.isConnected': {
634
+ en: `\`true\` while the player is on the server.`,
635
+ ru: `\`true\`, пока игрок на сервере.`,
636
+ },
637
+ 'Client.access': {
638
+ en: `The player's admin rights, from the letters in \`users.ini\`: \`client.access.includes("Cvar")\`.`,
639
+ ru: `Права админа у игрока — по буквам из \`users.ini\`: \`client.access.includes("Cvar")\`.`,
640
+ },
641
+ 'Client.team': {
642
+ en: `The player's team, one of \`"TERRORIST"\`, \`"CT"\`, \`"SPECTATOR"\` or \`"UNASSIGNED"\` (until the player joins a team). Setting it moves the player, as \`player.team\` does.`,
643
+ ru: `Команда игрока, одно из \`"TERRORIST"\`, \`"CT"\`, \`"SPECTATOR"\` или \`"UNASSIGNED"\` (пока игрок ни в одну не вступил). Запись переводит игрока, как и \`player.team\`.`,
644
+ },
645
+ 'Client.muted': {
646
+ en: `\`true\` when nobody hears the player on the voice chat. Setting it mutes or unmutes him.`,
647
+ ru: `\`true\`, если игрока никто не слышит в голосовом чате. Запись заглушает его или снимает заглушку.`,
648
+ },
649
+ 'Client.joinTeam': {
650
+ en: `Joins a side as the game joins a player who picks it in the team menu: \`client.joinTeam("CT")\`. \`false\` if the game refused.`,
651
+ ru: `Вводит игрока в сторону так, как игра вводит того, кто выбрал её в меню команд: \`client.joinTeam("CT")\`. \`false\`, если игра отказала.`,
652
+ },
653
+ 'Client.queryCvar': {
654
+ en: `Asks the player's game for one of its cvars: \`await client.queryCvar("fps_max")\`, the value as text, or \`null\` when his game has none.`,
655
+ ru: `Спрашивает у игры игрока один из её кваров: \`await client.queryCvar("fps_max")\` — значение текстом или \`null\`, если такого квара в его игре нет.`,
656
+ },
657
+ 'Client.heardByEveryone': {
658
+ en: `\`true\` when every player hears him on the voice chat, whatever the side.`,
659
+ ru: `\`true\`, если в голосовом чате его слышат все игроки, с какой бы стороны они ни были.`,
660
+ },
661
+ 'Client.hearsEveryone': {
662
+ en: `\`true\` when he hears every player on the voice chat, whatever the side.`,
663
+ ru: `\`true\`, если в голосовом чате он слышит всех игроков, с какой бы стороны они ни были.`,
664
+ },
665
+ 'Client.language': {
666
+ en: `The language the player reads the server's text in, e.g. \`"en"\`, \`"ru"\`: the one \`lang.translate\` picks for him.`,
667
+ ru: `Язык, на котором игрок читает текст сервера, например \`"en"\`, \`"ru"\`: тот, что для него выбирает \`lang.translate\`.`,
668
+ },
669
+ 'Client.signal': {
670
+ en: `A signal that aborts when the player leaves the server: \`fetch(url, { signal: client.signal })\`.`,
671
+ ru: `Сигнал, который срабатывает, когда игрок уходит с сервера: \`fetch(url, { signal: client.signal })\`.`,
672
+ },
673
+ 'Client.command': {
674
+ en: `Runs a command in the player's console, as if he had typed it: \`client.command("stop")\`.`,
675
+ ru: `Выполняет команду в консоли игрока, будто он сам её набрал: \`client.command("stop")\`.`,
676
+ },
677
+ 'Player': {
678
+ en: `
679
+ A player in the game: everything a Client has, plus health, armor, frags,
680
+ weapons and the screen.
681
+
682
+ An event about a player gives one as \`event.player\`; \`Player.all()\`
683
+ lists everyone on the server.
684
+ `,
685
+ ru: `
686
+ Игрок в игре: всё, что есть у Client, а также здоровье, броня, фраги,
687
+ оружие и экран.
688
+
689
+ Событие об игроке передаёт его как \`event.player\`; \`Player.all()\`
690
+ возвращает всех на сервере.
691
+ `,
692
+ },
693
+ 'Player.all': {
694
+ en: `
695
+ The players on the server: \`Player.all({ alive: true })\`.
696
+
697
+ Every field narrows: \`{ bots: true }\` is bots only, \`{ humans: true }\`
698
+ people only. Without a filter, everyone connected, never an HLTV proxy.
699
+
700
+ Pawn: \`get_players\`
701
+ `,
702
+ ru: `
703
+ Игроки на сервере: \`Player.all({ alive: true })\`.
704
+
705
+ Каждое поле сужает выборку: \`{ bots: true }\` — только боты,
706
+ \`{ humans: true }\` — только люди. Без фильтра — все подключённые, кроме
707
+ HLTV-прокси.
708
+
709
+ Pawn: \`get_players\`
710
+ `,
711
+ },
712
+ 'Player.name': {
713
+ en: `
714
+ The player's name.
715
+
716
+ Pawn: \`get_user_name\`
717
+ `,
718
+ ru: `
719
+ Имя игрока.
720
+
721
+ Pawn: \`get_user_name\`
722
+ `,
723
+ },
724
+ 'Player.health': {
725
+ en: `
726
+ The player's health. \`100\` at spawn. Setting it to \`0\` or less kills the player.
727
+
728
+ Pawn: \`get_user_health\`, \`set_user_health\`
729
+ `,
730
+ ru: `
731
+ Здоровье игрока. При появлении \`100\`. Если записать \`0\` или меньше, игрок умрёт.
732
+
733
+ Pawn: \`get_user_health\`, \`set_user_health\`
734
+ `,
735
+ },
736
+ 'Player.armor': {
737
+ en: `
738
+ The player's armor points: \`100\` with a bought vest, \`0\` without one.
739
+
740
+ Pawn: \`get_user_armor\`, \`set_user_armor\`
741
+ `,
742
+ ru: `
743
+ Броня игрока в очках: \`100\` с купленным бронежилетом, \`0\` без него.
744
+
745
+ Pawn: \`get_user_armor\`, \`set_user_armor\`
746
+ `,
747
+ },
748
+ 'Player.frags': {
749
+ en: `
750
+ The player's frags on the scoreboard.
751
+
752
+ Pawn: \`get_user_frags\`, \`set_user_frags\`
753
+ `,
754
+ ru: `
755
+ Фраги игрока на табло.
756
+
757
+ Pawn: \`get_user_frags\`, \`set_user_frags\`
758
+ `,
759
+ },
760
+ 'Player.deaths': {
761
+ en: `
762
+ The player's deaths on the scoreboard. Setting it updates the scoreboard
763
+ at once.
764
+
765
+ Pawn: \`cs_get_user_deaths\`, \`cs_set_user_deaths\`
766
+ `,
767
+ ru: `
768
+ Смерти игрока на табло. Запись сразу обновляет табло.
769
+
770
+ Pawn: \`cs_get_user_deaths\`, \`cs_set_user_deaths\`
771
+ `,
772
+ },
773
+ 'Player.team': {
774
+ en: `
775
+ The player's team, one of \`"TERRORIST"\`, \`"CT"\`, \`"SPECTATOR"\` or \`"UNASSIGNED"\`. Correct
776
+ right after a team change too. Setting it moves the player.
777
+
778
+ Pawn: \`cs_get_user_team\`, \`rg_set_user_team\`
779
+ `,
780
+ ru: `
781
+ Команда игрока, одно из \`"TERRORIST"\`, \`"CT"\`, \`"SPECTATOR"\` или \`"UNASSIGNED"\`. Верна и
782
+ сразу после смены команды. Запись переводит игрока.
783
+
784
+ Pawn: \`cs_get_user_team\`, \`rg_set_user_team\`
785
+ `,
786
+ },
787
+ 'Player.ip': {
788
+ en: `
789
+ The player's IP address without the port, e.g. \`"192.168.0.10"\`.
790
+
791
+ Pawn: \`get_user_ip\`
792
+ `,
793
+ ru: `
794
+ IP-адрес игрока без порта, например \`"192.168.0.10"\`.
795
+
796
+ Pawn: \`get_user_ip\`
797
+ `,
798
+ },
799
+ 'Player.authid': {
800
+ en: `
801
+ The player's SteamID, e.g. \`"STEAM_0:1:12345"\`. A bot has \`"BOT"\`, HLTV has \`"HLTV"\`; until Steam confirms the player it is \`"STEAM_ID_PENDING"\` (wait for the \`"authorized"\` event), and on a LAN server \`"STEAM_ID_LAN"\`.
802
+
803
+ Pawn: \`get_user_authid\`
804
+ `,
805
+ ru: `
806
+ SteamID игрока, например \`"STEAM_0:1:12345"\`. У бота — \`"BOT"\`, у HLTV — \`"HLTV"\`; пока Steam не подтвердил игрока — \`"STEAM_ID_PENDING"\` (дождитесь события \`"authorized"\`), на LAN-сервере — \`"STEAM_ID_LAN"\`.
807
+
808
+ Pawn: \`get_user_authid\`
809
+ `,
810
+ },
811
+ 'Player.isAlive': {
812
+ en: `
813
+ \`true\` while the player is alive.
814
+
815
+ Pawn: \`is_user_alive\`
816
+ `,
817
+ ru: `
818
+ \`true\`, пока игрок жив.
819
+
820
+ Pawn: \`is_user_alive\`
821
+ `,
822
+ },
823
+ 'Player.isConnected': {
824
+ en: `
825
+ \`true\` while the player is on the server.
826
+
827
+ Pawn: \`is_user_connected\`
828
+ `,
829
+ ru: `
830
+ \`true\`, пока игрок на сервере.
831
+
832
+ Pawn: \`is_user_connected\`
833
+ `,
834
+ },
835
+ 'Player.isBot': {
836
+ en: `
837
+ \`true\` for a bot.
838
+
839
+ Pawn: \`is_user_bot\`
840
+ `,
841
+ ru: `
842
+ \`true\`, если это бот.
843
+
844
+ Pawn: \`is_user_bot\`
845
+ `,
846
+ },
847
+ 'Player.signal': {
848
+ en: `
849
+ A signal that aborts when the player leaves the server, with an Error named
850
+ \`"AbortError"\`; the next player in the slot gets a new one.
851
+
852
+ \`\`\`ts
853
+ const response = await fetch(url, { signal: player.signal });
854
+ \`\`\`
855
+
856
+ An async command handler or player event already runs under it: its
857
+ \`await\`s stop quietly when the player leaves.
858
+ `,
859
+ ru: `
860
+ Сигнал, который срабатывает, когда игрок уходит с сервера, с ошибкой
861
+ (Error) по имени \`"AbortError"\`; следующий игрок в этом слоте получает новый.
862
+
863
+ \`\`\`ts
864
+ const response = await fetch(url, { signal: player.signal });
865
+ \`\`\`
866
+
867
+ Асинхронный обработчик команды или события игрока уже работает под ним:
868
+ его \`await\` тихо прекращаются, когда игрок уходит.
869
+ `,
870
+ },
871
+ 'Player.muted': {
872
+ en: `
873
+ \`true\` when nobody hears the player on the voice chat, with alltalk or
874
+ without. Setting it mutes or unmutes him; his other voice settings stay.
875
+
876
+ Pawn: \`set_speak\`, \`SPEAK_MUTED\`
877
+ `,
878
+ ru: `
879
+ \`true\`, если игрока никто не слышит в голосовом чате — с alltalk и без.
880
+ Запись заглушает его или снимает заглушку; остальные настройки голоса
881
+ остаются.
882
+
883
+ Pawn: \`set_speak\`, \`SPEAK_MUTED\`
884
+ `,
885
+ },
886
+ 'Player.joinTeam': {
887
+ en: `
888
+ Joins a side the way the game joins a player who picks it in the team
889
+ menu, appearance picked for him: \`player.joinTeam("CT")\`. A player who
890
+ has just arrived is in the game after it and can spawn, which
891
+ \`player.team = ...\` does not do for him. \`false\` if the game refused.
892
+
893
+ Pawn: \`rg_join_team\`
894
+ `,
895
+ ru: `
896
+ Вводит игрока в сторону так, как игра вводит того, кто выбрал её в меню
897
+ команд, а внешность выбирается за него: \`player.joinTeam("CT")\`. Только
898
+ что пришедший игрок после этого в игре и может появиться, чего
899
+ \`player.team = ...\` для него не делает. \`false\`, если игра отказала.
900
+
901
+ Pawn: \`rg_join_team\`
902
+ `,
903
+ },
904
+ 'Player.queryCvar': {
905
+ en: `
906
+ Asks the player's game for one of its cvars: \`await
907
+ player.queryCvar("fps_max")\` is the value as text, e.g. \`"100"\`, or
908
+ \`null\` when his game has no such cvar or will not tell. The answer is
909
+ what his game says, a claim a cheat can change. A bot has no game to ask
910
+ and answers \`null\` at once; when the player leaves before he answers, the
911
+ promise is rejected with an \`"AbortError"\`.
912
+
913
+ Pawn: \`query_client_cvar\`
914
+ `,
915
+ ru: `
916
+ Спрашивает у игры игрока один из её кваров: \`await
917
+ player.queryCvar("fps_max")\` — значение текстом, например \`"100"\`, или
918
+ \`null\`, если такого квара в его игре нет или она его не называет. Ответ —
919
+ то, что говорит его игра, заявление, которое чит может подменить. У бота
920
+ игры нет, и он сразу отвечает \`null\`; если игрок уходит раньше ответа,
921
+ промис отклоняется с \`"AbortError"\`.
922
+
923
+ Pawn: \`query_client_cvar\`
924
+ `,
925
+ },
926
+ 'Player.language': {
927
+ en: `
928
+ The language the player reads the server's text in, e.g. \`"en"\`, \`"ru"\`:
929
+ the one \`lang.translate\` picks for him. It is his \`setinfo lang\`, or the
930
+ server's language when he has none or \`amx_client_languages\` is \`0\`.
931
+
932
+ Pawn: \`get_user_info(id, "lang")\`, \`amx_language\`
933
+ `,
934
+ ru: `
935
+ Язык, на котором игрок читает текст сервера, например \`"en"\`, \`"ru"\`:
936
+ тот, что для него выбирает \`lang.translate\`. Это его \`setinfo lang\` или
937
+ язык сервера, если своего у него нет или \`amx_client_languages\` равен \`0\`.
938
+
939
+ Pawn: \`get_user_info(id, "lang")\`, \`amx_language\`
940
+ `,
941
+ },
942
+ 'Player.heardByEveryone': {
943
+ en: `
944
+ \`true\` when every player hears him on the voice chat, whatever the side
945
+ and without alltalk. A mute (\`muted\`) still silences him.
946
+
947
+ Pawn: \`set_speak\`, \`SPEAK_ALL\`
948
+ `,
949
+ ru: `
950
+ \`true\`, если в голосовом чате его слышат все игроки, с какой бы стороны
951
+ они ни были, и без alltalk. Заглушка (\`muted\`) всё равно его глушит.
952
+
953
+ Pawn: \`set_speak\`, \`SPEAK_ALL\`
954
+ `,
955
+ },
956
+ 'Player.hearsEveryone': {
957
+ en: `
958
+ \`true\` when he hears every player on the voice chat, whatever the side
959
+ and without alltalk: a spectator who hears both sides.
960
+
961
+ Pawn: \`set_speak\`, \`SPEAK_LISTENALL\`
962
+ `,
963
+ ru: `
964
+ \`true\`, если в голосовом чате он слышит всех игроков, с какой бы стороны
965
+ они ни были, и без alltalk: зритель, который слышит обе стороны.
966
+
967
+ Pawn: \`set_speak\`, \`SPEAK_LISTENALL\`
968
+ `,
969
+ },
970
+ 'Player.showHud': {
971
+ en: `
972
+ Shows a line of text on the player's screen:
973
+ \`player.showHud("-35 HP", { color: [255, 40, 40], x: 0.02, y: 0.88, hold: 2 })\`.
974
+ Every option has a default.
975
+
976
+ Pawn: \`set_hudmessage\`, \`show_hudmessage\`
977
+ `,
978
+ ru: `
979
+ Показывает строку текста на экране игрока:
980
+ \`player.showHud("-35 HP", { color: [255, 40, 40], x: 0.02, y: 0.88, hold: 2 })\`.
981
+ У каждой опции есть значение по умолчанию.
982
+
983
+ Pawn: \`set_hudmessage\`, \`show_hudmessage\`
984
+ `,
985
+ },
986
+ 'Player.playSound': {
987
+ en: `
988
+ Plays a sound to the player alone, the way the radio does - heard as it
989
+ is wherever he stands: \`player.playSound("vox/one.wav")\`. The path is
990
+ under \`sound/\`, as \`server.precache\` takes it.
991
+
992
+ Pawn: \`SendAudio\`, \`rg_send_audio\`
993
+ `,
994
+ ru: `
995
+ Проигрывает звук одному игроку, как рация, — он слышит его одинаково,
996
+ где бы ни стоял: \`player.playSound("vox/one.wav")\`. Путь — внутри
997
+ \`sound/\`, как его принимает \`server.precache\`.
998
+
999
+ Pawn: \`SendAudio\`, \`rg_send_audio\`
1000
+ `,
1001
+ },
1002
+ 'Player.screen': {
1003
+ en: `The player's screen effects: \`player.screen.fade({ ... })\`, \`.shake(...)\`, \`.statusIcon(...)\` — see Screen.`,
1004
+ ru: `Эффекты на экране игрока: \`player.screen.fade({ ... })\`, \`.shake(...)\`, \`.statusIcon(...)\` — см. Screen.`,
1005
+ },
1006
+ 'Player.give': {
1007
+ en: `
1008
+ Gives the player a weapon or an item: \`player.give("weapon_flashbang")\`.
1009
+ \`false\` if the game did not give it.
1010
+
1011
+ Pawn: \`rg_give_item\`, \`give_item\`
1012
+ `,
1013
+ ru: `
1014
+ Выдаёт игроку оружие или предмет: \`player.give("weapon_flashbang")\`.
1015
+ \`false\`, если игра его не выдала.
1016
+
1017
+ Pawn: \`rg_give_item\`, \`give_item\`
1018
+ `,
1019
+ },
1020
+ 'Player.removeAllItems': {
1021
+ en: `
1022
+ Takes all the player's weapons away. The suit (armour, HUD) stays unless
1023
+ \`removeSuit\` is \`true\`.
1024
+
1025
+ Pawn: \`rg_remove_all_items\`, \`strip_user_weapons\`
1026
+ `,
1027
+ ru: `
1028
+ Отбирает у игрока всё оружие. Костюм (броня, HUD) остаётся, если
1029
+ \`removeSuit\` не \`true\`.
1030
+
1031
+ Pawn: \`rg_remove_all_items\`, \`strip_user_weapons\`
1032
+ `,
1033
+ },
1034
+ 'Player.setAmmo': {
1035
+ en: `
1036
+ Sets the player's reserve ammo for a weapon he carries: \`player.setAmmo("weapon_flashbang", 2)\`.
1037
+
1038
+ Pawn: \`rg_set_user_bpammo\`, \`cs_set_user_bpammo\`
1039
+ `,
1040
+ ru: `
1041
+ Задаёт запас патронов игрока к оружию, которое у него есть: \`player.setAmmo("weapon_flashbang", 2)\`.
1042
+
1043
+ Pawn: \`rg_set_user_bpammo\`, \`cs_set_user_bpammo\`
1044
+ `,
1045
+ },
1046
+ 'Player.getAmmo': {
1047
+ en: `
1048
+ The player's reserve ammo for a weapon he carries: \`player.getAmmo("weapon_ak47")\`;
1049
+ for a grenade, how many he has. \`0\` for a weapon he does not carry.
1050
+
1051
+ Pawn: \`rg_get_user_bpammo\`, \`cs_get_user_bpammo\`
1052
+ `,
1053
+ ru: `
1054
+ Запас патронов игрока к оружию, которое у него есть: \`player.getAmmo("weapon_ak47")\`;
1055
+ для гранаты — сколько их у него. \`0\` для оружия, которого у него нет.
1056
+
1057
+ Pawn: \`rg_get_user_bpammo\`, \`cs_get_user_bpammo\`
1058
+ `,
1059
+ },
1060
+ 'Player.respawn': {
1061
+ en: `
1062
+ Respawns the player in the current round, at a spawn point the game picks.
1063
+
1064
+ Pawn: \`rg_round_respawn\`
1065
+ `,
1066
+ ru: `
1067
+ Возрождает игрока в текущем раунде, на точке, которую выберет игра.
1068
+
1069
+ Pawn: \`rg_round_respawn\`
1070
+ `,
1071
+ },
1072
+ 'Player.kill': {
1073
+ en: `
1074
+ Kills the player, as the \`kill\` console command does. With
1075
+ \`{ keepFrags: true }\` the death costs no frags.
1076
+
1077
+ Pawn: \`user_kill\`, \`user_silentkill\`
1078
+ `,
1079
+ ru: `
1080
+ Убивает игрока, как консольная команда \`kill\`. С
1081
+ \`{ keepFrags: true }\` смерть не отнимает фрагов.
1082
+
1083
+ Pawn: \`user_kill\`, \`user_silentkill\`
1084
+ `,
1085
+ },
1086
+ 'Player.access': {
1087
+ en: `
1088
+ The player's admin rights, from the letters in \`users.ini\`:
1089
+ \`player.access.includes("Cvar")\`.
1090
+
1091
+ Pawn: \`get_user_flags\`
1092
+ `,
1093
+ ru: `
1094
+ Права админа у игрока — по буквам из \`users.ini\`:
1095
+ \`player.access.includes("Cvar")\`.
1096
+
1097
+ Pawn: \`get_user_flags\`
1098
+ `,
1099
+ },
1100
+ 'Player.switchWeapon': {
1101
+ en: `
1102
+ Puts a weapon the player carries into his hands. \`false\` if he does not
1103
+ have it.
1104
+
1105
+ Pawn: \`rg_switch_weapon\`
1106
+ `,
1107
+ ru: `
1108
+ Даёт игроку в руки оружие, которое у него есть. \`false\`, если такого
1109
+ нет.
1110
+
1111
+ Pawn: \`rg_switch_weapon\`
1112
+ `,
1113
+ },
1114
+ 'Player.resetMaxSpeed': {
1115
+ en: `
1116
+ Recomputes the player's speed from the weapon in hand, after a slowdown for
1117
+ instance.
1118
+
1119
+ Pawn: \`rg_reset_maxspeed\`
1120
+ `,
1121
+ ru: `
1122
+ Пересчитывает скорость игрока по оружию в руках — например, после
1123
+ замедления.
1124
+
1125
+ Pawn: \`rg_reset_maxspeed\`
1126
+ `,
1127
+ },
1128
+ 'Player.command': {
1129
+ en: `
1130
+ Runs a command in the player's own console, as if he had typed it:
1131
+ \`player.command("messagemode say_team")\`, \`player.command("stop")\`.
1132
+ The player's game runs it, not the server.
1133
+
1134
+ Pawn: \`client_cmd\`
1135
+ `,
1136
+ ru: `
1137
+ Выполняет команду в консоли самого игрока, будто он набрал её сам:
1138
+ \`player.command("messagemode say_team")\`, \`player.command("stop")\`.
1139
+ Выполняет её игра игрока, а не сервер.
1140
+
1141
+ Pawn: \`client_cmd\`
1142
+ `,
1143
+ },
1144
+ 'readText': {
1145
+ en: `
1146
+ Calls a native that fills a text buffer and returns the text. The native
1147
+ itself is passed in:
1148
+
1149
+ readText(get_mapname) // "c21_kitty"
1150
+ readText(get_user_name, 32, id) // not this one: see Player.name
1151
+ `,
1152
+ ru: `
1153
+ Вызывает натив, заполняющий текстовый буфер, и возвращает текст. Сам
1154
+ натив передаётся аргументом:
1155
+
1156
+ readText(get_mapname) // "c21_kitty"
1157
+ readText(get_user_name, 32, id) // так не надо: для этого есть Player.name
1158
+ `,
1159
+ },
1160
+ 'playerIds': {
1161
+ en: `
1162
+ The ids of the players on the server, as an array. \`flags\`: \`"a"\` living,
1163
+ \`"b"\` dead, \`"c"\` no bots, \`"h"\` no HLTV, \`"e"\` only \`team\`. \`Player.all\` does the
1164
+ same with readable options.
1165
+
1166
+ Pawn: \`get_players\`
1167
+ `,
1168
+ ru: `
1169
+ \`id\` игроков на сервере в виде массива. \`flags\`: \`"a"\` живые, \`"b"\` мёртвые,
1170
+ \`"c"\` без ботов, \`"h"\` без HLTV, \`"e"\` только \`team\`. \`Player.all\` делает то
1171
+ же с понятными полями.
1172
+
1173
+ Pawn: \`get_players\`
1174
+ `,
1175
+ },
1176
+ 'CommandHandler': {
1177
+ en: `A command's handler: gets the player who typed it and the words after the command's name.`,
1178
+ ru: `Обработчик команды: получает игрока, который её набрал, и слова после имени команды.`,
1179
+ },
1180
+ 'CommandOptions': {
1181
+ en: `The options of a command: who may use it and its description in a listing.`,
1182
+ ru: `Параметры команды: кому она доступна и её описание в списке.`,
1183
+ },
1184
+ 'CommandOptions.access': {
1185
+ en: `The admin right a player needs to use the command; left out, everyone may.`,
1186
+ ru: `Право админа, которое нужно игроку для команды; если не указано, команда доступна всем.`,
1187
+ },
1188
+ 'CommandOptions.description': {
1189
+ en: `The command's description, shown by \`amx_help\` and the like.`,
1190
+ ru: `Описание команды, которое показывают \`amx_help\` и подобные.`,
1191
+ },
1192
+ 'accessOf': {
1193
+ en: `
1194
+ Converts \`users.ini\` letters to rights: \`accessOf("abc")\` is
1195
+ [\`"Immunity"\`, \`"Reservation"\`, \`"Kick"\`]. An unknown letter is skipped.
1196
+
1197
+ Pawn: \`read_flags\`
1198
+ `,
1199
+ ru: `
1200
+ Переводит буквы из \`users.ini\` в права: \`accessOf("abc")\` —
1201
+ [\`"Immunity"\`, \`"Reservation"\`, \`"Kick"\`]. Неизвестные буквы пропускаются.
1202
+
1203
+ Pawn: \`read_flags\`
1204
+ `,
1205
+ },
1206
+ 'ServerCommandHandler': {
1207
+ en: `A server command's handler: gets the words after the command's name.`,
1208
+ ru: `Обработчик серверной команды: получает слова после имени команды.`,
1209
+ },
1210
+ 'HudOptions': {
1211
+ en: `
1212
+ The look of a HUD message. Every field has a default, so
1213
+ \`{ color: [255, 40, 40] }\` is enough.
1214
+
1215
+ Pawn: \`set_hudmessage\`
1216
+ `,
1217
+ ru: `
1218
+ Вид HUD-сообщения. У каждого поля есть значение по умолчанию, так что
1219
+ \`{ color: [255, 40, 40] }\` достаточно.
1220
+
1221
+ Pawn: \`set_hudmessage\`
1222
+ `,
1223
+ },
1224
+ 'HudOptions.color': {
1225
+ en: `The text's colour: red, green, blue, \`0\` to \`255\` each.`,
1226
+ ru: `Цвет текста: красный, зелёный, синий, от \`0\` до \`255\`.`,
1227
+ },
1228
+ 'HudOptions.x': {
1229
+ en: `The horizontal position: \`0\` is the left edge, \`1\` the right; \`-1\` centres the text.`,
1230
+ ru: `Положение по горизонтали: \`0\` — левый край, \`1\` — правый; \`-1\` — по центру.`,
1231
+ },
1232
+ 'HudOptions.y': {
1233
+ en: `The vertical position: \`0\` is the top, \`1\` the bottom; \`-1\` centres the text.`,
1234
+ ru: `Положение по вертикали: \`0\` — верх, \`1\` — низ; \`-1\` — по центру.`,
1235
+ },
1236
+ 'HudOptions.hold': {
1237
+ en: `The time the message stays on screen, in seconds.`,
1238
+ ru: `Время, которое сообщение держится на экране, в секундах.`,
1239
+ },
1240
+ 'HudOptions.effect': {
1241
+ en: `The appearance effect, one of: \`"fade"\` in and out, \`"flicker"\`, or \`"typewriter"\` — letter by letter.`,
1242
+ ru: `Эффект появления, одно из: \`"fade"\` — плавно, \`"flicker"\` — мерцая, \`"typewriter"\` — по буквам.`,
1243
+ },
1244
+ 'HudOptions.fadeIn': {
1245
+ en: `The fade-in time, in seconds.`,
1246
+ ru: `Время появления в секундах.`,
1247
+ },
1248
+ 'HudOptions.fadeOut': {
1249
+ en: `The fade-out time, in seconds.`,
1250
+ ru: `Время исчезания в секундах.`,
1251
+ },
1252
+ 'HudOptions.channel': {
1253
+ en: `The HUD channel, \`1\` to \`4\`; \`-1\` picks a free one.`,
1254
+ ru: `Канал HUD, от \`1\` до \`4\`; \`-1\` — выбрать свободный.`,
1255
+ },
1256
+ 'HudOptions.effectTime': {
1257
+ en: `The duration of the \`"flicker"\` and \`"typewriter"\` effects, in seconds.`,
1258
+ ru: `Длительность эффектов \`"flicker"\` и \`"typewriter"\` в секундах.`,
1259
+ },
1260
+ 'HudOptions.large': {
1261
+ en: `
1262
+ Large letters, for a result or a headline. They have no channels, so
1263
+ \`channel\` does not apply.
1264
+
1265
+ Pawn: \`set_dhudmessage\`
1266
+ `,
1267
+ ru: `
1268
+ Крупные буквы — для итога или заголовка. Каналов у них нет, так что
1269
+ \`channel\` не действует.
1270
+
1271
+ Pawn: \`set_dhudmessage\`
1272
+ `,
1273
+ },
1274
+ 'HudEffect': {
1275
+ en: `A HUD message's appearance effect, one of: \`"fade"\` in and out, \`"flicker"\`, or \`"typewriter"\` — letter by letter.`,
1276
+ ru: `Эффект появления HUD-сообщения, одно из: \`"fade"\` — плавно, \`"flicker"\` — мерцая, \`"typewriter"\` — по буквам.`,
1277
+ },
1278
+ 'HudLine': {
1279
+ en: `
1280
+ A HUD line for one message: showing a new one replaces the old instead of
1281
+ taking another channel — for a countdown redrawn every second, a warning
1282
+ that changes. \`clear\` removes it early.
1283
+
1284
+ \`\`\`ts
1285
+ const countdown = new HudLine();
1286
+ countdown.show(player, \`\${left}\`, { color: [255, 50, 50], hold: 1.1 });
1287
+ countdown.clear(player);
1288
+ countdown.clearAll();
1289
+ \`\`\`
1290
+
1291
+ Pawn: \`CreateHudSyncObj\`, \`ShowSyncHudMsg\`
1292
+ `,
1293
+ ru: `
1294
+ Строка HUD для одного сообщения: новое заменяет прежнее, а не занимает
1295
+ ещё один канал, — для обратного отсчёта, который перерисовывается каждую
1296
+ секунду, для меняющегося предупреждения. \`clear\` убирает его раньше
1297
+ времени.
1298
+
1299
+ \`\`\`ts
1300
+ const countdown = new HudLine();
1301
+ countdown.show(player, \`\${left}\`, { color: [255, 50, 50], hold: 1.1 });
1302
+ countdown.clear(player);
1303
+ countdown.clearAll();
1304
+ \`\`\`
1305
+
1306
+ Pawn: \`CreateHudSyncObj\`, \`ShowSyncHudMsg\`
1307
+ `,
1308
+ },
1309
+ 'HudLine.show': {
1310
+ en: `Shows \`text\` to the player on this line, replacing what it showed him before.`,
1311
+ ru: `Показывает игроку \`text\` на этой строке вместо того, что она показывала ему раньше.`,
1312
+ },
1313
+ 'HudLine.clear': {
1314
+ en: `Removes the line's message from the player's screen before its time is up.`,
1315
+ ru: `Убирает сообщение строки с экрана игрока раньше времени.`,
1316
+ },
1317
+ 'HudLine.clearAll': {
1318
+ en: `Removes the line's message from every screen.`,
1319
+ ru: `Убирает сообщение строки со всех экранов.`,
1320
+ },
1321
+ 'SoundChannel': {
1322
+ en: `
1323
+ The channel a sound plays on, one of \`"auto"\` (the default), \`"weapon"\`,
1324
+ \`"voice"\`, \`"item"\`, \`"body"\`, \`"stream"\`, \`"static"\`. A new sound on an
1325
+ entity's channel cuts the one playing there; \`"auto"\` never cuts.
1326
+ `,
1327
+ ru: `
1328
+ Канал, на котором играет звук, одно из \`"auto"\` (по умолчанию), \`"weapon"\`,
1329
+ \`"voice"\`, \`"item"\`, \`"body"\`, \`"stream"\`, \`"static"\`. Новый звук на канале
1330
+ сущности обрывает тот, что играет на нём; \`"auto"\` не обрывает никогда.
1331
+ `,
1332
+ },
1333
+ 'SoundOptions': {
1334
+ en: `The options of \`entity.emitSound\`; every one has a default.`,
1335
+ ru: `Настройки \`entity.emitSound\`; у каждой есть значение по умолчанию.`,
1336
+ },
1337
+ 'SoundOptions.channel': {
1338
+ en: `The entity's channel the sound plays on; \`"auto"\` by default.`,
1339
+ ru: `Канал сущности, на котором играет звук; по умолчанию \`"auto"\`.`,
1340
+ },
1341
+ 'SoundOptions.volume': {
1342
+ en: `The volume, \`0\` to \`1\`; \`1\` by default.`,
1343
+ ru: `Громкость, от \`0\` до \`1\`; по умолчанию \`1\`.`,
1344
+ },
1345
+ 'SoundOptions.attenuation': {
1346
+ en: `The sound's fall-off with distance: \`0\` is heard across the map, \`0.8\` (the default) as a footstep, \`2\` only close by.`,
1347
+ ru: `Затухание звука с расстоянием: \`0\` слышен по всей карте, \`0.8\` (по умолчанию) — как шаги, \`2\` — только вблизи.`,
1348
+ },
1349
+ 'SoundOptions.pitch': {
1350
+ en: `The pitch in percent: \`100\` (the default) as recorded, \`50\` an octave lower, up to \`255\`.`,
1351
+ ru: `Высота в процентах: \`100\` (по умолчанию) — как записан, \`50\` — октавой ниже, до \`255\`.`,
1352
+ },
1353
+ 'MessageArgs': {
1354
+ en: `
1355
+ The arguments of a message, by their place, \`0\` for the first: a number
1356
+ or a text, as the message wrote it.
1357
+
1358
+ \`\`\`ts
1359
+ server.addEventListener("message:TeamScore", (event) => {
1360
+ console.log(\`\${event.args.text(0)} \${event.args.number(1)}\`);
1361
+ });
1362
+ \`\`\`
1363
+
1364
+ Pawn: \`get_msg_args\`, \`get_msg_arg_*\`, \`set_msg_arg_*\`
1365
+ `,
1366
+ ru: `
1367
+ Аргументы сообщения по месту, \`0\` — первый: число или текст, как их
1368
+ записало сообщение.
1369
+
1370
+ \`\`\`ts
1371
+ server.addEventListener("message:TeamScore", (event) => {
1372
+ console.log(\`\${event.args.text(0)} \${event.args.number(1)}\`);
1373
+ });
1374
+ \`\`\`
1375
+
1376
+ Pawn: \`get_msg_args\`, \`get_msg_arg_*\`, \`set_msg_arg_*\`
1377
+ `,
1378
+ },
1379
+ 'MessageArgs.length': {
1380
+ en: `The number of arguments.`,
1381
+ ru: `Число аргументов.`,
1382
+ },
1383
+ 'MessageArgs.isText': {
1384
+ en: `Whether the argument at \`index\` is text; otherwise it is a number.`,
1385
+ ru: `Текст ли аргумент на месте \`index\`; иначе это число.`,
1386
+ },
1387
+ 'MessageArgs.number': {
1388
+ en: `The argument at \`index\` as a number: a byte, a short, a coordinate, an angle.`,
1389
+ ru: `Аргумент на месте \`index\` как число: байт, short, координата, угол.`,
1390
+ },
1391
+ 'MessageArgs.text': {
1392
+ en: `The argument at \`index\` as text.`,
1393
+ ru: `Аргумент на месте \`index\` как текст.`,
1394
+ },
1395
+ 'MessageArgs.setNumber': {
1396
+ en: `Writes a number argument: the message goes out with it.`,
1397
+ ru: `Записывает числовой аргумент: сообщение уходит с ним.`,
1398
+ },
1399
+ 'MessageArgs.setText': {
1400
+ en: `Writes a text argument: the message goes out with it.`,
1401
+ ru: `Записывает текстовый аргумент: сообщение уходит с ним.`,
1402
+ },
1403
+ 'ClientMessage': {
1404
+ en: `
1405
+ A message the server sends its clients - a chat line, the round clock, a
1406
+ HUD icon - heard on its way, before it leaves:
1407
+
1408
+ \`\`\`ts
1409
+ server.addEventListener("message:TextMsg", (event) => {
1410
+ if (event.text == "#Round_Draw") event.preventDefault();
1411
+ });
1412
+ \`\`\`
1413
+
1414
+ A message the editor knows has typed fields (\`event.text\`); every one has
1415
+ its arguments in \`event.args\`. Writing a field changes what the client
1416
+ gets.
1417
+
1418
+ Pawn: \`register_message\`
1419
+ `,
1420
+ ru: `
1421
+ Сообщение, которое сервер шлёт клиентам, — строка чата, часы раунда, значок
1422
+ HUD, — услышанное по пути, до того как оно ушло:
1423
+
1424
+ \`\`\`ts
1425
+ server.addEventListener("message:TextMsg", (event) => {
1426
+ if (event.text == "#Round_Draw") event.preventDefault();
1427
+ });
1428
+ \`\`\`
1429
+
1430
+ У сообщения, которое знает редактор, есть типизированные поля
1431
+ (\`event.text\`); аргументы любого — в \`event.args\`. Запись поля меняет то,
1432
+ что получит клиент.
1433
+
1434
+ Pawn: \`register_message\`
1435
+ `,
1436
+ },
1437
+ 'ClientMessage.name': {
1438
+ en: `The message's name, e.g. \`"TextMsg"\`.`,
1439
+ ru: `Имя сообщения, например \`"TextMsg"\`.`,
1440
+ },
1441
+ 'ClientMessage.player': {
1442
+ en: `The player the message goes to; \`null\` for a message to everyone.`,
1443
+ ru: `Игрок, которому идёт сообщение; \`null\` — сообщение всем.`,
1444
+ },
1445
+ 'ClientMessage.args': {
1446
+ en: `The message's arguments, by their place: \`event.args.text(1)\`.`,
1447
+ ru: `Аргументы сообщения по месту: \`event.args.text(1)\`.`,
1448
+ },
1449
+ 'ClientMessage.preventDefault': {
1450
+ en: `
1451
+ Stops the message: the client does not get it.
1452
+
1453
+ Pawn: \`return PLUGIN_HANDLED\`
1454
+ `,
1455
+ ru: `
1456
+ Останавливает сообщение: клиент его не получит.
1457
+
1458
+ Pawn: \`return PLUGIN_HANDLED\`
1459
+ `,
1460
+ },
1461
+ 'Resource': {
1462
+ en: `
1463
+ A file the game has precached - a sprite, a model, a sound - as
1464
+ \`server.precache\` returns it. An effect takes it where it draws a sprite or
1465
+ a model:
1466
+
1467
+ \`\`\`ts
1468
+ const shock = server.precache("sprites/shockwave.spr");
1469
+ effects.beamCylinder({ at: here, radius: 385, sprite: shock, life: 0.4, width: 60 });
1470
+ \`\`\`
1471
+ `,
1472
+ ru: `
1473
+ Файл, который игра прекэшировала, — спрайт, модель, звук, — как его
1474
+ возвращает \`server.precache\`. Эффект принимает его там, где рисует спрайт
1475
+ или модель:
1476
+
1477
+ \`\`\`ts
1478
+ const shock = server.precache("sprites/shockwave.spr");
1479
+ effects.beamCylinder({ at: here, radius: 385, sprite: shock, life: 0.4, width: 60 });
1480
+ \`\`\`
1481
+ `,
1482
+ },
1483
+ 'Resource.path': {
1484
+ en: `The file's path, as \`server.precache\` was given it, e.g. \`"sprites/shockwave.spr"\`.`,
1485
+ ru: `Путь к файлу, как его получил \`server.precache\`, например \`"sprites/shockwave.spr"\`.`,
1486
+ },
1487
+ 'Resource.index': {
1488
+ en: `
1489
+ The file's index in the game's precache list, as a native takes it; \`0\`
1490
+ while it is not precached.
1491
+ `,
1492
+ ru: `
1493
+ Индекс файла в списке прекэша игры, как его принимает натив; \`0\`, пока
1494
+ файл не прекэширован.
1495
+ `,
1496
+ },
1497
+ 'FadeDirection': {
1498
+ en: `A fade's direction, one of: \`"in"\` from the colour to a clear view, \`"out"\` from a clear view to the colour.`,
1499
+ ru: `Направление затемнения, одно из: \`"in"\` — от цвета к чистому экрану, \`"out"\` — от чистого экрана к цвету.`,
1500
+ },
1501
+ 'FadeOptions': {
1502
+ en: `The options of \`player.screen.fade\`. Times are in seconds.`,
1503
+ ru: `Параметры \`player.screen.fade\`. Время — в секундах.`,
1504
+ },
1505
+ 'FadeOptions.color': {
1506
+ en: `The colour: red, green, blue and alpha, \`0\` to \`255\` each; black by default.`,
1507
+ ru: `Цвет: красный, зелёный, синий и альфа, от \`0\` до \`255\`; по умолчанию чёрный.`,
1508
+ },
1509
+ 'FadeOptions.duration': {
1510
+ en: `The fade's duration, in seconds; \`1\` by default.`,
1511
+ ru: `Длительность перехода в секундах; по умолчанию \`1\`.`,
1512
+ },
1513
+ 'FadeOptions.hold': {
1514
+ en: `The time the full colour holds, in seconds; \`0\` by default.`,
1515
+ ru: `Время, которое держится полный цвет, в секундах; по умолчанию \`0\`.`,
1516
+ },
1517
+ 'FadeOptions.direction': {
1518
+ en: `The fade's direction, one of: \`"in"\` (the default) from the colour to a clear view, \`"out"\` from a clear view to the colour.`,
1519
+ ru: `Направление затемнения, одно из: \`"in"\` (по умолчанию) — от цвета к чистому экрану, \`"out"\` — от чистого экрана к цвету.`,
1520
+ },
1521
+ 'FadeOptions.stay': {
1522
+ en: `Keeps the colour on the screen until the next fade.`,
1523
+ ru: `Цвет остаётся на экране до следующего затемнения.`,
1524
+ },
1525
+ 'FadeOptions.modulate': {
1526
+ en: `Tints what is on the screen rather than painting over it.`,
1527
+ ru: `Тонирует изображение на экране, а не закрашивает его.`,
1528
+ },
1529
+ 'ShakeOptions': {
1530
+ en: `The options of \`player.screen.shake\`.`,
1531
+ ru: `Параметры \`player.screen.shake\`.`,
1532
+ },
1533
+ 'ShakeOptions.amplitude': {
1534
+ en: `The shake's strength: how far the view moves, up to 16 units; \`4\` by default.`,
1535
+ ru: `Сила тряски: насколько смещается вид, до 16 единиц; по умолчанию \`4\`.`,
1536
+ },
1537
+ 'ShakeOptions.duration': {
1538
+ en: `The shake's duration, in seconds; \`1\` by default.`,
1539
+ ru: `Длительность тряски в секундах; по умолчанию \`1\`.`,
1540
+ },
1541
+ 'ShakeOptions.frequency': {
1542
+ en: `The shake's frequency, in jolts a second; \`5\` by default.`,
1543
+ ru: `Частота тряски — толчков в секунду; по умолчанию \`5\`.`,
1544
+ },
1545
+ 'StatusIconState': {
1546
+ en: `A status icon's state, one of \`"hide"\`, \`"show"\` (lit) or \`"flash"\`.`,
1547
+ ru: `Состояние иконки статуса, одно из: \`"hide"\` — убрана, \`"show"\` — горит, \`"flash"\` — мигает.`,
1548
+ },
1549
+ 'Screen': {
1550
+ en: `
1551
+ The effects one player sees over the world: fades, shakes, status icons and
1552
+ the parts of the HUD the game draws itself.
1553
+
1554
+ \`\`\`ts
1555
+ player.screen.fade({ color: [0, 0, 0, 255], duration: 0.5, hold: 1, stay: true });
1556
+ player.screen.shake({ amplitude: 8, duration: 1, frequency: 5 });
1557
+ player.screen.statusIcon("dmg_cold", "show", [0, 160, 255]);
1558
+ \`\`\`
1559
+
1560
+ Times are in seconds.
1561
+
1562
+ Pawn: \`ScreenFade\`, \`ScreenShake\`, \`StatusIcon\`, ...
1563
+ `,
1564
+ ru: `
1565
+ Эффекты, которые один игрок видит поверх мира: затемнение, тряска, иконки
1566
+ статуса и части HUD, которые рисует сама игра.
1567
+
1568
+ \`\`\`ts
1569
+ player.screen.fade({ color: [0, 0, 0, 255], duration: 0.5, hold: 1, stay: true });
1570
+ player.screen.shake({ amplitude: 8, duration: 1, frequency: 5 });
1571
+ player.screen.statusIcon("dmg_cold", "show", [0, 160, 255]);
1572
+ \`\`\`
1573
+
1574
+ Время — в секундах.
1575
+
1576
+ Pawn: \`ScreenFade\`, \`ScreenShake\`, \`StatusIcon\`, ...
1577
+ `,
1578
+ },
1579
+ 'Screen.fade': {
1580
+ en: `
1581
+ Colours the player's screen, fading in or out.
1582
+
1583
+ Pawn: \`ScreenFade\`
1584
+ `,
1585
+ ru: `
1586
+ Окрашивает экран игрока с плавным переходом.
1587
+
1588
+ Pawn: \`ScreenFade\`
1589
+ `,
1590
+ },
1591
+ 'Screen.shake': {
1592
+ en: `
1593
+ Shakes the player's view.
1594
+
1595
+ Pawn: \`ScreenShake\`
1596
+ `,
1597
+ ru: `
1598
+ Трясёт экран игрока.
1599
+
1600
+ Pawn: \`ScreenShake\`
1601
+ `,
1602
+ },
1603
+ 'Screen.statusIcon': {
1604
+ en: `
1605
+ Shows, flashes or hides a status icon by its sprite name (\`"dmg_cold"\`,
1606
+ \`"buyzone"\`, \`"c4"\`, ...), in a colour.
1607
+
1608
+ Pawn: \`StatusIcon\`
1609
+ `,
1610
+ ru: `
1611
+ Зажигает, заставляет мигать или убирает иконку статуса по имени спрайта
1612
+ (\`"dmg_cold"\`, \`"buyzone"\`, \`"c4"\`, ...), в заданном цвете.
1613
+
1614
+ Pawn: \`StatusIcon\`
1615
+ `,
1616
+ },
1617
+ 'Screen.roundTime': {
1618
+ en: `
1619
+ Sets the round clock at the top of the player's HUD, in seconds. Sent
1620
+ unreliably, as the game does: a client with a lagging connection may skip
1621
+ it.
1622
+
1623
+ Pawn: \`RoundTime\`
1624
+ `,
1625
+ ru: `
1626
+ Выставляет таймер раунда вверху HUD игрока, в секундах. Отправляется
1627
+ ненадёжно, как это делает сама игра: клиент с плохим соединением может
1628
+ его пропустить.
1629
+
1630
+ Pawn: \`RoundTime\`
1631
+ `,
1632
+ },
1633
+ 'Screen.hideHud': {
1634
+ en: `
1635
+ Hides parts of the player's HUD right now. Setting \`player.hideHud\` does
1636
+ the same a frame later; this is for when that is too late.
1637
+
1638
+ Pawn: \`HideWeapon\`
1639
+ `,
1640
+ ru: `
1641
+ Сразу скрывает части HUD игрока. Запись \`player.hideHud\` делает то же
1642
+ кадром позже; этот метод — для случаев, когда это уже поздно.
1643
+
1644
+ Pawn: \`HideWeapon\`
1645
+ `,
1646
+ },
1647
+ 'Screen.crosshair': {
1648
+ en: `
1649
+ Shows or hides Counter-Strike's own crosshair on the player's screen.
1650
+
1651
+ Pawn: \`Crosshair\`
1652
+ `,
1653
+ ru: `
1654
+ Показывает или скрывает стандартный прицел Counter-Strike на экране игрока.
1655
+
1656
+ Pawn: \`Crosshair\`
1657
+ `,
1658
+ },
1659
+ 'Screen.flashlight': {
1660
+ en: `
1661
+ Sets the flashlight icon on the player's HUD: on or off, and the battery in
1662
+ percent.
1663
+
1664
+ Pawn: \`Flashlight\`
1665
+ `,
1666
+ ru: `
1667
+ Выставляет иконку фонарика на HUD игрока: включён или выключен и заряд
1668
+ батареи в процентах.
1669
+
1670
+ Pawn: \`Flashlight\`
1671
+ `,
1672
+ },
1673
+ 'Screen.progressBar': {
1674
+ en: `
1675
+ Shows the progress bar in the middle of the player's screen, filling up
1676
+ over \`seconds\`; \`0\` hides it.
1677
+
1678
+ Pawn: \`BarTime\`, \`rg_send_bartime\`
1679
+ `,
1680
+ ru: `
1681
+ Показывает полосу прогресса посреди экрана игрока, которая заполняется за
1682
+ \`seconds\` секунд; \`0\` её убирает.
1683
+
1684
+ Pawn: \`BarTime\`, \`rg_send_bartime\`
1685
+ `,
1686
+ },
1687
+ 'PlayerChangeEvent': {
1688
+ en: `
1689
+ A field plugins added to \`Player\` changed on a player - written by any
1690
+ plugin, TypeScript or Pawn:
1691
+
1692
+ \`\`\`ts
1693
+ server.addEventListener("playerchange", (event) => {
1694
+ print(event.player, event.value ? "You are protected" : "Your spawn protection is over");
1695
+ }, { field: "spawnProtected" });
1696
+ \`\`\`
1697
+
1698
+ With \`field\`, \`event.value\` and \`event.previous\` have the field's type; a
1699
+ named listener takes \`PlayerChangeEvent<"spawnProtected">\`. Without it
1700
+ every field is heard, and \`event.field\` says which.
1701
+ `,
1702
+ ru: `
1703
+ У игрока изменилось поле, которое плагины добавили в \`Player\`, — его
1704
+ записал любой плагин, на TypeScript или Pawn:
1705
+
1706
+ \`\`\`ts
1707
+ server.addEventListener("playerchange", (event) => {
1708
+ print(event.player, event.value ? "You are protected" : "Your spawn protection is over");
1709
+ }, { field: "spawnProtected" });
1710
+ \`\`\`
1711
+
1712
+ С \`field\` у \`event.value\` и \`event.previous\` тип поля; именованный
1713
+ обработчик принимает \`PlayerChangeEvent<"spawnProtected">\`. Без него
1714
+ слышно любое поле, а какое — говорит \`event.field\`.
1715
+ `,
1716
+ },
1717
+ 'PlayerChangeEvent.field': {
1718
+ en: `The field that changed, e.g. \`"spawnProtected"\`; a member of an object field is dotted, \`"glow.enabled"\`.`,
1719
+ ru: `Поле, которое изменилось, например \`"spawnProtected"\`; член поля-объекта — через точку, \`"glow.enabled"\`.`,
1720
+ },
1721
+ 'PlayerChangeEvent.player': {
1722
+ en: `The player whose field changed.`,
1723
+ ru: `Игрок, у которого изменилось поле.`,
1724
+ },
1725
+ 'ServerListenerOptions': {
1726
+ en: `The third argument of \`server.addEventListener\`.`,
1727
+ ru: `Третий аргумент \`server.addEventListener\`.`,
1728
+ },
1729
+ 'ServerListenerOptions.field': {
1730
+ en: `
1731
+ For \`"playerchange"\`: the field listened for, e.g. \`"spawnProtected"\`, or
1732
+ an object field's member, \`"glow.enabled"\`; an object field's name
1733
+ hears each of its members. Left out, every field.
1734
+ `,
1735
+ ru: `
1736
+ Для \`"playerchange"\`: поле, которое слушают, например \`"spawnProtected"\`,
1737
+ или член поля-объекта, \`"glow.enabled"\`; имя поля-объекта слышит
1738
+ каждый его член. Без него — любое поле.
1739
+ `,
1740
+ },
1741
+ 'CvarChangeEvent': {
1742
+ en: `The event a cvar's change listener receives: the cvar, its old and its new value.`,
1743
+ ru: `Событие, которое получает обработчик изменения квара: квар, старое и новое значение.`,
1744
+ },
1745
+ 'CvarChangeEvent.cvar': {
1746
+ en: `The cvar that changed.`,
1747
+ ru: `Квар, который изменился.`,
1748
+ },
1749
+ 'CvarChangeEvent.oldValue': {
1750
+ en: `The cvar's value before the change, as text.`,
1751
+ ru: `Значение квара до изменения, текстом.`,
1752
+ },
1753
+ 'CvarChangeEvent.value': {
1754
+ en: `The cvar's new value, as text.`,
1755
+ ru: `Новое значение квара, текстом.`,
1756
+ },
1757
+ 'CvarListener': {
1758
+ en: `A cvar's change listener: \`(event) => ...\`, with the old and the new value in \`event\`.`,
1759
+ ru: `Обработчик изменения квара: \`(event) => ...\`; старое и новое значение — в \`event\`.`,
1760
+ },
1761
+ 'Cvar': {
1762
+ en: `
1763
+ A server cvar, read and written like an input's \`value\`:
1764
+
1765
+ \`\`\`ts
1766
+ const freeze = new Cvar("mp_freezetime");
1767
+ freeze.number = 5;
1768
+ const speed = new Cvar("my_speed", "250"); // made with 250 if it does not exist
1769
+ speed.addEventListener("change", (event) => console.log(\`\${event.oldValue} -> \${event.value}\`));
1770
+ \`\`\`
1771
+
1772
+ \`value\` is the cvar's text; \`number\` and \`boolean\` read and write the same
1773
+ cvar as a number and as an on/off switch.
1774
+
1775
+ Pawn: \`get_cvar_pointer\`, \`create_cvar\`, \`get_pcvar_string\`, \`set_pcvar_num\`, \`hook_cvar_change\`
1776
+ `,
1777
+ ru: `
1778
+ Квар сервера; читается и пишется, как \`value\` у поля ввода:
1779
+
1780
+ \`\`\`ts
1781
+ const freeze = new Cvar("mp_freezetime");
1782
+ freeze.number = 5;
1783
+ const speed = new Cvar("my_speed", "250"); // создаётся со значением 250, если его нет
1784
+ speed.addEventListener("change", (event) => console.log(\`\${event.oldValue} -> \${event.value}\`));
1785
+ \`\`\`
1786
+
1787
+ \`value\` — текст квара; \`number\` и \`boolean\` читают и пишут тот же квар как
1788
+ число и как переключатель.
1789
+
1790
+ Pawn: \`get_cvar_pointer\`, \`create_cvar\`, \`get_pcvar_string\`, \`set_pcvar_num\`, \`hook_cvar_change\`
1791
+ `,
1792
+ },
1793
+ 'Cvar.pointer': {
1794
+ en: `
1795
+ The cvar's handle in the engine; \`0\` when the server has no such cvar.
1796
+
1797
+ Pawn: \`get_cvar_pointer\`
1798
+ `,
1799
+ ru: `
1800
+ Хэндл квара в движке; \`0\`, если такого квара на сервере нет.
1801
+
1802
+ Pawn: \`get_cvar_pointer\`
1803
+ `,
1804
+ },
1805
+ 'Cvar.name': {
1806
+ en: `The cvar's name, as the console knows it, e.g. \`"mp_timelimit"\`.`,
1807
+ ru: `Имя квара, как его знает консоль, например \`"mp_timelimit"\`.`,
1808
+ },
1809
+ 'Cvar.attach': {
1810
+ en: `
1811
+ @internal Finds or creates the cvar and starts hearing its changes. A Cvar
1812
+ made at the top level of a plugin waits for \`plugin_init\`: creating a cvar
1813
+ while plugins are still loading takes the server down.
1814
+ `,
1815
+ ru: `
1816
+ @internal Находит или создаёт квар и начинает слушать его изменения. Cvar,
1817
+ созданный на верхнем уровне плагина, ждёт \`plugin_init\`: создание квара, пока
1818
+ плагины ещё загружаются, роняет сервер.
1819
+ `,
1820
+ },
1821
+ 'Cvar.exists': {
1822
+ en: `\`true\` when the server has this cvar.`,
1823
+ ru: `\`true\`, если такой квар есть на сервере.`,
1824
+ },
1825
+ 'Cvar.value': {
1826
+ en: `The cvar's value as text, e.g. \`"250"\`.`,
1827
+ ru: `Значение квара текстом, например \`"250"\`.`,
1828
+ },
1829
+ 'Cvar.number': {
1830
+ en: `The cvar's value as a number. A whole number is written without a fraction: \`"5"\`, not \`"5.000000"\`.`,
1831
+ ru: `Значение квара числом. Число без дробной части так и записывается: \`"5"\`, а не \`"5.000000"\`.`,
1832
+ },
1833
+ 'Cvar.boolean': {
1834
+ en: `The cvar as an on/off switch: \`true\` for anything but \`0\`. Writing \`true\` sets \`1\`, \`false\` sets \`0\`.`,
1835
+ ru: `Квар как переключатель: \`true\` при любом значении, кроме \`0\`. Запись \`true\` ставит \`1\`, \`false\` — \`0\`.`,
1836
+ },
1837
+ 'Cvar.addEventListener': {
1838
+ en: `Calls \`listener\` whenever the cvar's value changes.`,
1839
+ ru: `Вызывает \`listener\` при каждом изменении значения квара.`,
1840
+ },
1841
+ 'Cvar.removeEventListener': {
1842
+ en: `Stops calling a listener added with \`addEventListener\`.`,
1843
+ ru: `Перестаёт вызывать обработчик, добавленный через \`addEventListener\`.`,
1844
+ },
1845
+ 'Cvar.dispatch': {
1846
+ en: `@internal Calls the change listeners; the server does it when the cvar changes. A plugin listens with \`addEventListener\`.`,
1847
+ ru: `@internal Вызывает обработчики изменения; это делает сервер, когда квар меняется. Плагин слушает через \`addEventListener\`.`,
1848
+ },
1849
+ 'Server': {
1850
+ en: `
1851
+ The server, an event target like the DOM's: its events, commands, map and
1852
+ the folders AMX Mod X keeps. Used through \`server\`:
1853
+
1854
+ \`\`\`ts
1855
+ server.addEventListener("putinserver", (event) => {
1856
+ print(event.player, "Welcome!"); // event is a PutinserverEvent
1857
+ });
1858
+ server.map; // "de_dust2"
1859
+ server.maxPlayers; // 32
1860
+ server.command("echo hi");
1861
+ \`\`\`
1862
+
1863
+ The event's name is written out as a string: the editor completes it and
1864
+ hands the listener the event's own type. A listener may use the variables
1865
+ of the function it is written in - it is a closure, as in JavaScript.
1866
+ `,
1867
+ ru: `
1868
+ Сервер — цель событий, как в DOM: его события, команды, карта и папки
1869
+ AMX Mod X. Используется через \`server\`:
1870
+
1871
+ \`\`\`ts
1872
+ server.addEventListener("putinserver", (event) => {
1873
+ print(event.player, "Welcome!"); // event — это PutinserverEvent
1874
+ });
1875
+ server.map; // "de_dust2"
1876
+ server.maxPlayers; // 32
1877
+ server.command("echo hi");
1878
+ \`\`\`
1879
+
1880
+ Имя события пишется строкой: редактор его подсказывает и передаёт
1881
+ обработчику собственный тип события. Обработчик может пользоваться
1882
+ переменными функции, в которой он написан, — это замыкание, как в JavaScript.
1883
+ `,
1884
+ },
1885
+ 'Server.addEventListener': {
1886
+ en: `
1887
+ Calls \`listener\` every time the server raises the event \`type\` - or,
1888
+ for \`"message:<Name>"\`, every time it sends that message to a client.
1889
+ \`"playerchange"\` takes the field it is for: \`{ field: "spawnProtected" }\`.
1890
+ `,
1891
+ ru: `
1892
+ Вызывает \`listener\` каждый раз, когда сервер поднимает событие \`type\`, —
1893
+ или, для \`"message:<Name>"\`, каждый раз, когда он шлёт это сообщение клиенту.
1894
+ \`"playerchange"\` принимает поле, для которого он: \`{ field: "spawnProtected" }\`.
1895
+ `,
1896
+ },
1897
+ 'Server.removeEventListener': {
1898
+ en: `Stops calling a listener added with \`addEventListener\` - the same function and the same options.`,
1899
+ ru: `Перестаёт вызывать обработчик, добавленный через \`addEventListener\`, — ту же функцию с теми же настройками.`,
1900
+ },
1901
+ 'Server.map': {
1902
+ en: `
1903
+ The current map's name, e.g. \`"de_dust2"\`.
1904
+
1905
+ Pawn: \`get_mapname\`
1906
+ `,
1907
+ ru: `
1908
+ Имя текущей карты, например \`"de_dust2"\`.
1909
+
1910
+ Pawn: \`get_mapname\`
1911
+ `,
1912
+ },
1913
+ 'Server.maxPlayers': {
1914
+ en: `
1915
+ The number of player slots on the server, e.g. \`32\`.
1916
+
1917
+ Pawn: \`get_maxplayers\`
1918
+ `,
1919
+ ru: `
1920
+ Число слотов для игроков на сервере, например \`32\`.
1921
+
1922
+ Pawn: \`get_maxplayers\`
1923
+ `,
1924
+ },
1925
+ 'Server.configsDir': {
1926
+ en: `
1927
+ The AMX Mod X configs folder, relative to the game folder, as \`fs\` takes it:
1928
+ \`addons/amxmodx/configs\` unless the server moved it.
1929
+
1930
+ \`\`\`ts
1931
+ const text = fs.readFileSync(\`\${server.configsDir}/myplugin.ini\`);
1932
+ \`\`\`
1933
+
1934
+ Pawn: \`get_configsdir\`
1935
+ `,
1936
+ ru: `
1937
+ Папка конфигов AMX Mod X относительно папки игры — в том виде, в каком её
1938
+ принимает \`fs\`: \`addons/amxmodx/configs\`, если сервер её не перенёс.
1939
+
1940
+ \`\`\`ts
1941
+ const text = fs.readFileSync(\`\${server.configsDir}/myplugin.ini\`);
1942
+ \`\`\`
1943
+
1944
+ Pawn: \`get_configsdir\`
1945
+ `,
1946
+ },
1947
+ 'Server.dataDir': {
1948
+ en: `
1949
+ The AMX Mod X folder for plugins' data files: \`addons/amxmodx/data\` unless the server moved it.
1950
+
1951
+ Pawn: \`get_datadir\`
1952
+ `,
1953
+ ru: `
1954
+ Папка AMX Mod X для файлов данных плагинов: \`addons/amxmodx/data\`, если сервер её не перенёс.
1955
+
1956
+ Pawn: \`get_datadir\`
1957
+ `,
1958
+ },
1959
+ 'Server.command': {
1960
+ en: `
1961
+ Runs a command in the server console, as if typed there:
1962
+ \`server.command("changelevel de_dust2")\`. The text goes as it is: a \`%\` stays a \`%\`.
1963
+
1964
+ Pawn: \`server_cmd\`
1965
+ `,
1966
+ ru: `
1967
+ Выполняет команду в консоли сервера, как если бы её ввели там:
1968
+ \`server.command("changelevel de_dust2")\`. Текст уходит как есть: \`%\` остаётся \`%\`.
1969
+
1970
+ Pawn: \`server_cmd\`
1971
+ `,
1972
+ },
1973
+ 'Server.addCommand': {
1974
+ en: `
1975
+ Adds a command players type, e.g. \`"/hp"\` in chat, or a name without the slash
1976
+ in the console.
1977
+
1978
+ \`\`\`ts
1979
+ server.addCommand("/hp", (player) => print(player, \`\${player.health} HP\`));
1980
+ server.addCommand("/kick", kick, { access: "Kick", description: "Kick a player" });
1981
+ \`\`\`
1982
+
1983
+ \`args\` are the words after the command. A chat command is not repeated in
1984
+ chat, and it does not run for a player without the \`access\` right.
1985
+ \`"say time"\` runs when a player writes exactly \`"time"\` in chat.
1986
+
1987
+ Pawn: \`register_clcmd\`
1988
+ `,
1989
+ ru: `
1990
+ Добавляет команду, которую набирают игроки, например \`"/hp"\` в чате или имя без
1991
+ слеша — в консоли.
1992
+
1993
+ \`\`\`ts
1994
+ server.addCommand("/hp", (player) => print(player, \`\${player.health} HP\`));
1995
+ server.addCommand("/kick", kick, { access: "Kick", description: "Kick a player" });
1996
+ \`\`\`
1997
+
1998
+ \`args\` — слова после команды. Чат-команда не повторяется в чате и не
1999
+ срабатывает у игрока без права \`access\`. \`"say time"\` срабатывает, когда
2000
+ игрок пишет в чат ровно \`"time"\`.
2001
+
2002
+ Pawn: \`register_clcmd\`
2003
+ `,
2004
+ },
2005
+ 'Server.addServerCommand': {
2006
+ en: `
2007
+ Adds a command of the server console - typed there, sent over rcon or run by
2008
+ another plugin. Players cannot use it.
2009
+
2010
+ \`\`\`ts
2011
+ server.addServerCommand("myplugin_reset", (args) => reset(args.length > 0 ? args[0] : "all"));
2012
+ \`\`\`
2013
+
2014
+ \`args\` are the words after the command. It may be added at the top level of
2015
+ the file.
2016
+
2017
+ Pawn: \`register_srvcmd\`
2018
+ `,
2019
+ ru: `
2020
+ Добавляет команду консоли сервера — набранную там, пришедшую по rcon или
2021
+ вызванную другим плагином. Игроки её не набирают.
2022
+
2023
+ \`\`\`ts
2024
+ server.addServerCommand("myplugin_reset", (args) => reset(args.length > 0 ? args[0] : "all"));
2025
+ \`\`\`
2026
+
2027
+ \`args\` — слова после команды. Её можно добавлять на верхнем уровне файла.
2028
+
2029
+ Pawn: \`register_srvcmd\`
2030
+ `,
2031
+ },
2032
+ 'Server.showHud': {
2033
+ en: `Shows a HUD message to every player, with the same options as \`player.showHud\`.`,
2034
+ ru: `Показывает HUD-сообщение всем игрокам, с теми же настройками, что у \`player.showHud\`.`,
2035
+ },
2036
+ 'Server.precache': {
2037
+ en: `
2038
+ Precaches a file, so the game can use it and players download it:
2039
+ \`const shock = server.precache("sprites/shockwave.spr")\`. At the top level
2040
+ of the file it is precached when the map loads; in the \`"precache"\` event,
2041
+ at once. A sound is written as the game plays it, under \`sound/\`:
2042
+ \`"myplugin/hit.wav"\`. Returns the file as a \`Resource\` - what an effect
2043
+ takes for a sprite or a model.
2044
+
2045
+ Pawn: \`precache_model\`, \`precache_sound\`, \`precache_generic\`
2046
+ `,
2047
+ ru: `
2048
+ Прекэширует файл, чтобы игра могла им пользоваться, а игроки его скачали:
2049
+ \`const shock = server.precache("sprites/shockwave.spr")\`. На верхнем уровне
2050
+ файла он прекэшируется, когда грузится карта; в событии \`"precache"\` —
2051
+ сразу. Звук пишется так, как его играет игра, — внутри \`sound/\`:
2052
+ \`"myplugin/hit.wav"\`. Возвращает файл как \`Resource\` — то, что эффект
2053
+ принимает вместо спрайта или модели.
2054
+
2055
+ Pawn: \`precache_model\`, \`precache_sound\`, \`precache_generic\`
2056
+ `,
2057
+ },
2058
+ 'server': {
2059
+ en: `The server the plugin runs on: its events, commands and map.`,
2060
+ ru: `Сервер, на котором работает плагин: его события, команды и карта.`,
2061
+ },
2062
+ 'Game': {
2063
+ en: `
2064
+ The game's events (reapi hookchains and Ham Sandwich functions) and round
2065
+ control, as an event target like the DOM's:
2066
+
2067
+ \`\`\`ts
2068
+ game.addEventListener("takeDamage", (event) => {
2069
+ if (event.player.isBot) event.preventDefault();
2070
+ });
2071
+ game.addEventListener("canPlayerHearPlayer", (event) => event.listener.team == event.sender.team);
2072
+ game.addEventListener("flPlayerFallDamage", (event) => event.result / 2, true);
2073
+ \`\`\`
2074
+
2075
+ The event's type follows from its name. What a listener returns is the
2076
+ answer to the game: before the game acts it replaces what the game would
2077
+ do, after it (\`post\`) it replaces the result. A listener that returns
2078
+ nothing leaves it to the game; \`event.preventDefault()\` blocks without an
2079
+ answer. A value of the wrong type is an error in the editor and in the build.
2080
+
2081
+ The game rules are its fields: \`game.freezePeriod\`, \`game.numCtWins\`,
2082
+ \`game.roundWinner\`.
2083
+
2084
+ Pawn: \`RegisterHookChain\`, \`RegisterHam\`, \`get_member_game\`
2085
+ `,
2086
+ ru: `
2087
+ События игры (hookchain'ы reapi и функции Ham Sandwich) и управление
2088
+ раундом — цель событий, как в DOM:
2089
+
2090
+ \`\`\`ts
2091
+ game.addEventListener("takeDamage", (event) => {
2092
+ if (event.player.isBot) event.preventDefault();
2093
+ });
2094
+ game.addEventListener("canPlayerHearPlayer", (event) => event.listener.team == event.sender.team);
2095
+ game.addEventListener("flPlayerFallDamage", (event) => event.result / 2, true);
2096
+ \`\`\`
2097
+
2098
+ Тип события следует из его имени. То, что возвращает обработчик, — ответ
2099
+ игре: до действия игры он заменяет то, что игра сделала бы, после (\`post\`) —
2100
+ её результат. Обработчик, который ничего не возвращает, оставляет решение
2101
+ игре; \`event.preventDefault()\` блокирует без ответа. Значение не того типа —
2102
+ ошибка и в редакторе, и при сборке.
2103
+
2104
+ Правила игры — её поля: \`game.freezePeriod\`, \`game.numCtWins\`,
2105
+ \`game.roundWinner\`.
2106
+
2107
+ Pawn: \`RegisterHookChain\`, \`RegisterHam\`, \`get_member_game\`
2108
+ `,
2109
+ },
2110
+ 'Game.addEventListener': {
2111
+ en: `
2112
+ Calls \`listener\` every time the game runs \`type\`. With \`true\` - or
2113
+ \`{ post: true }\` - it runs after the game has acted, with the game's answer
2114
+ in \`event.result\`; by default it runs before and can stop it.
2115
+ \`classname\` narrows it to one class of entity, and only that class's
2116
+ reach the plugin: \`{ classname: "weapon_knife" }\`. A \`"touch"\` listener
2117
+ takes the classes it is about instead: \`{ toucher: "player", touched: "player" }\`.
2118
+
2119
+ Pawn: \`RegisterHookChain\`, \`RegisterHam\`, \`register_touch\`
2120
+ `,
2121
+ ru: `
2122
+ Вызывает \`listener\` каждый раз, когда игра выполняет \`type\`. С \`true\` —
2123
+ или \`{ post: true }\` — после того как игра сделала своё, с её ответом в
2124
+ \`event.result\`; по умолчанию — до этого, и может её остановить.
2125
+ \`classname\` сужает его до одного класса сущностей, и до плагина доходят
2126
+ только они: \`{ classname: "weapon_knife" }\`. Обработчик \`"touch"\` вместо
2127
+ этого берёт классы, о которых речь: \`{ toucher: "player", touched: "player" }\`.
2128
+
2129
+ Pawn: \`RegisterHookChain\`, \`RegisterHam\`, \`register_touch\`
2130
+ `,
2131
+ },
2132
+ 'Game.removeEventListener': {
2133
+ en: `Stops calling a listener added with \`addEventListener\` - the same function and the same options.`,
2134
+ ru: `Перестаёт вызывать обработчик, добавленный через \`addEventListener\`, — ту же функцию с теми же настройками.`,
2135
+ },
2136
+ 'Game.time': {
2137
+ en: `
2138
+ The game's clock: seconds since the map started. Entity fields that hold a
2139
+ moment - \`nextThink\`, \`damageTime\` - are on it:
2140
+ \`grenade.damageTime = game.time + 1\`. The attack timers - a weapon's
2141
+ \`nextPrimaryAttack\`, a player's \`nextAttack\` - count from now instead:
2142
+ \`weapon.nextPrimaryAttack = 1\` is a second away.
2143
+
2144
+ Pawn: \`get_gametime\`
2145
+ `,
2146
+ ru: `
2147
+ Часы игры: секунды с начала карты. Поля сущностей, которые хранят момент, —
2148
+ \`nextThink\`, \`damageTime\` — идут по ним:
2149
+ \`grenade.damageTime = game.time + 1\`. Таймеры атаки — \`nextPrimaryAttack\`
2150
+ оружия, \`nextAttack\` игрока — считаются от текущего момента:
2151
+ \`weapon.nextPrimaryAttack = 1\` — это через секунду.
2152
+
2153
+ Pawn: \`get_gametime\`
2154
+ `,
2155
+ },
2156
+ 'Game.endRound': {
2157
+ en: `
2158
+ Ends the round now:
2159
+
2160
+ \`\`\`ts
2161
+ game.endRound({ winner: "TERRORIST" }); // terrorists win, next round in 5 s
2162
+ game.endRound({ winner: "draw", delay: 3 }); // a draw, next round in 3 s
2163
+ game.endRound({ winner: "none", message: "" }); // a quiet restart: no message
2164
+ \`\`\`
2165
+
2166
+ The winner sets the score, the message and the sound (\`"Terrorists Win!"\`);
2167
+ \`message\` and \`sound\` replace them, \`""\` turns them off.
2168
+
2169
+ Pawn: \`rg_round_end\`
2170
+ `,
2171
+ ru: `
2172
+ Завершает раунд сейчас:
2173
+
2174
+ \`\`\`ts
2175
+ game.endRound({ winner: "TERRORIST" }); // победа террористов, следующий раунд через 5 с
2176
+ game.endRound({ winner: "draw", delay: 3 }); // ничья, следующий раунд через 3 с
2177
+ game.endRound({ winner: "none", message: "" }); // тихий рестарт: без сообщения
2178
+ \`\`\`
2179
+
2180
+ Победитель определяет счёт, сообщение и звук (\`"Terrorists Win!"\`);
2181
+ \`message\` и \`sound\` заменяют их, \`""\` — выключает.
2182
+
2183
+ Pawn: \`rg_round_end\`
2184
+ `,
2185
+ },
2186
+ 'GameListenerOptions': {
2187
+ en: `
2188
+ The third argument of \`game.addEventListener\`: \`true\` stands for
2189
+ \`{ post: true }\`; a \`"touch"\` listener names the classes it is about.
2190
+ `,
2191
+ ru: `
2192
+ Третий аргумент \`game.addEventListener\`: \`true\` означает
2193
+ \`{ post: true }\`; обработчик \`"touch"\` называет классы, о которых речь.
2194
+ `,
2195
+ },
2196
+ 'GameListenerOptions.post': {
2197
+ en: `Runs the listener after the game has acted, with its answer in \`event.result\`.`,
2198
+ ru: `Вызывает обработчик после того, как игра сделала своё, с её ответом в \`event.result\`.`,
2199
+ },
2200
+ 'GameListenerOptions.classname': {
2201
+ en: `The class of entity the event is listened for on, e.g. \`"weapon_knife"\`: only its entities reach the listener.`,
2202
+ ru: `Класс сущностей, на котором слушается событие, например \`"weapon_knife"\`: до обработчика доходят только его сущности.`,
2203
+ },
2204
+ 'UseType': {
2205
+ en: `
2206
+ The way one entity uses another - a button pressed, a door opened - one of
2207
+ \`"off"\`, \`"on"\`, \`"set"\` or \`"toggle"\`.
2208
+
2209
+ Pawn: \`USE_OFF\`, \`USE_ON\`, \`USE_SET\`, \`USE_TOGGLE\`
2210
+ `,
2211
+ ru: `
2212
+ Способ, которым одна сущность использует другую, — нажимает кнопку, открывает
2213
+ дверь, — одно из \`"off"\`, \`"on"\`, \`"set"\` или \`"toggle"\`.
2214
+
2215
+ Pawn: \`USE_OFF\`, \`USE_ON\`, \`USE_SET\`, \`USE_TOGGLE\`
2216
+ `,
2217
+ },
2218
+ 'ActionOptions': {
2219
+ en: `The options of an entity's action such as \`weapon.deploy()\` or \`entity.takeHealth(...)\`.`,
2220
+ ru: `Настройки действия сущности, такого как \`weapon.deploy()\` или \`entity.takeHealth(...)\`.`,
2221
+ },
2222
+ 'ActionOptions.hooks': {
2223
+ en: `
2224
+ Whether the game's listeners run too - this plugin's and every other's,
2225
+ Pawn ones included; \`true\` by default. \`false\` runs the game's own
2226
+ function alone.
2227
+
2228
+ Pawn: \`ExecuteHamB\`, \`ExecuteHam\`
2229
+ `,
2230
+ ru: `
2231
+ Вызываются ли и обработчики игры — этого плагина и всех остальных,
2232
+ Pawn-плагинов тоже; по умолчанию \`true\`. \`false\` выполняет только
2233
+ собственную функцию игры.
2234
+
2235
+ Pawn: \`ExecuteHamB\`, \`ExecuteHam\`
2236
+ `,
2237
+ },
2238
+ 'GameListenerOptions.toucher': {
2239
+ en: `For \`"touch"\`: the class of the entity that moves into the other, e.g. \`"player"\`; left out, any.`,
2240
+ ru: `Для \`"touch"\`: класс сущности, которая входит в другую, например \`"player"\`; если не задан — любой.`,
2241
+ },
2242
+ 'GameListenerOptions.touched': {
2243
+ en: `For \`"touch"\`: the class of the entity touched, e.g. \`"func_door"\`; left out, any.`,
2244
+ ru: `Для \`"touch"\`: класс сущности, которой коснулись, например \`"func_door"\`; если не задан — любой.`,
2245
+ },
2246
+ 'TouchEvent': {
2247
+ en: `
2248
+ Two entities touched: \`toucher\` moved into \`touched\`. Only the classes a
2249
+ listener asked for reach it:
2250
+
2251
+ \`\`\`ts
2252
+ game.addEventListener("touch", onTouch, { toucher: "player", touched: "player" });
2253
+ \`\`\`
2254
+
2255
+ Pawn: \`register_touch\`
2256
+ `,
2257
+ ru: `
2258
+ Две сущности коснулись: \`toucher\` вошла в \`touched\`. До обработчика
2259
+ доходят только классы, которые он просил:
2260
+
2261
+ \`\`\`ts
2262
+ game.addEventListener("touch", onTouch, { toucher: "player", touched: "player" });
2263
+ \`\`\`
2264
+
2265
+ Pawn: \`register_touch\`
2266
+ `,
2267
+ },
2268
+ 'TouchEvent.toucher': {
2269
+ en: `The entity that moved into the other.`,
2270
+ ru: `Сущность, которая вошла в другую.`,
2271
+ },
2272
+ 'TouchEvent.touched': {
2273
+ en: `The entity it touched.`,
2274
+ ru: `Сущность, которой она коснулась.`,
2275
+ },
2276
+ 'TouchEvent.preventDefault': {
2277
+ en: `Blocks the touch: the game does not act on it.`,
2278
+ ru: `Блокирует касание: игра на него не реагирует.`,
2279
+ },
2280
+ 'RoundWinner': {
2281
+ en: `The winner of a round, one of \`"TERRORIST"\`, \`"CT"\`, \`"draw"\`, or \`"none"\` - a restart without a winner.`,
2282
+ ru: `Победитель раунда, одно из \`"TERRORIST"\`, \`"CT"\`, \`"draw"\` или \`"none"\` — рестарт без победителя.`,
2283
+ },
2284
+ 'EndRoundOptions': {
2285
+ en: `The options of \`game.endRound\`; only \`winner\` is required.`,
2286
+ ru: `Настройки \`game.endRound\`; обязателен только \`winner\`.`,
2287
+ },
2288
+ 'EndRoundOptions.winner': {
2289
+ en: `The round's winner, one of \`"TERRORIST"\`, \`"CT"\`, \`"draw"\`, or \`"none"\` - a restart.`,
2290
+ ru: `Победитель раунда, одно из \`"TERRORIST"\`, \`"CT"\`, \`"draw"\` или \`"none"\` — рестарт.`,
2291
+ },
2292
+ 'EndRoundOptions.delay': {
2293
+ en: `Seconds until the next round starts; \`5\` by default.`,
2294
+ ru: `Секунд до начала следующего раунда; по умолчанию \`5\`.`,
2295
+ },
2296
+ 'EndRoundOptions.message': {
2297
+ en: `The message in the middle of the screen, or a game text such as \`"#Terrorists_Win"\`; \`"default"\` is the usual one for this winner, \`""\` none.`,
2298
+ ru: `Сообщение посередине экрана или текст игры вроде \`"#Terrorists_Win"\`; \`"default"\` — обычное для этого победителя, \`""\` — без сообщения.`,
2299
+ },
2300
+ 'EndRoundOptions.sound': {
2301
+ en: `The sound, a radio phrase such as \`"terwin"\`; \`"default"\` is the usual one for this winner, \`""\` none.`,
2302
+ ru: `Звук — радиофраза вроде \`"terwin"\`; \`"default"\` — обычный для этого победителя, \`""\` — без звука.`,
2303
+ },
2304
+ 'EndRoundOptions.dispatch': {
2305
+ en: `
2306
+ \`true\` to tell the \`roundEnd\` listeners of every plugin, Pawn ones too, as when
2307
+ the game ends a round itself. \`false\` by default: a \`roundEnd\` listener that
2308
+ ends the round would call itself.
2309
+
2310
+ Pawn: \`rg_round_end(..., trigger)\`
2311
+ `,
2312
+ ru: `
2313
+ \`true\` — оповестить обработчики \`roundEnd\` всех плагинов, в том числе
2314
+ Pawn-плагинов, как когда игра сама завершает раунд. По умолчанию \`false\`:
2315
+ обработчик \`roundEnd\`, который завершает раунд, вызвал бы сам себя.
2316
+
2317
+ Pawn: \`rg_round_end(..., trigger)\`
2318
+ `,
2319
+ },
2320
+ 'game': {
2321
+ en: `The game the plugin runs in: its events (reapi hookchains and Ham Sandwich functions), its rules' fields and \`endRound\`.`,
2322
+ ru: `Игра, в которой работает плагин: её события (hookchain'ы reapi и функции Ham Sandwich), поля её правил и \`endRound\`.`,
2323
+ },
2324
+ 'Variant': {
2325
+ en: `
2326
+ The places a message can show: \`Variant.chat\`, \`center\`, \`console\`, \`notify\`.
2327
+ A plain string works the same - \`"center"\`; an unknown name goes to chat.
2328
+
2329
+ Pawn: \`print_chat\`, \`print_center\`, \`print_console\`, \`print_notify\`
2330
+ `,
2331
+ ru: `
2332
+ Места, где показывается сообщение: \`Variant.chat\`, \`center\`, \`console\`,
2333
+ \`notify\`. Обычная строка работает так же — \`"center"\`; незнакомое имя уходит
2334
+ в чат.
2335
+
2336
+ Pawn: \`print_chat\`, \`print_center\`, \`print_console\`, \`print_notify\`
2337
+ `,
2338
+ },
2339
+ 'Variant.chat': {
2340
+ en: `A line in the player's chat.`,
2341
+ ru: `Строка в чате игрока.`,
2342
+ },
2343
+ 'Variant.center': {
2344
+ en: `Text in the middle of the player's screen.`,
2345
+ ru: `Текст посередине экрана игрока.`,
2346
+ },
2347
+ 'Variant.console': {
2348
+ en: `A line in the player's console.`,
2349
+ ru: `Строка в консоли игрока.`,
2350
+ },
2351
+ 'Variant.notify': {
2352
+ en: `A line in the player's console, sent as a notification; with \`developer 1\` CS also shows it in the top-left corner of the screen.`,
2353
+ ru: `Строка в консоли игрока, отправленная как уведомление; при \`developer 1\` CS показывает её ещё и в левом верхнем углу экрана.`,
2354
+ },
2355
+ 'VariantName': {
2356
+ en: `The place a message shows, as a string: one of \`"chat"\`, \`"center"\`, \`"console"\` or \`"notify"\`.`,
2357
+ ru: `Место показа сообщения строкой, одно из \`"chat"\`, \`"center"\`, \`"console"\` или \`"notify"\`.`,
2358
+ },
2359
+ 'Target': {
2360
+ en: `A message's recipient together with its place: \`{ id: 0, variant: "center" }\`. \`id\` is a player's \`id\`, \`0\` for everyone.`,
2361
+ ru: `Получатель сообщения вместе с местом показа: \`{ id: 0, variant: "center" }\`. \`id\` — \`id\` игрока, \`0\` — все.`,
2362
+ },
2363
+ 'Target.id': {
2364
+ en: `The recipient's player \`id\`; \`0\` for every player.`,
2365
+ ru: `\`id\` игрока-получателя; \`0\` — все игроки.`,
2366
+ },
2367
+ 'Target.variant': {
2368
+ en: `The place the message shows, one of \`"chat"\` (the default), \`"center"\`, \`"console"\` or \`"notify"\`.`,
2369
+ ru: `Место показа сообщения, одно из \`"chat"\` (по умолчанию), \`"center"\`, \`"console"\` или \`"notify"\`.`,
2370
+ },
2371
+ 'paint': {
2372
+ en: `Turns a chat line's colour tags (\`!g\`, \`!r\`, ...) into the colour codes the client reads, and records in \`swapTeam\` which team colour the line needs. \`print\` calls it; exported for tests.`,
2373
+ ru: `Переводит цветовые метки строки чата (\`!g\`, \`!r\`, ...) в коды цвета для клиента и записывает в \`swapTeam\`, какой цвет команды нужен строке. Её вызывает \`print\`; экспортирована для тестов.`,
2374
+ },
2375
+ 'menuColors': {
2376
+ en: `Turns a menu's colour tags (\`!y\`, \`!R\`, ...) into the codes the game draws, and drops the ones only chat has (\`!g\`, \`!b\`, \`!t\`) and the game's own codes written into the text (\`\\y\`); any other \`!\` stays. \`showMenu\` calls it, and a module hands its result to Pawn.`,
2377
+ ru: `Переводит цветовые метки меню (\`!y\`, \`!R\`, ...) в коды, которыми рисует игра, и убирает метки только для чата (\`!g\`, \`!b\`, \`!t\`) и собственные коды игры, записанные в текст (\`\\y\`); любой другой \`!\` остаётся. Её вызывает \`showMenu\`, а модуль отдаёт её результат в Pawn.`,
2378
+ },
2379
+ 'colorTags': {
2380
+ en: `
2381
+ Text from Pawn - a dictionary's line, a Pawn plugin's argument - with its
2382
+ colour codes made tags: a menu's \`\\y\` \`\\r\` \`\\d\` \`\\w\` \`\\R\` are \`!y\` \`!r\`
2383
+ \`!d\` \`!w\` \`!R\`, and chat's bytes \`^1\` \`^3\` \`^4\` are \`!y\` \`!t\` \`!g\`.
2384
+ `,
2385
+ ru: `
2386
+ Текст из Pawn — строка словаря, аргумент Pawn-плагина — с цветовыми кодами,
2387
+ ставшими метками: коды меню \`\\y\` \`\\r\` \`\\d\` \`\\w\` \`\\R\` — это \`!y\` \`!r\`
2388
+ \`!d\` \`!w\` \`!R\`, а байты чата \`^1\` \`^3\` \`^4\` — \`!y\` \`!t\` \`!g\`.
2389
+ `,
2390
+ },
2391
+ 'swapTeam': {
2392
+ en: `The team colour the last \`paint()\` chose for the line, one of \`"TERRORIST"\` (red), \`"CT"\` (blue), \`"SPECTATOR"\` (grey), or \`""\` - the reader's own team colour. \`print\` reads it right after.`,
2393
+ ru: `Цвет команды, который последний вызов \`paint()\` выбрал для строки, — одно из \`"TERRORIST"\` (красный), \`"CT"\` (синий), \`"SPECTATOR"\` (серый) или \`""\` — цвет команды читающего. \`print\` читает его сразу после.`,
2394
+ },
2395
+ 'print': {
2396
+ en: `
2397
+ Sends a message to a player, or to every player (\`0\`).
2398
+
2399
+ \`\`\`ts
2400
+ print(player, "Health restored!"); // the player's chat
2401
+ print(0, "Round starts in 5 seconds"); // everyone's chat
2402
+ print(player, "Health restored!", "center"); // the middle of the player's screen
2403
+ print({ id: 0, variant: "center" }, "Go!"); // the middle of everyone's screen
2404
+ \`\`\`
2405
+
2406
+ The first argument is a player, a player's \`id\`, or \`0\` for everyone. The third
2407
+ is where the message shows, one of \`"chat"\` (the default), \`"center"\` - the middle of
2408
+ the screen, \`"console"\` - the player's console, \`"notify"\` - the console too; CS
2409
+ shows it on screen only with \`developer 1\`.
2410
+
2411
+ Colour tags work in chat only, and a letter is the same colour as in a menu:
2412
+ - \`!y\` yellow (the usual chat colour), \`!g\` green
2413
+ - \`!r\` red, \`!b\` blue, \`!d\` grey, \`!t\` the colour of the reader's team
2414
+
2415
+ A menu's own tags (\`!w\`, \`!R\`) are dropped from a chat line. Red, blue,
2416
+ grey and \`!t\` share the message's one team colour: the first one used wins.
2417
+
2418
+ Pawn: \`client_print\`, \`client_print_color\`
2419
+ `,
2420
+ ru: `
2421
+ Отправляет сообщение игроку или всем игрокам (\`0\`).
2422
+
2423
+ \`\`\`ts
2424
+ print(player, "Health restored!"); // чат игрока
2425
+ print(0, "Round starts in 5 seconds"); // чат всех игроков
2426
+ print(player, "Health restored!", "center"); // посередине экрана игрока
2427
+ print({ id: 0, variant: "center" }, "Go!"); // посередине экрана у всех
2428
+ \`\`\`
2429
+
2430
+ Первый аргумент — игрок, \`id\` игрока или \`0\` — все. Третий — где показать
2431
+ сообщение, одно из \`"chat"\` (по умолчанию), \`"center"\` — посередине экрана, \`"console"\` —
2432
+ в консоли игрока, \`"notify"\` — тоже в консоли; на экране CS показывает его
2433
+ только при \`developer 1\`.
2434
+
2435
+ Цветовые метки работают только в чате, и буква — тот же цвет, что в меню:
2436
+ - \`!y\` жёлтый (обычный цвет чата), \`!g\` зелёный
2437
+ - \`!r\` красный, \`!b\` синий, \`!d\` серый, \`!t\` цвет команды читающего
2438
+
2439
+ Метки только для меню (\`!w\`, \`!R\`) из строки чата убираются. Красный, синий,
2440
+ серый и \`!t\` делят один цвет команды на сообщение: побеждает первый.
2441
+
2442
+ Pawn: \`client_print\`, \`client_print_color\`
2443
+ `,
2444
+ },
2445
+ 'lang': {
2446
+ en: `
2447
+ The server's dictionaries: the files of \`data/lang\`, a line per key and
2448
+ language, and each player reads them in his own.
2449
+
2450
+ \`\`\`ts
2451
+ lang.load("myplugin"); // data/lang/myplugin.txt
2452
+ print(player, lang.translate(player, "MYPLUGIN_WELCOME", [player.name]));
2453
+ \`\`\`
2454
+
2455
+ Pawn: \`register_dictionary\`, \`LookupLangKey\`
2456
+ `,
2457
+ ru: `
2458
+ Словари сервера: файлы \`data/lang\`, строка на ключ и язык, и каждый игрок
2459
+ читает их на своём.
2460
+
2461
+ \`\`\`ts
2462
+ lang.load("myplugin"); // data/lang/myplugin.txt
2463
+ print(player, lang.translate(player, "MYPLUGIN_WELCOME", [player.name]));
2464
+ \`\`\`
2465
+
2466
+ Pawn: \`register_dictionary\`, \`LookupLangKey\`
2467
+ `,
2468
+ },
2469
+ 'lang.load': {
2470
+ en: `
2471
+ Loads the dictionary \`data/lang/<name>.txt\`: \`lang.load("myplugin")\`.
2472
+ \`false\` when there is no such file.
2473
+
2474
+ Pawn: \`register_dictionary\`
2475
+ `,
2476
+ ru: `
2477
+ Загружает словарь \`data/lang/<name>.txt\`: \`lang.load("myplugin")\`.
2478
+ \`false\`, если такого файла нет.
2479
+
2480
+ Pawn: \`register_dictionary\`
2481
+ `,
2482
+ },
2483
+ 'lang.translate': {
2484
+ en: `
2485
+ The key's line in the player's language, \`null\` for the server's:
2486
+ \`lang.translate(player, "MYPLUGIN_WELCOME", [player.name])\`.
2487
+
2488
+ \`%s\`, \`%d\`, \`%f\` (\`%.1f\`, \`%02d\`, ...) are filled from \`args\` in order;
2489
+ one no argument is left for stays as written. The dictionary's colour
2490
+ codes come back as tags - \`\\y\` as \`!y\`, \`^4\` as \`!g\` - so the line goes
2491
+ to a menu and to chat alike. A key no dictionary has comes back as it is.
2492
+
2493
+ Pawn: \`LookupLangKey\`, \`format\` with \`%L\`
2494
+ `,
2495
+ ru: `
2496
+ Строка ключа на языке игрока, \`null\` — на языке сервера:
2497
+ \`lang.translate(player, "MYPLUGIN_WELCOME", [player.name])\`.
2498
+
2499
+ \`%s\`, \`%d\`, \`%f\` (\`%.1f\`, \`%02d\`, ...) заполняются из \`args\` по порядку;
2500
+ тот, на который аргумента не хватило, остаётся как написан. Цветовые коды
2501
+ словаря возвращаются метками — \`\\y\` как \`!y\`, \`^4\` как \`!g\`, — так что
2502
+ строка годится и для меню, и для чата. Ключ, которого нет ни в одном
2503
+ словаре, возвращается как есть.
2504
+
2505
+ Pawn: \`LookupLangKey\`, \`format\` с \`%L\`
2506
+ `,
2507
+ },
2508
+ 'cvar': {
2509
+ en: `
2510
+ Reads and sets a cvar by name in one call: \`cvar.num("mp_freezetime")\`.
2511
+
2512
+ For a cvar used more than once \`Cvar\` is the better choice: it creates a
2513
+ missing cvar, hears its changes and reads it as text, a number or a switch.
2514
+ `,
2515
+ ru: `
2516
+ Читает и задаёт квар по имени одним вызовом: \`cvar.num("mp_freezetime")\`.
2517
+
2518
+ Для квара, который нужен не один раз, лучше \`Cvar\`: он создаёт недостающий
2519
+ квар, слышит его изменения и читает его как текст, число или переключатель.
2520
+ `,
2521
+ },
2522
+ 'cvar.num': {
2523
+ en: `
2524
+ The cvar's value as a whole number: \`cvar.num("mp_freezetime")\`.
2525
+
2526
+ Pawn: \`get_cvar_num\`
2527
+ `,
2528
+ ru: `
2529
+ Значение квара целым числом: \`cvar.num("mp_freezetime")\`.
2530
+
2531
+ Pawn: \`get_cvar_num\`
2532
+ `,
2533
+ },
2534
+ 'cvar.setNum': {
2535
+ en: `
2536
+ Sets the cvar to a whole number: \`cvar.setNum("mp_freezetime", 5)\`.
2537
+
2538
+ Pawn: \`set_cvar_num\`
2539
+ `,
2540
+ ru: `
2541
+ Задаёт квару целочисленное значение: \`cvar.setNum("mp_freezetime", 5)\`.
2542
+
2543
+ Pawn: \`set_cvar_num\`
2544
+ `,
2545
+ },
2546
+ 'cvar.str': {
2547
+ en: `
2548
+ The cvar's value as text: \`cvar.str("hostname")\`.
2549
+
2550
+ Pawn: \`get_cvar_string\`
2551
+ `,
2552
+ ru: `
2553
+ Значение квара текстом: \`cvar.str("hostname")\`.
2554
+
2555
+ Pawn: \`get_cvar_string\`
2556
+ `,
2557
+ },
2558
+ 'cvar.setStr': {
2559
+ en: `
2560
+ Sets the cvar's text: \`cvar.setStr("hostname", "My Server")\`.
2561
+
2562
+ Pawn: \`set_cvar_string\`
2563
+ `,
2564
+ ru: `
2565
+ Задаёт квару текст: \`cvar.setStr("hostname", "My Server")\`.
2566
+
2567
+ Pawn: \`set_cvar_string\`
2568
+ `,
2569
+ },
2570
+ 'cmd': {
2571
+ en: `
2572
+ Registers a console command for players; the handler gets the \`id\` of the
2573
+ player who typed it. \`server.addCommand\` is the usual way.
2574
+
2575
+ Pawn: \`register_clcmd\`
2576
+ `,
2577
+ ru: `
2578
+ Регистрирует консольную команду для игроков; обработчик получает \`id\`
2579
+ игрока, который её ввёл. Обычно для этого берут \`server.addCommand\`.
2580
+
2581
+ Pawn: \`register_clcmd\`
2582
+ `,
2583
+ },
2584
+ 'cmdWide': {
2585
+ en: `
2586
+ Registers a console command for players whose handler gets the raw
2587
+ arguments \`(id, level, cid)\`. \`handled()\` in the handler stops the command
2588
+ from going on to other plugins.
2589
+
2590
+ Pawn: \`register_clcmd\`
2591
+ `,
2592
+ ru: `
2593
+ Регистрирует консольную команду для игроков, обработчик которой получает
2594
+ сырые аргументы \`(id, level, cid)\`. \`handled()\` в обработчике не пускает
2595
+ команду дальше, к другим плагинам.
2596
+
2597
+ Pawn: \`register_clcmd\`
2598
+ `,
2599
+ },
2600
+ 'TimerHandler': {
2601
+ en: `The function a timer runs: \`() => ...\`.`,
2602
+ ru: `Функция, которую запускает таймер: \`() => ...\`.`,
2603
+ },
2604
+ 'setTimeout': {
2605
+ en: `
2606
+ Runs \`handler\` once after \`ms\` milliseconds and returns the timer's handle,
2607
+ as in the browser:
2608
+
2609
+ \`\`\`ts
2610
+ const handle = setTimeout(() => print(player, "Welcome!"), 2000);
2611
+ clearTimeout(handle);
2612
+ \`\`\`
2613
+
2614
+ The handler may use the variables around it. The precision is one server frame.
2615
+
2616
+ Pawn: \`set_task\`
2617
+ `,
2618
+ ru: `
2619
+ Запускает \`handler\` один раз через \`ms\` миллисекунд и возвращает дескриптор
2620
+ таймера, как в браузере:
2621
+
2622
+ \`\`\`ts
2623
+ const handle = setTimeout(() => print(player, "Welcome!"), 2000);
2624
+ clearTimeout(handle);
2625
+ \`\`\`
2626
+
2627
+ Обработчик может пользоваться переменными вокруг. Точность — один серверный кадр.
2628
+
2629
+ Pawn: \`set_task\`
2630
+ `,
2631
+ },
2632
+ 'SleepOptions': {
2633
+ en: `The options of \`sleep()\`.`,
2634
+ ru: `Настройки \`sleep()\`.`,
2635
+ },
2636
+ 'SleepOptions.signal': {
2637
+ en: `An AbortSignal that cancels the wait: the promise then rejects with the signal's reason.`,
2638
+ ru: `AbortSignal, который отменяет ожидание: промис тогда отклоняется с причиной сигнала.`,
2639
+ },
2640
+ 'sleep': {
2641
+ en: `
2642
+ Returns a promise fulfilled after \`ms\` milliseconds - the way to wait inside
2643
+ an async function:
2644
+
2645
+ \`\`\`ts
2646
+ await sleep(1000);
2647
+ await sleep(5000, { signal: AbortSignal.timeout(2000) }); // rejects after 2 s
2648
+ \`\`\`
2649
+
2650
+ The precision is one server frame. Inside an async command handler or
2651
+ player event the wait also ends when that player leaves.
2652
+
2653
+ Pawn: \`set_task\`
2654
+ `,
2655
+ ru: `
2656
+ Возвращает промис, который выполняется через \`ms\` миллисекунд, — так ждут
2657
+ внутри async-функции:
2658
+
2659
+ \`\`\`ts
2660
+ await sleep(1000);
2661
+ await sleep(5000, { signal: AbortSignal.timeout(2000) }); // отклоняется через 2 с
2662
+ \`\`\`
2663
+
2664
+ Точность — один серверный кадр. Внутри async-обработчика команды или
2665
+ события игрока ожидание заканчивается и тогда, когда этот игрок выходит.
2666
+
2667
+ Pawn: \`set_task\`
2668
+ `,
2669
+ },
2670
+ 'setInterval': {
2671
+ en: `
2672
+ Runs \`handler\` every \`ms\` milliseconds until \`clearInterval\` stops it;
2673
+ returns the timer's handle.
2674
+
2675
+ Pawn: \`set_task\` with the "b" flag
2676
+ `,
2677
+ ru: `
2678
+ Запускает \`handler\` каждые \`ms\` миллисекунд, пока его не остановит
2679
+ \`clearInterval\`; возвращает дескриптор таймера.
2680
+
2681
+ Pawn: \`set_task\` with the "b" flag
2682
+ `,
2683
+ },
2684
+ 'clearTimeout': {
2685
+ en: `
2686
+ Stops the timer with this handle. A timer that has already fired or been
2687
+ stopped is ignored. Only this stops these timers: Pawn's task natives do not
2688
+ see them.
2689
+
2690
+ Pawn: \`remove_task\`
2691
+ `,
2692
+ ru: `
2693
+ Останавливает таймер с этим дескриптором. Уже сработавший или остановленный
2694
+ таймер игнорируется. Остановить эти таймеры можно только так: task-нативы
2695
+ Pawn их не видят.
2696
+
2697
+ Pawn: \`remove_task\`
2698
+ `,
2699
+ },
2700
+ 'clearInterval': {
2701
+ en: `Stops the interval with this handle; the same as \`clearTimeout\`.`,
2702
+ ru: `Останавливает интервал с этим дескриптором; то же, что \`clearTimeout\`.`,
2703
+ },
2704
+ 'Call': {
2705
+ en: `
2706
+ A call of a Pawn native with a \`...\` tail, built one argument at a time -
2707
+ the low-level way. A native from \`~/natives\` is an ordinary function and
2708
+ needs none of this.
2709
+
2710
+ new Call(NATIVE_server_print).str("%s").str(text).run();
2711
+
2712
+ Find the \`...\` in the native's declaration. Arguments before it go as they
2713
+ are, with \`num\` or \`str\`. A number in the tail goes with \`ref\`, which passes
2714
+ it by address, and \`out(i)\` reads back what the native wrote there; a string
2715
+ goes with \`str\` anywhere.
2716
+
2717
+ ExecuteHam(Ham:function, this, any:...) num, num, then the tail
2718
+ SetHookChainArg(number, AType:type, any:...) num, num, then the tail
2719
+ ExecuteForward(handle, &ret, any:...) num, ref for &ret, then tail
2720
+
2721
+ A wrong kind of argument fails quietly, somewhere else.
2722
+ `,
2723
+ ru: `
2724
+ Вызов Pawn-натива с хвостом \`...\`, собираемый по одному аргументу, —
2725
+ низкоуровневый способ. Натив из \`~/natives\` — обычная функция, и ему это
2726
+ не нужно.
2727
+
2728
+ new Call(NATIVE_server_print).str("%s").str(text).run();
2729
+
2730
+ Найдите \`...\` в объявлении натива. Аргументы до него передаются как есть,
2731
+ через \`num\` или \`str\`. Число в хвосте передаётся через \`ref\` — по адресу, —
2732
+ а \`out(i)\` читает то, что натив туда записал; строка везде идёт через \`str\`.
2733
+
2734
+ ExecuteHam(Ham:function, this, any:...) num, num, then the tail
2735
+ SetHookChainArg(number, AType:type, any:...) num, num, then the tail
2736
+ ExecuteForward(handle, &ret, any:...) num, ref for &ret, then tail
2737
+
2738
+ Аргумент не того вида ломает вызов тихо и совсем в другом месте.
2739
+ `,
2740
+ },
2741
+ 'Call.num': {
2742
+ en: `Adds a number argument as it is: an entity index, a constant, a count.`,
2743
+ ru: `Добавляет числовой аргумент как есть: индекс сущности, константу, количество.`,
2744
+ },
2745
+ 'Call.float': {
2746
+ en: `Adds a fractional number argument, one the native declares as \`Float:\`.`,
2747
+ ru: `Добавляет дробный аргумент — тот, что натив объявляет как \`Float:\`.`,
2748
+ },
2749
+ 'Call.str': {
2750
+ en: `Adds a string argument, before the \`...\` or in the tail alike.`,
2751
+ ru: `Добавляет строковый аргумент — одинаково до \`...\` и в хвосте.`,
2752
+ },
2753
+ 'Call.buffer': {
2754
+ en: `Adds an array of cells the native reads and may write into, followed by its length.`,
2755
+ ru: `Добавляет массив ячеек, который натив читает и может перезаписать, а следом — его длину.`,
2756
+ },
2757
+ 'Call.vec': {
2758
+ en: `Adds a vector: three fractional numbers at one address - an origin, angles, a colour. Unlike \`buffer\`, no length follows it.`,
2759
+ ru: `Добавляет вектор: три дробных числа по одному адресу — координаты, углы, цвет. В отличие от \`buffer\`, длина за ним не идёт.`,
2760
+ },
2761
+ 'Call.vecInto': {
2762
+ en: `Adds a vector the native fills in; after \`run\` the result is in \`cells\`.`,
2763
+ ru: `Добавляет вектор, который заполняет натив; после \`run\` результат — в \`cells\`.`,
2764
+ },
2765
+ 'Call.tailBuffer': {
2766
+ en: `
2767
+ Adds an array of cells the native writes into, in a \`...\` tail: its length
2768
+ follows by address, as a tail's numbers do - \`get_member(id, member,
2769
+ dest[], len)\`.
2770
+ `,
2771
+ ru: `
2772
+ Добавляет массив ячеек, в который пишет натив, в хвост \`...\`: его длина
2773
+ идёт следом по адресу, как числа хвоста, — \`get_member(id, member,
2774
+ dest[], len)\`.
2775
+ `,
2776
+ },
2777
+ 'Call.array': {
2778
+ en: `
2779
+ Adds an array to a forward's \`...\` tail: \`ExecuteForward\` gets it as
2780
+ \`PrepareArray\` makes it. \`floats\` sends the numbers as \`Float:\`.
2781
+ `,
2782
+ ru: `
2783
+ Добавляет массив в хвост \`...\` форварда: \`ExecuteForward\` получает его
2784
+ таким, каким его делает \`PrepareArray\`. \`floats\` передаёт числа как \`Float:\`.
2785
+ `,
2786
+ },
2787
+ 'Call.ref': {
2788
+ en: `Adds a number passed by address, as a \`...\` tail argument must be; \`out\` reads what the native wrote into it.`,
2789
+ ru: `Добавляет число, передаваемое по адресу, — так передаётся аргумент хвоста \`...\`; \`out\` читает, что натив в него записал.`,
2790
+ },
2791
+ 'Call.out': {
2792
+ en: `The value the native left in the \`ref\` argument at this position, after \`run\`.`,
2793
+ ru: `Значение, которое натив оставил в аргументе \`ref\` на этой позиции, после \`run\`.`,
2794
+ },
2795
+ 'Call.run': {
2796
+ en: `Calls the native with the arguments added so far and returns its result.`,
2797
+ ru: `Вызывает натив с добавленными аргументами и возвращает его результат.`,
2798
+ },
2799
+ 'hook': {
2800
+ en: `
2801
+ Registers a reapi hookchain with a raw handler of four numbers - the low
2802
+ level under \`game.addEventListener\`, which is what a plugin uses.
2803
+
2804
+ The name is reapi's, without the class where it is not needed:
2805
+ \`"restart_round"\`, \`"player_spawn"\`; the editor completes them. The numbers
2806
+ behind the names come from reapi's includes, so they must be the ones of the
2807
+ reapi the server runs. Returns the hook's handle.
2808
+
2809
+ Pawn: \`RegisterHookChain\`, \`EnableHookChain\`, \`DisableHookChain\`
2810
+ `,
2811
+ ru: `
2812
+ Регистрирует хукчейн reapi с сырым обработчиком из четырёх чисел — нижний
2813
+ уровень под \`game.addEventListener\`, которым пользуется плагин.
2814
+
2815
+ Имя — из reapi, без класса там, где он не нужен: \`"restart_round"\`,
2816
+ \`"player_spawn"\`; редактор их дополняет. Числа за именами берутся из
2817
+ инклудов reapi, поэтому инклуды должны быть от того reapi, что стоит на
2818
+ сервере. Возвращает дескриптор хука.
2819
+
2820
+ Pawn: \`RegisterHookChain\`, \`EnableHookChain\`, \`DisableHookChain\`
2821
+ `,
2822
+ },
2823
+
2824
+ 'PluginInfo': {
2825
+ en: `The plugin's name, version, author and description, given to \`plugin({ ... })\`; \`amxts_plugins\` in the server console lists them.`,
2826
+ ru: `Имя, версия, автор и описание плагина для \`plugin({ ... })\`; их показывает \`amxts_plugins\` в консоли сервера.`,
2827
+ },
2828
+ 'PluginInfo.name': {
2829
+ en: `The plugin's name, e.g. \`"My Plugin"\`.`,
2830
+ ru: `Имя плагина, например \`"My Plugin"\`.`,
2831
+ },
2832
+ 'PluginInfo.version': {
2833
+ en: `The plugin's version, e.g. \`"1.0.0"\`.`,
2834
+ ru: `Версия плагина, например \`"1.0.0"\`.`,
2835
+ },
2836
+ 'PluginInfo.author': {
2837
+ en: `The plugin's author.`,
2838
+ ru: `Автор плагина.`,
2839
+ },
2840
+ 'PluginInfo.description': {
2841
+ en: `The plugin's description, in one line.`,
2842
+ ru: `Описание плагина, одной строкой.`,
2843
+ },
2844
+ 'PluginInfo.include': {
2845
+ en: `
2846
+ The Pawn include whose natives the plugin implements, e.g. \`"myplugin.inc"\`, from
2847
+ \`includes/\` or beside the plugin. Each exported function reaches Pawn as the
2848
+ include declares it, and Pawn plugins use that include.
2849
+ `,
2850
+ ru: `
2851
+ Pawn-инклуд, нативы которого реализует плагин, например \`"myplugin.inc"\`, из
2852
+ \`includes/\` или рядом с плагином. Каждая экспортированная функция уходит в
2853
+ Pawn так, как её объявляет инклуд, и Pawn-плагины подключают этот инклуд.
2854
+ `,
2855
+ },
2856
+ 'plugin': {
2857
+ en: `
2858
+ Declares the plugin: its name, version, author and description, as the
2859
+ server's plugin list shows them. Called once, at the top level:
2860
+
2861
+ \`\`\`ts
2862
+ plugin({ name: "Hello", version: "1.0.0", author: "you", description: "An example" });
2863
+ \`\`\`
2864
+
2865
+ \`include\` names the Pawn include whose natives the plugin implements.
2866
+
2867
+ Pawn: \`register_plugin\`
2868
+ `,
2869
+ ru: `
2870
+ Объявляет плагин: имя, версия, автор и описание — так их показывает список
2871
+ плагинов сервера. Вызывается один раз, на верхнем уровне файла:
2872
+
2873
+ \`\`\`ts
2874
+ plugin({ name: "Hello", version: "1.0.0", author: "you", description: "An example" });
2875
+ \`\`\`
2876
+
2877
+ \`include\` — Pawn-инклуд, нативы которого реализует плагин.
2878
+
2879
+ Pawn: \`register_plugin\`
2880
+ `,
2881
+ },
2882
+ 'ModuleOptions': {
2883
+ en: `
2884
+ The modules' settings in \`amxts.config.ts\`, each under its module's \`configKey\`.
2885
+ Empty here: a module adds its key by augmenting this interface in
2886
+ \`"@amxts/core"\` - \`menus?: Partial<MenuCoreOptions>\` - and the editor checks
2887
+ the config against it.
2888
+ `,
2889
+ ru: `
2890
+ Настройки модулей в \`amxts.config.ts\`, каждая — под \`configKey\` своего модуля.
2891
+ Здесь пусто: модуль добавляет свой ключ, дополняя этот интерфейс в
2892
+ \`"@amxts/core"\`, — \`menus?: Partial<MenuCoreOptions>\`, — и редактор проверяет
2893
+ конфиг по нему.
2894
+ `,
2895
+ },
2896
+ 'defineModule': {
2897
+ en: `
2898
+ Defines a module: \`export default defineModule<Options>({ meta, requires,
2899
+ defaults, setup })\` in its module file. \`setup\` runs once,
2900
+ when the server loads the module, with \`defaults\` and what \`amxts.config.ts\`
2901
+ sets over them. Global; \`import { defineModule } from "@amxts/core"\` works too.
2902
+ `,
2903
+ ru: `
2904
+ Объявляет модуль: \`export default defineModule<Options>({ meta, requires,
2905
+ defaults, setup })\` в файле модуля. \`setup\` выполняется один
2906
+ раз, когда сервер загружает модуль, — с \`defaults\` и тем, что поверх них
2907
+ задаёт \`amxts.config.ts\`. Глобальная; \`import { defineModule } from "@amxts/core"\` тоже работает.
2908
+ `,
2909
+ },
2910
+ 'ForwardStop': {
2911
+ en: `
2912
+ The forward's stopping rule, one of: \`"never"\` - every plugin hears it, whatever it
2913
+ returns; \`"handled"\` - the first plugin that says it handled the forward
2914
+ stops it.
2915
+
2916
+ Pawn: \`ET_IGNORE\`, \`ET_STOP\`
2917
+ `,
2918
+ ru: `
2919
+ Правило остановки форварда, одно из: \`"never"\` — его слышат все плагины, что бы они
2920
+ ни вернули; \`"handled"\` — его останавливает первый плагин, который сообщил,
2921
+ что обработал форвард.
2922
+
2923
+ Pawn: \`ET_IGNORE\`, \`ET_STOP\`
2924
+ `,
2925
+ },
2926
+ 'NoArgument': {
2927
+ en: `A placeholder for an unused type argument of \`Forward\`: \`Forward<number>\` has one argument.`,
2928
+ ru: `Заглушка для неиспользуемого аргумента типа у \`Forward\`: у \`Forward<number>\` один аргумент.`,
2929
+ },
2930
+ 'Forward': {
2931
+ en: `
2932
+ A forward other plugins listen to, Pawn and TypeScript alike. Its arguments
2933
+ are its type parameters, up to 32 - as many as AMX Mod X gives a forward:
2934
+
2935
+ \`\`\`ts
2936
+ const roundStart = new Forward("myplugin_on_round_start");
2937
+ const roundEnd = new Forward<RoundWinner>("myplugin_on_round_end");
2938
+ const configChanged = new Forward<string, string>("myplugin_on_config_changed");
2939
+
2940
+ roundStart.emit();
2941
+ roundEnd.emit(winner);
2942
+ configChanged.emit(id, value);
2943
+
2944
+ const swapped = new Forward<Player, Player>("myplugin_on_player_swapped");
2945
+ swapped.emit(catcher, caught); // Pawn gets their ids
2946
+ \`\`\`
2947
+
2948
+ A Pawn plugin listens with \`public myplugin_on_round_end(winner)\`, as usual;
2949
+ a TypeScript plugin with \`subscribe(handler)\`. A number, a boolean and a
2950
+ Player (its \`id\`) reach Pawn as numbers, a \`Float\` as a Float, a string as
2951
+ a string, a \`number[]\` or a \`Vector\` as an array. A \`Team\` or a
2952
+ \`RoundWinner\` goes as Pawn's number where an include declares the forward
2953
+ with that tag; a \`Team\` for a forward no include declares is a build error.
2954
+
2955
+ The forward is created on its first emit, or earlier by \`create()\` - once
2956
+ every plugin has loaded (\`plugin_cfg\` or later), or those loaded after it
2957
+ would not hear it.
2958
+
2959
+ Pawn: \`CreateMultiForward\`, \`ExecuteForward\`
2960
+ `,
2961
+ ru: `
2962
+ Форвард, который слушают другие плагины — и Pawn, и TypeScript. Его
2963
+ аргументы — параметры типа, до 32 — столько, сколько AMX Mod X даёт форварду:
2964
+
2965
+ \`\`\`ts
2966
+ const roundStart = new Forward("myplugin_on_round_start");
2967
+ const roundEnd = new Forward<RoundWinner>("myplugin_on_round_end");
2968
+ const configChanged = new Forward<string, string>("myplugin_on_config_changed");
2969
+
2970
+ roundStart.emit();
2971
+ roundEnd.emit(winner);
2972
+ configChanged.emit(id, value);
2973
+
2974
+ const swapped = new Forward<Player, Player>("myplugin_on_player_swapped");
2975
+ swapped.emit(catcher, caught); // Pawn получает их id
2976
+ \`\`\`
2977
+
2978
+ Pawn-плагин слушает его через \`public myplugin_on_round_end(winner)\`, как
2979
+ обычно, TypeScript-плагин — через \`subscribe(handler)\`. number, boolean и
2980
+ Player (его \`id\`) приходят в Pawn числами, \`Float\` — Float, string —
2981
+ строкой, \`number[]\` и \`Vector\` — массивом. \`Team\` и
2982
+ \`RoundWinner\` уходят числом Pawn там, где инклуд объявляет форвард с таким
2983
+ тегом; \`Team\` для форварда, которого нет ни в одном инклуде, — ошибка сборки.
2984
+
2985
+ Форвард создаётся при первом emit или раньше, вызовом \`create()\`, — когда
2986
+ все плагины уже загружены (\`plugin_cfg\` или позже), иначе загруженные после
2987
+ него его не услышат.
2988
+
2989
+ Pawn: \`CreateMultiForward\`, \`ExecuteForward\`
2990
+ `,
2991
+ },
2992
+ 'Forward.stopWhen': {
2993
+ en: `The forward's stopping rule, one of \`"never"\` (the default) or \`"handled"\`. Set it before the first emit.`,
2994
+ ru: `Правило остановки форварда, одно из \`"never"\` (по умолчанию) или \`"handled"\`. Задаётся до первого emit.`,
2995
+ },
2996
+ 'Forward.name': {
2997
+ en: `The forward's name, as Pawn plugins listen to it.`,
2998
+ ru: `Имя форварда, под которым его слушают Pawn-плагины.`,
2999
+ },
3000
+ 'Forward.subscribe': {
3001
+ en: `
3002
+ Calls \`handler\` each time the forward is emitted - by this plugin, another
3003
+ TypeScript plugin or a Pawn plugin:
3004
+
3005
+ \`\`\`ts
3006
+ const greeted = new Forward<string, number>("showcase_on_greeted");
3007
+ greeted.subscribe((name, count) => console.log(\`\${name}: \${count}\`));
3008
+ \`\`\`
3009
+
3010
+ The handler's parameters take the forward's types; a named function may
3011
+ take fewer of them. A forward created by a Pawn plugin reaches TypeScript
3012
+ only when one of the amxts host plugin's includes declares it; one emitted
3013
+ from TypeScript reaches every subscriber.
3014
+ `,
3015
+ ru: `
3016
+ Вызывает \`handler\` при каждом срабатывании форварда — из этого плагина,
3017
+ другого TypeScript-плагина или Pawn-плагина:
3018
+
3019
+ \`\`\`ts
3020
+ const greeted = new Forward<string, number>("showcase_on_greeted");
3021
+ greeted.subscribe((name, count) => console.log(\`\${name}: \${count}\`));
3022
+ \`\`\`
3023
+
3024
+ Параметры обработчика получают типы форварда; именованная функция может
3025
+ принимать их меньше. Форвард, созданный Pawn-плагином, доходит до
3026
+ TypeScript, только если он объявлен в одном из инклудов хост-плагина
3027
+ amxts; отправленный из TypeScript доходит до всех подписчиков.
3028
+ `,
3029
+ },
3030
+ 'Forward.unsubscribe': {
3031
+ en: `Stops calling a handler given to \`subscribe()\`.`,
3032
+ ru: `Перестаёт вызывать обработчик, переданный в \`subscribe()\`.`,
3033
+ },
3034
+ 'Forward.deliver': {
3035
+ en: `Passes the forward's arguments to every \`subscribe()\` handler; the server calls it, not a plugin.`,
3036
+ ru: `Передаёт аргументы форварда всем обработчикам из \`subscribe()\`; вызывает это сервер, а не плагин.`,
3037
+ },
3038
+ 'Forward.create': {
3039
+ en: `
3040
+ Creates the forward now rather than on its first emit; later calls do nothing.
3041
+
3042
+ Pawn: \`CreateMultiForward\`
3043
+ `,
3044
+ ru: `
3045
+ Создаёт форвард сейчас, а не при первом emit; повторные вызовы ничего не делают.
3046
+
3047
+ Pawn: \`CreateMultiForward\`
3048
+ `,
3049
+ },
3050
+ 'Forward.emit': {
3051
+ en: `
3052
+ Sends the forward to every plugin that listens to it; \`true\` if it went out.
3053
+
3054
+ Pawn: \`ExecuteForward\`
3055
+ `,
3056
+ ru: `
3057
+ Отправляет форвард всем плагинам, которые его слушают; \`true\`, если он ушёл.
3058
+
3059
+ Pawn: \`ExecuteForward\`
3060
+ `,
3061
+ },
3062
+ 'Storage': {
3063
+ en: `
3064
+ A key-to-text store on disk: a Map that survives a map change and a server
3065
+ restart.
3066
+
3067
+ \`\`\`ts
3068
+ const demos = new Storage("core_demo_counters");
3069
+ const last = demos.get(auth); // string | null
3070
+ demos.set(auth, "3");
3071
+ if (demos.has(auth)) ...
3072
+ demos.delete(auth);
3073
+ \`\`\`
3074
+
3075
+ The file is named after the storage, kept in the \`vault\` folder of the AMX
3076
+ Mod X data folder, and opened on first use. Values are text: a number goes
3077
+ in with \`toString()\` and comes out with \`parseInt\`.
3078
+
3079
+ Pawn: \`nvault_open\`, \`nvault_get\`, \`nvault_set\`, \`nvault_remove\`
3080
+ `,
3081
+ ru: `
3082
+ Хранилище текста по ключу на диске: Map, который переживает смену карты и
3083
+ перезапуск сервера.
3084
+
3085
+ \`\`\`ts
3086
+ const demos = new Storage("core_demo_counters");
3087
+ const last = demos.get(auth); // string | null
3088
+ demos.set(auth, "3");
3089
+ if (demos.has(auth)) ...
3090
+ demos.delete(auth);
3091
+ \`\`\`
3092
+
3093
+ Файл называется по имени хранилища, лежит в папке \`vault\` в папке данных
3094
+ AMX Mod X и открывается при первом обращении. Значения — текст: число
3095
+ кладётся через \`toString()\`, а читается через \`parseInt\`.
3096
+
3097
+ Pawn: \`nvault_open\`, \`nvault_get\`, \`nvault_set\`, \`nvault_remove\`
3098
+ `,
3099
+ },
3100
+ 'Storage.name': {
3101
+ en: `The storage's name, which is also its file's name.`,
3102
+ ru: `Имя хранилища — оно же имя его файла.`,
3103
+ },
3104
+ 'Storage.get': {
3105
+ en: `The value under \`key\`, or \`null\` when there is none.`,
3106
+ ru: `Значение по ключу \`key\` или \`null\`, если его нет.`,
3107
+ },
3108
+ 'Storage.set': {
3109
+ en: `Puts \`value\` under \`key\`, replacing what was there.`,
3110
+ ru: `Записывает \`value\` по ключу \`key\`, заменяя прежнее значение.`,
3111
+ },
3112
+ 'Storage.has': {
3113
+ en: `\`true\` when there is a value under \`key\`.`,
3114
+ ru: `\`true\`, если по ключу \`key\` есть значение.`,
3115
+ },
3116
+ 'Storage.delete': {
3117
+ en: `Removes \`key\` and its value; a key that is not there is ignored.`,
3118
+ ru: `Удаляет ключ \`key\` вместе со значением; отсутствующий ключ игнорируется.`,
3119
+ },
3120
+ 'PawnFunction': {
3121
+ en: `
3122
+ A public function of another plugin - a Pawn plugin's public, or a
3123
+ TypeScript plugin's \`publicFor\` name - to call from here:
3124
+
3125
+ \`\`\`ts
3126
+ const fn = PawnFunction.find(caller(), "OnAction"); // null when there is none
3127
+ if (fn != null) fn.call().int(id).text("KEY").run();
3128
+ const call = fn.call().int(id).int(target).buffer(256).int(255);
3129
+ call.run();
3130
+ const value = call.bufferText; // what it wrote into value[]
3131
+ \`\`\`
3132
+
3133
+ Pawn: \`get_func_id\`, \`callfunc_begin_i\`
3134
+ `,
3135
+ ru: `
3136
+ Публичная функция другого плагина — паблик Pawn-плагина или имя
3137
+ \`publicFor\` TypeScript-плагина, — которую можно вызвать отсюда:
3138
+
3139
+ \`\`\`ts
3140
+ const fn = PawnFunction.find(caller(), "OnAction"); // null, если такой нет
3141
+ if (fn != null) fn.call().int(id).text("KEY").run();
3142
+ const call = fn.call().int(id).int(target).buffer(256).int(255);
3143
+ call.run();
3144
+ const value = call.bufferText; // что она записала в value[]
3145
+ \`\`\`
3146
+
3147
+ Pawn: \`get_func_id\`, \`callfunc_begin_i\`
3148
+ `,
3149
+ },
3150
+ 'PawnFunction.plugin': {
3151
+ en: `The \`id\` of the plugin the function belongs to.`,
3152
+ ru: `\`id\` плагина, которому принадлежит функция.`,
3153
+ },
3154
+ 'PawnFunction.index': {
3155
+ en: `
3156
+ The function's index in its plugin.
3157
+
3158
+ Pawn: \`get_func_id\`
3159
+ `,
3160
+ ru: `
3161
+ Индекс функции в её плагине.
3162
+
3163
+ Pawn: \`get_func_id\`
3164
+ `,
3165
+ },
3166
+ 'PawnFunction.find': {
3167
+ en: `
3168
+ Finds the public \`name\` in the plugin with this \`id\` (a native's \`caller()\`);
3169
+ \`null\` when the plugin has no such public.
3170
+
3171
+ Pawn: \`get_func_id\`
3172
+ `,
3173
+ ru: `
3174
+ Находит паблик \`name\` в плагине с этим \`id\` (\`caller()\` натива); \`null\`, если
3175
+ такого паблика у плагина нет.
3176
+
3177
+ Pawn: \`get_func_id\`
3178
+ `,
3179
+ },
3180
+ 'PawnFunction.call': {
3181
+ en: `Starts a call of the function: add its arguments in order, then \`run()\`.`,
3182
+ ru: `Начинает вызов функции: добавьте её аргументы по порядку, затем \`run()\`.`,
3183
+ },
3184
+ 'PawnCall': {
3185
+ en: `
3186
+ One call of a PawnFunction: its arguments in order, then \`run()\`. Any
3187
+ number of strings and arrays may be passed, and what the function writes
3188
+ into a \`buffer()\` is read afterwards from \`bufferText\`.
3189
+
3190
+ Pawn: \`callfunc_push_int\`, \`callfunc_push_str\`, \`callfunc_push_array\`, \`callfunc_end\`
3191
+ `,
3192
+ ru: `
3193
+ Один вызов PawnFunction: её аргументы по порядку, затем \`run()\`. Строк и
3194
+ массивов можно передать сколько угодно, а то, что функция записала в
3195
+ \`buffer()\`, потом читается из \`bufferText\`.
3196
+
3197
+ Pawn: \`callfunc_push_int\`, \`callfunc_push_str\`, \`callfunc_push_array\`, \`callfunc_end\`
3198
+ `,
3199
+ },
3200
+ 'PawnCall.bufferText': {
3201
+ en: `The text the function wrote into its \`buffer()\`, once \`run()\` is over.`,
3202
+ ru: `Текст, который функция записала в свой \`buffer()\`, после \`run()\`.`,
3203
+ },
3204
+ 'PawnCall.int': {
3205
+ en: `Adds a number argument.`,
3206
+ ru: `Добавляет числовой аргумент.`,
3207
+ },
3208
+ 'PawnCall.bool': {
3209
+ en: `Adds a boolean argument; the function gets \`1\` or \`0\`.`,
3210
+ ru: `Добавляет логический аргумент; функция получает \`1\` или \`0\`.`,
3211
+ },
3212
+ 'PawnCall.text': {
3213
+ en: `Adds a string argument.`,
3214
+ ru: `Добавляет строковый аргумент.`,
3215
+ },
3216
+ 'PawnCall.buffer': {
3217
+ en: `Adds an array of \`size\` cells for the function to fill - its \`value[]\`; one per call. The text is then in \`bufferText\`.`,
3218
+ ru: `Добавляет массив из \`size\` ячеек, который заполняет функция, — её \`value[]\`; один на вызов. Текст потом — в \`bufferText\`.`,
3219
+ },
3220
+ 'PawnCall.run': {
3221
+ en: `Calls the function and returns its result, or \`0\` when it could not be called.`,
3222
+ ru: `Вызывает функцию и возвращает её результат или \`0\`, если вызвать не удалось.`,
3223
+ },
3224
+ 'createCellArray': {
3225
+ en: `
3226
+ Creates an AMX Mod X \`Array:\` of \`cellSize\` cells an item and returns its handle.
3227
+
3228
+ Pawn: \`ArrayCreate\`
3229
+ `,
3230
+ ru: `
3231
+ Создаёт \`Array:\` AMX Mod X по \`cellSize\` ячеек на элемент и возвращает его дескриптор.
3232
+
3233
+ Pawn: \`ArrayCreate\`
3234
+ `,
3235
+ },
3236
+ 'destroyCellArray': {
3237
+ en: `
3238
+ Frees an \`Array:\` made by \`createCellArray\`; its handle is no good afterwards.
3239
+
3240
+ Pawn: \`ArrayDestroy\`
3241
+ `,
3242
+ ru: `
3243
+ Освобождает \`Array:\`, созданный \`createCellArray\`; после этого дескриптор недействителен.
3244
+
3245
+ Pawn: \`ArrayDestroy\`
3246
+ `,
3247
+ },
3248
+ 'cellArrayRows': {
3249
+ en: `
3250
+ Reads every item of an \`Array:\` of \`cellSize\` cells an item, each as an array of numbers.
3251
+
3252
+ Pawn: \`ArrayGetArray\`
3253
+ `,
3254
+ ru: `
3255
+ Читает все элементы \`Array:\` по \`cellSize\` ячеек на элемент, каждый — массивом чисел.
3256
+
3257
+ Pawn: \`ArrayGetArray\`
3258
+ `,
3259
+ },
3260
+ 'pushCellArrayRow': {
3261
+ en: `
3262
+ Adds one item, an array of numbers, to the end of an \`Array:\`.
3263
+
3264
+ Pawn: \`ArrayPushArray\`
3265
+ `,
3266
+ ru: `
3267
+ Добавляет в конец \`Array:\` один элемент — массив чисел.
3268
+
3269
+ Pawn: \`ArrayPushArray\`
3270
+ `,
3271
+ },
3272
+ 'cellsText': {
3273
+ en: `Reads a Pawn string from \`count\` cells of a row, from \`start\`: a UTF-8 byte a cell, up to the first zero.`,
3274
+ ru: `Читает Pawn-строку из \`count\` ячеек строки таблицы, начиная со \`start\`: по байту UTF-8 на ячейку, до первого нуля.`,
3275
+ },
3276
+ 'textCells': {
3277
+ en: `Writes text as \`count\` cells of a Pawn string: at most \`count - 1\` bytes, never half a letter, the rest zeros.`,
3278
+ ru: `Записывает текст в \`count\` ячеек Pawn-строки: не больше \`count - 1\` байт, без половинок букв, остаток — нули.`,
3279
+ },
3280
+ 'showMenu': {
3281
+ en: `
3282
+ Shows a player an old-style menu of any length: \`keys\` are the keys it
3283
+ accepts, \`title\` the name its key presses come back under.
3284
+
3285
+ Colour tags, the same letters as in chat: \`!y\` yellow, \`!r\` red, \`!d\` grey,
3286
+ \`!w\` white, \`!R\` to the right edge. Chat's own tags (\`!g\`, \`!b\`, \`!t\`)
3287
+ are dropped, and so are the game's own codes (\`\\y\`): text is written with tags.
3288
+
3289
+ Pawn: \`show_menu\`, \`register_menucmd\`
3290
+ `,
3291
+ ru: `
3292
+ Показывает игроку старое меню любой длины: \`keys\` — клавиши, которые оно
3293
+ принимает, \`title\` — имя, под которым приходят нажатия.
3294
+
3295
+ Цветовые метки, те же буквы, что в чате: \`!y\` жёлтый, \`!r\` красный, \`!d\` серый,
3296
+ \`!w\` белый, \`!R\` — к правому краю. Метки только для чата (\`!g\`, \`!b\`, \`!t\`)
3297
+ убираются, как и собственные коды игры (\`\\y\`): текст пишется метками.
3298
+
3299
+ Pawn: \`show_menu\`, \`register_menucmd\`
3300
+ `,
3301
+ },
3302
+ };