@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,754 @@
1
+ // vim: set ts=4 sw=4 tw=99 noet:
2
+ //
3
+ // AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO").
4
+ // Copyright (C) The AMX Mod X Development Team.
5
+ //
6
+ // This software is licensed under the GNU General Public License, version 3 or higher.
7
+ // Additional exceptions apply. For full license details, see LICENSE.txt or visit:
8
+ // https://alliedmods.net/amxmodx-license
9
+
10
+ //
11
+ // Natural Selection Module Functions
12
+ //
13
+
14
+ #if defined NS_INC
15
+ #endinput
16
+ #endif
17
+ #define NS_INC
18
+
19
+ #pragma reqlib ns
20
+ #if !defined AMXMODX_NOAUTOLOAD
21
+ #pragma loadlib ns
22
+ #endif
23
+
24
+ #include <ns_const>
25
+
26
+
27
+ /**
28
+ * Called whenever the client's class is changed.
29
+ *
30
+ * @param id The index of the player who changed.
31
+ * @param newclass The class the client changed to. Check the class enum in ns_const.inc.
32
+ * @param oldclass The class the client changed from. Check the class enum in ns_const.inc.
33
+ * @noreturn
34
+ */
35
+ forward client_changeclass(id, newclass, oldclass);
36
+
37
+ /**
38
+ * Called whenever the client builds a structure.
39
+ *
40
+ * @param idPlayer The player index who triggered the building.
41
+ * @param idStructure The structure index that was created.
42
+ * @param type The type of structure that was built (1 for marine, 2 for alien).
43
+ * @param impulse The impulse command that was issued to build this structure.
44
+ * @noreturn
45
+ */
46
+ forward client_built(idPlayer, idStructure, type, impulse);
47
+
48
+ /**
49
+ * Tell whether or not the map is combat.
50
+ *
51
+ * @return 1 if combat, 0 otherwise.
52
+ */
53
+ native ns_is_combat();
54
+
55
+ /**
56
+ * Returns the gameplay type for the currently active map.
57
+ * Refer to ns_const.inc's NSGameplay enum for details.
58
+ *
59
+ * @note The earliest this is guaranteed to be accurate is during plugin_init(). It needs
60
+ * the info_gameplay entity to be properly set within the map, or it will return "Unknown",
61
+ * or "Cantfind".
62
+ *
63
+ * @return Return the gameplay mode, as accurate as the module can tell.
64
+ */
65
+ native NSGameplay:ns_get_gameplay();
66
+
67
+ /**
68
+ * Exact syntax as get_user_team, but should be more accurate.
69
+ *
70
+ * @param id Player id.
71
+ * @param buff Buffer to store team name in.
72
+ * @param len Buffer length.
73
+ * @return The pev_team setting for the player.
74
+ */
75
+ native ns_get_user_team(id, buff[], len);
76
+
77
+ /**
78
+ * Send an NS-style popup message.
79
+ *
80
+ * @param target The client to receive the message. Set to 0 to send to everybody.
81
+ * @param szMsg The message to send, 180 characters max.
82
+ * @param ah Whether to only display the message on clients who have the cvar "cl_autohelp" set to 1.
83
+ * @noreturn
84
+ */
85
+ native ns_popup(target, const szMsg[180], ah=0);
86
+
87
+ /**
88
+ * Sets a player model. Omit the second parameter to return to default
89
+ *
90
+ * @note The model does not revert on death, teamswitch, gestation, etc.
91
+ *
92
+ * @param id The player id to change.
93
+ * @param szModel The model to change to.
94
+ * @noreturn
95
+ */
96
+ native ns_set_player_model(id, const szModel[]="");
97
+
98
+ /**
99
+ * Sets a player skin. Omit the second parameter to return to default
100
+ *
101
+ * @note The skin does not revert on death, teamswitch, gestation, etc.
102
+ *
103
+ * @param id The player id to change.
104
+ * @param skin The skin number to change to.
105
+ * @noreturn
106
+ */
107
+ native ns_set_player_skin(id, skin=-1);
108
+
109
+ /**
110
+ * Sets a player body. Omit the second parameter to return to default
111
+ *
112
+ * @note The body does not revert on death, teamswitch, gestation, etc.
113
+ *
114
+ * @param id The player id to change.
115
+ * @param body The body number to change to.
116
+ * @noreturn
117
+ */
118
+ native ns_set_player_body(id, body=-1);
119
+
120
+ /**
121
+ * Set this to modify the player's speed by a certain amount.
122
+ *
123
+ * @note The speed does not revert on death, teamswitch, gestation, etc.
124
+ *
125
+ * @param id The player id to change.
126
+ * @param speedchange The speed to modify the player speed by. Set to 0 to revert to default speed.
127
+ * @noreturn
128
+ */
129
+ native ns_set_speedchange(id, speedchange=0);
130
+
131
+ /**
132
+ * Returns a client's current speed modifier.
133
+ *
134
+ * @param id The client id to check.
135
+ * @return The module's current speed modifier for the client.
136
+ */
137
+ native ns_get_speedchange(id);
138
+
139
+ /**
140
+ * Returns a client's maxspeed before the speed change modifier is factored in.
141
+ *
142
+ * @param id The client id to check.
143
+ * @return The maxspeed for the client.
144
+ */
145
+ native ns_get_maxspeed(id);
146
+
147
+ /* Returns whether or not this mask is set from the entity's iuser4 field. Use the "mask" enum for reference. */
148
+ native ns_get_mask(id,mask);
149
+
150
+ /* Sets or removes the mask from the entity's iuser4 field. Set "value" to 1 to turn the mask on, 0 to turn it off. */
151
+ native ns_set_mask(id,mask,value);
152
+
153
+ /* Returns built/unbuilt structures.
154
+ If:
155
+ builtOnly is 1 (default):
156
+ Only fully built structures are counted.
157
+ builtOnly is 0:
158
+ Any structure meeting the classname is counted.
159
+
160
+ Number is 0 (default):
161
+ The total number of matching structures is returned.
162
+ Number is any other value:
163
+ The index of the #th matching structure is returned.
164
+ */
165
+ native ns_get_build(const classname[],builtOnly=1,Number=0);
166
+
167
+ /* Returns if the player has the weapon or not in their pev->weapons field.
168
+ set "setweapon" to 0 to turn the bit off, set to 1 to turn it on. Or omit it to just return the value. */
169
+ native ns_has_weapon(id,weapon,setweapon=-1);
170
+
171
+ /* Gets spawn point for specified team (type).
172
+ If:
173
+ Team is equal to 0:
174
+ Ready room spawns are returned.
175
+ Team is greater than 0:
176
+ Spawns for the team are returned.
177
+
178
+ Number is equal to 0:
179
+ Total number of spawns is returned.
180
+ Number is greater than 0:
181
+ The location of the specified spawn is returned.
182
+ */
183
+ native ns_get_spawn(team,number=0,Float:ret[3]);
184
+
185
+ /* Returns the class of the player. Look in the classes enum in ns_const.inc for the value's meaning. */
186
+ native ns_get_class(id);
187
+
188
+ /**
189
+ * Gets the player's jetpack fuel reserve.
190
+ *
191
+ * @param id The player to get fuel from.
192
+ * @return The amount of fuel in the player's reserve. (0.0 through 100.0)
193
+ */
194
+ native Float:ns_get_jpfuel(id);
195
+
196
+ /**
197
+ * Sets the player's jetpack fuel reserve.
198
+ *
199
+ * @param id The player to set fuel.
200
+ * @param fuel The amount of fuel to set, as a percentage (0.0 through 100.0)
201
+ * @noreturn
202
+ */
203
+ native ns_set_jpfuel(id, Float:fuel);
204
+
205
+ /**
206
+ * Adds to the player's jetpack fuel reserve.
207
+ *
208
+ * @param id The player to add fuel to.
209
+ * @param amount The amount of fuel to add, as a percentage (0.0 through 100.0)
210
+ * @return The new amount of fuel in the player's reserve. (0.0 through 100.0)
211
+ */
212
+ native Float:ns_add_jpfuel(id, Float:amount);
213
+
214
+ /**
215
+ * Gets the player's energy percentage.
216
+ *
217
+ * @param id The player to get the energy from.
218
+ * @return The amount of energy the player has (0.0 through 100.0)
219
+ */
220
+ native Float:ns_get_energy(id);
221
+
222
+ /**
223
+ * Sets the player's energy percentage.
224
+ *
225
+ * @param id The player to set the energy on.
226
+ * @param energy The amount of energy to set (0.0 through 100.0)
227
+ * @noreturn
228
+ */
229
+ native ns_set_energy(id, Float:energy);
230
+
231
+ /**
232
+ * Adds to the player's energy percentage.
233
+ *
234
+ * @param id The player to add the energy to.
235
+ * @param amount The amount of energy to add to the player.
236
+ * @return The new amount of energy the player has (0.0 through 100.0)
237
+ */
238
+ native Float:ns_add_energy(id, Float:amount);
239
+
240
+
241
+ /**
242
+ * Returns a player's resources.
243
+ *
244
+ * @note This is only for alien players.
245
+ * @param id The id of the player to check.
246
+ * @return Amount of resources this player has.
247
+ */
248
+ native Float:ns_get_res(id);
249
+
250
+ /**
251
+ * Sets a player's resources.
252
+ *
253
+ * @note This is only for alien players.
254
+ * @param id The id of the player to set.
255
+ * @param res Amount of resources to set on this player.
256
+ * @noreturn
257
+ */
258
+ native ns_set_res(id, Float:res);
259
+
260
+ /**
261
+ * Adds an amount of resources to the player.
262
+ *
263
+ * @note This is only for alien players.
264
+ * @param id The id of the player to add resources to.
265
+ * @param amount The amount to add to the player.
266
+ * @return The new amount of resources the player has.
267
+ */
268
+ native Float:ns_add_res(id, Float:amount);
269
+
270
+ /**
271
+ * Returns the team's resources.
272
+ *
273
+ * @param Team 1 for teama, 2 for teamb. (eg: in MvA maps, 1 is marines,
274
+ 2 is aliens. In mvm, 1 is marine1, 2 is marine2)
275
+ * @return The amount of resources in this team's resource pool.
276
+ */
277
+ native Float:ns_get_teamres(Team);
278
+
279
+ /**
280
+ * Sets the team's resources in the resource pool.
281
+ *
282
+ * @note If this is used on an alien team, the resources will be
283
+ * distributed between all of the players who need resources.
284
+ * @param Team 1 for teama, 2 for teamb. (eg: in MvA maps, 1 is marines,
285
+ * 2 is aliens. In mvm, 1 is marine1, 2 is marine2)
286
+ * @param value The amount to set the resources to set to.
287
+ * @noreturn
288
+ */
289
+ native ns_set_teamres(Team, Float:value);
290
+
291
+ /**
292
+ * Adds to the team's resources in the resource pool.
293
+ *
294
+ * @note If this is used on an alien team, the resources will be
295
+ * distributed between all of the players who need resources.
296
+ * @param Team 1 for teama, 2 for teamb. (eg: in MvA maps, 1 is marines,
297
+ * 2 is aliens. In mvm, 1 is marine1, 2 is marine2)
298
+ * @param value The amount to set the resources to add to the pool
299
+ * @return The new amount of resources in the resource pool.
300
+ */
301
+ native Float:ns_add_teamres(Team,Float:value);
302
+
303
+
304
+ /**
305
+ * Returns the player's experience.
306
+ *
307
+ * @note Combat only.
308
+ * @param id The player to get experience value from.
309
+ * @return The amount of experience this player has.
310
+ */
311
+ native Float:ns_get_exp(id);
312
+
313
+ /**
314
+ * Sets the player's experience.
315
+ *
316
+ * @note Combat only.
317
+ * @param id The player to set experience value on.
318
+ * @param exp The amount of experience this player will have.
319
+ * @noreturn
320
+ */
321
+ native ns_set_exp(id,Float:exp);
322
+
323
+ /**
324
+ * Adds to the player's experience.
325
+ *
326
+ * @note Combat only.
327
+ * @param id The player to add experience value to.
328
+ * @param value The amount of experience this player will receive.
329
+ * @return The new amount of experience this player has.
330
+ */
331
+ native Float:ns_add_exp(id, Float:value);
332
+
333
+ /**
334
+ * Gets the player's points spent count in combat.
335
+ *
336
+ * @param id The player to check.
337
+ * @return The amount of points this player has spent.
338
+ */
339
+ native ns_get_points(id);
340
+
341
+ /**
342
+ * Sets the player's points spent count in combat.
343
+ *
344
+ * @param id The player to set this on.
345
+ * @param points The amount to set this to.
346
+ * @noreturn
347
+ */
348
+ native ns_set_points(id, points);
349
+
350
+ /**
351
+ * Adds to the player's points spent count in combat.
352
+ *
353
+ * @param id The player to add this to.
354
+ * @param value The value to add to the points spent.
355
+ * @return The new value of the points spent variable.
356
+ */
357
+ native ns_add_points(id,points);
358
+
359
+ /**
360
+ * Gets the damage for this weapon.
361
+ *
362
+ * @note Use weapon index, not player index!
363
+ * @param idWeapon The entity index of the weapon to check.
364
+ * @return The damage this weapon does.
365
+ */
366
+ native Float:ns_get_weap_dmg(idWeapon);
367
+
368
+ /**
369
+ * Sets the damage for this weapon.
370
+ *
371
+ * @note Use weapon index, not player index!
372
+ * @param idWeapon The entity index of the weapon to set.
373
+ * @param damage The damage to make this weapon cause.
374
+ * @noreturn
375
+ */
376
+ native ns_set_weap_dmg(idWeapon, Float:damage);
377
+
378
+ /**
379
+ * Gets the maximum range for this weapon.
380
+ *
381
+ * @note Use weapon index, not player index!
382
+ * @param idWeapon The entity index of the weapon to check.
383
+ * @return The maximum range this weapon has.
384
+ */
385
+ native Float:ns_get_weap_range(idWeapon);
386
+
387
+ /**
388
+ * Sets the maximum range for this weapon.
389
+ *
390
+ * @note Use weapon index, not player index!
391
+ * @param idWeapon The entity index of the weapon to set.
392
+ * @param range The maximum range this weapon will have.
393
+ * @noreturn
394
+ */
395
+ native ns_set_weap_range(idWeapon, Float:range);
396
+
397
+ /**
398
+ * Gets the weapon's clip ammo.
399
+ *
400
+ * @note Use weapon index, not player index!
401
+ * @param idWeapon The weapon to get the clip ammo from.
402
+ * @return The amount of ammunition in the weapon's clip.
403
+ */
404
+ native ns_get_weap_clip(idWeapon);
405
+
406
+ /**
407
+ * Sets the weapon's ammo in the clip.
408
+ *
409
+ * @note Use weapon index, not player index!
410
+ * @param idWeapon The weapon to set the clip ammo on.
411
+ * @param clipsize The amount of ammunition to set in the weapon's clip.
412
+ * @noreturn
413
+ */
414
+ native ns_set_weap_clip(idWeapon, clipsize);
415
+
416
+ /**
417
+ * Gets the player's weapon reserve (backpack ammo) for the specified
418
+ * type of weapon.
419
+ *
420
+ * @note Use player index, not weapon index!
421
+ * @param id The player id to check ammo count on.
422
+ * @param weapon The weapon type to check ammo count for.
423
+ * @return The ammunition count in the player's reserve.
424
+ */
425
+ native ns_get_weap_reserve(id,weapon);
426
+
427
+ /**
428
+ * Sets the player's weapon reserve (backpack ammo) for the specified
429
+ * type of weapon.
430
+ *
431
+ * @note Use player index, not weapon index!
432
+ * @param id The player id to set ammo count on.
433
+ * @param weapon The weapon type to set ammo count for.
434
+ * @param ammo The ammunition count to set.
435
+ * @noreturn
436
+ */
437
+ native ns_set_weap_reserve(id,weapon,ammo);
438
+
439
+ /**
440
+ * Gets the player's score.
441
+ *
442
+ * @note The score from level is automatically factored into the scoreboard in combat.
443
+ * @param idPlayer The player to get the score for.
444
+ * @return The player's score.
445
+ */
446
+ native ns_get_score(idPlayer);
447
+
448
+ /**
449
+ * Sets the player's score.
450
+ *
451
+ * @note The score from level is automatically factored into the scoreboard in combat.
452
+ * @param idPlayer The player to get the score for.
453
+ * @param score What to set the player's score as.
454
+ * @noreturn
455
+ */
456
+ native ns_set_score(idPlayer, score);
457
+
458
+ /* Adds to a player's score
459
+ * Returns the new score on success
460
+ */
461
+ native ns_add_score(idPlayer,score);
462
+
463
+ /* Gets a player's death count. */
464
+ native ns_get_deaths(idPlayer);
465
+
466
+ /* Sets a player's death count. */
467
+ native ns_set_deaths(idPlayer,numdeaths);
468
+
469
+ /* Adds to a player's death count
470
+ * Returns the new death count on success
471
+ */
472
+ native ns_add_deaths(idPlayer,numdeaths);
473
+
474
+ /* Gets the index of the owner of a structure. -1 for no owner. */
475
+ native ns_get_struct_owner(idStructsure);
476
+
477
+ /* Sets the index of the owner of a structure. -1 for no owner. */
478
+ native ns_set_struct_owner(idStructure,indexOwner);
479
+
480
+ /* Gets the trait type tied to the hive. Look at the hivetrait enum for the values. */
481
+ native ns_get_hive_trait(idHive);
482
+
483
+ /* Sets the trait type tied to the hive. Look at the hivetrait enum for the values. */
484
+ native ns_set_hive_trait(idHive,trait);
485
+
486
+ /* Sets the players field of view, set "_fov" to 0.0 (or omit it) to return to normal. FOV change will persist until disconnect unless reset by a plugin */
487
+ native ns_set_fov(idPlayer,Float:_fov=0.0);
488
+
489
+ /**
490
+ * Give the player an item.
491
+ *
492
+ * @param id The player to give the item to.
493
+ * @param class The map-classname of the entity to give to the player.
494
+ * @noreturn
495
+ */
496
+ native ns_give_item(id, const class[]);
497
+
498
+ /**
499
+ * Returns 1 if a player has the hive ability number.
500
+ * If ability is 0, it will return the number of active hives.
501
+ *
502
+ * @param idPlayer The player index to look up.
503
+ * @param ability The ability number to check, set to 0 to get number of active hives.
504
+ * @return If ability is != 0, returns 1 or 0 depending on if the client has the ability.
505
+ * If ability is 0, returns the number of active hives.
506
+ */
507
+ native ns_get_hive_ability(idPlayer, ability=0);
508
+
509
+ /**
510
+ * Triggered whenever a client's pev->team changes.
511
+ *
512
+ * @param id The id of the client.
513
+ * @param newteam The team number of the new team.
514
+ * @param oldteam The team number of the old team.
515
+ * @noreturn
516
+ */
517
+ forward client_changeteam(id, newteam, oldteam);
518
+
519
+ /**
520
+ * Triggered whenever a client's pev->deadflag changes from >0 to 0.
521
+ *
522
+ * @param id The id of the client.
523
+ * @noreturn
524
+ */
525
+ forward client_spawn(id);
526
+
527
+ /**
528
+ * Calls NS's private damage routine on the victim entity.
529
+ *
530
+ * @deprecated
531
+ * @note This is provided for backwards compatibility with peachy's module.
532
+ * It is suggested to use hamsandwich for this action instead.
533
+ *
534
+ * @param IDVictim The victim that is taking the damage.
535
+ * @param IDInflictor The entity that is causing the damage (weapon, etc).
536
+ * @param IDAttacker The attacker who is triggering the damage (person shooting).
537
+ * @param Damage The amount of damage being done.
538
+ * @param DamageType The damage type being done (bitmask).
539
+ */
540
+ #pragma deprecated It is suggested to use hamsandwich for this action instead.
541
+ native ns_takedamage(IDVictim, IDInflictor, IDAttacker, Float:Damage, DamageType);
542
+
543
+ /**
544
+ * Attempts to unstick a player.
545
+ *
546
+ * @param id Player to unstick.
547
+ * @param StartDistance Distance to start from the player to check for a new location.
548
+ * @param MaxAttempts How many attempts to try to find a new spot before giving up.
549
+ * @return 1 on success, 0 on cannot find a place to move player to,
550
+ * -1 on invalid state (stunned/webbed), -2 on invalid class (comm/egg)
551
+ * -3 if the player is dead or a spectator, -4 on invalid player,
552
+ * -5 if the player is not connected.
553
+ */
554
+ native ns_unstick_player(id, StartDistance=32, MaxAttempts=128);
555
+
556
+ /**
557
+ * Whether or not there is a game in progress.
558
+ *
559
+ * @return true if a game is in progress, false otherwise.
560
+ */
561
+ native bool:ns_round_in_progress();
562
+
563
+ /**
564
+ * Called at the approximate time that a round is started.
565
+ *
566
+ * @noreturn
567
+ */
568
+ forward round_start();
569
+
570
+ /**
571
+ * Called immediately when a round ends
572
+ *
573
+ * @param roundtime The length of the round in seconds.
574
+ * @noreturn
575
+ */
576
+ forward round_end(Float:roundtime);
577
+
578
+ forward map_reset(isload);
579
+
580
+ native ns_get_weapon(idPlayer,weaponid,&weapontype=0);
581
+
582
+ /* Returns the location name of the provided x/y position
583
+ * (z origin is ignored; can't have location over location)
584
+ * -
585
+ * Note that as of NS 3.2 beta 2, on the following maps
586
+ * the returned string should be passed through ns_lookup_title
587
+ * to be human readable:
588
+ * ns_bast, ns_hera, ns_nothing, ns_tanith,
589
+ * ns_nancy, ns_caged, ns_eclipse, ns_veil
590
+ *
591
+ * Passing the 5th parameter as non zero will auto look up
592
+ * the title if it exists.
593
+ */
594
+ native ns_get_locationname(Float:x, Float:y, name[], len, titlelookup=0);
595
+
596
+ /* Looks up a key from titles.txt
597
+ * Returns -1 if the key is not found
598
+ * Otherwise it returns the length of the output
599
+ */
600
+ native ns_lookup_title(const KeyName[], Output[], length);
601
+
602
+ /* Forces the structure to fully build
603
+ * Removes the ghost state from marine structures.
604
+ * Do not use this on hives! It wont work.
605
+ */
606
+ native ns_build_structure(idStructure);
607
+
608
+ /* Forces the structure to begin recycling
609
+ * Passing an index other than a marine structure will
610
+ * have undefined results!
611
+ * -
612
+ * Note: This calls a private NS function!
613
+ * Be careful when using this!
614
+ */
615
+ native ns_recycle(idStructure);
616
+
617
+ /* Forces the weldable to trigger
618
+ * Passing an index other than a weldable
619
+ * will have undefined results!
620
+ * -
621
+ * NS renames func_weldable to avhweldable
622
+ * at map load.
623
+ * -
624
+ * Note: This calls a private NS function!
625
+ * Be careful when using this!
626
+ */
627
+ native ns_finish_weldable(idWeldable);
628
+
629
+ /* Gets the total time needed to weld this
630
+ * func_weldable shut.
631
+ * Note: NS renames "func_weldable"s to "avhweldable"s
632
+ * at run time!
633
+ */
634
+ native Float:ns_get_weld_time(idWeldable);
635
+
636
+ /* Sets the total time needed to weld this
637
+ * func_weldable shut.
638
+ */
639
+ native ns_set_weld_time(idWeldable,Float:value);
640
+
641
+ /* Adds to the weldable's time required to open.
642
+ * Returns the new required time on success.
643
+ * Note this native clamps the low value to 0.
644
+ */
645
+ native Float:ns_add_weld_time(idWeldable,Float:value);
646
+
647
+ /* Gets the total time this func_weldable
648
+ * has been welded.
649
+ */
650
+ native Float:ns_get_weld_done(idWeldable);
651
+
652
+ /* Sets the total time this func_weldable
653
+ * has been welded.
654
+ */
655
+ native ns_set_weld_done(idWeldable,Float:value);
656
+
657
+ /* Adds to the total time this func_weldable
658
+ * has been welded. Returns the new value.
659
+ * Note this native clamps the low value to 0.0
660
+ */
661
+ native Float:ns_add_weld_done(idWeldable,Float:value);
662
+
663
+ /* Gets/sets/adds to the energy pool of this observatory. */
664
+ native Float:ns_get_obs_energy(idObs);
665
+ native ns_set_obs_energy(idObs,Float:value);
666
+ native Float:ns_add_obs_energy(idObs,Float:value);
667
+
668
+ /**
669
+ * Removes an upgrade from the player's bought and active upgrade lists.
670
+ * This will not refund the points spent on the upgrade, nor will it
671
+ * immediately strip the upgrade if the player is alive. Rather, it will
672
+ * make it so the player no longer receives the upgrade on spawn.
673
+ *
674
+ * @note This only works in combat.
675
+ * @params idPlayer The player index to change upgrades for.
676
+ * @params ugprade The impulse number for the upgrade to strip.
677
+ * @return 2 for upgrade removed from player's bought and active list.
678
+ * 1 for upgrade removed from player's bought list only.
679
+ * 3 for upgrade removed from player's active list only (shouldn't happen, just incase.)
680
+ * 0 for the player didn't have the upgrade in either list.
681
+ */
682
+ native ns_remove_upgrade(idPlayer, upgrade);
683
+
684
+ /**
685
+ * Particle system natives
686
+ * -
687
+ * The particle system emulates a map-based custom particle system.
688
+ * Familiarity with the keyvalues from the map-based particle systems
689
+ * is recommended! You will be lost otherwise!
690
+ * -
691
+ * prsearle's NSPEdit is also recommended for designing the systems:
692
+ * http://homepage.ntlworld.com/pr.searle/NSPSEdit/NSPSEdit.html
693
+ */
694
+
695
+ /* Creates a handle to the a particle system to configure
696
+ * -
697
+ * Note! this is not a particle system you can pass to
698
+ * ns_fire_ps()!
699
+ */
700
+ native RawPS:ns_create_ps();
701
+
702
+ /* Sets the name of the particle system.
703
+ * -
704
+ * This is used for things like ns_get_ps_id()
705
+ * and through calling another particle system
706
+ * through the "ps_to_gen" field
707
+ */
708
+ native ns_set_ps_name(RawPS:system, const name[]);
709
+
710
+ /* Sets the sprite to use for the particle system
711
+ * -
712
+ * You do NOT have to precache the sprite, BUT
713
+ * the sprite must obviously be on the client to
714
+ * display.
715
+ */
716
+ native ns_set_ps_sprite(RawPS:system, const sprite[]);
717
+
718
+ /* Finalizes the particle system. Do not configure it after this.
719
+ * A usable particle system handle is returned.
720
+ */
721
+ native Particle:ns_spawn_ps(RawPS:system);
722
+
723
+ /* Draws a particle system at the given origin (and angles)
724
+ * Flags are the FEV_* defines from hlsdk_const.inc
725
+ * Only use handles returned by ns_spawn_ps or ns_get_ps_id here!
726
+ */
727
+ native ns_fire_ps(Particle:system,const Float:origin[3],const Float:angles[3]={0.0,0.0,0.0}, flags=0);
728
+
729
+ /* Looks up a particle system by name
730
+ * Returns a usable particle system handle.
731
+ */
732
+ native Particle:ns_get_ps_id(const Name[]);
733
+
734
+ /* The following are the parameters for configuring the
735
+ * particle system. Look through the fgd and NSPSEdit
736
+ * for details!
737
+ */
738
+ native ns_set_ps_genrate(RawPS:system, genrate);
739
+ native ns_set_ps_genshape(RawPS:system, NSPS_GenShape:genshape);
740
+ native ns_set_ps_genshape_params(RawPS:system, const params[]);
741
+ native ns_set_ps_spriteframes(RawPS:system, spriteframes);
742
+ native ns_set_ps_numparticles(RawPS:system, numparticles);
743
+ native ns_set_ps_size(RawPS:system, Float:size);
744
+ native ns_set_ps_vel_params(RawPS:system, const params[]);
745
+ native ns_set_ps_vel_shape(RawPS:system, NSPS_VelShape:shape);
746
+ native ns_set_ps_sys_life(RawPS:system, Float:lifetime);
747
+ native ns_set_ps_particle_life(RawPS:system, Float:lifetime);
748
+ native ns_set_ps_rendermode(RawPS:system, NSPS_RenderMode:rendermode);
749
+ native ns_set_ps_to_gen(RawPS:system, const name[]);
750
+ native ns_set_ps_anim_speed(RawPS:system, speed);
751
+ native ns_set_ps_spawn_flags(RawPS:system, NSPS_Flags:flags);
752
+ native ns_set_ps_base_color(RawPS:system, const colors[]);
753
+ native ns_set_ps_scale(RawPS:system, Float:scale);
754
+ native ns_set_ps_max_alpha(RawPS:system, Float:maxalpha);