@tlua/gmod 1.0.1

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 (278) hide show
  1. package/README.md +28 -0
  2. package/__metadata.json +4 -0
  3. package/_globals.d.tlua +178 -0
  4. package/_gmod-std.d.tlua +35 -0
  5. package/achievementicon.d.tlua +12 -0
  6. package/achievements.d.tlua +162 -0
  7. package/ai.d.tlua +65 -0
  8. package/ai_schedule.d.tlua +17 -0
  9. package/ai_task.d.tlua +17 -0
  10. package/angle.d.tlua +197 -0
  11. package/avatarimage.d.tlua +10 -0
  12. package/awesomium.d.tlua +14 -0
  13. package/baseclass.d.tlua +42 -0
  14. package/bf_read.d.tlua +110 -0
  15. package/bit.d.tlua +121 -0
  16. package/button.d.tlua +13 -0
  17. package/cam.d.tlua +220 -0
  18. package/ceffectdata.d.tlua +337 -0
  19. package/chat.d.tlua +62 -0
  20. package/checkbutton.d.tlua +14 -0
  21. package/cleanup.d.tlua +88 -0
  22. package/cluaemitter.d.tlua +119 -0
  23. package/clualocomotion.d.tlua +383 -0
  24. package/cluaparticle.d.tlua +426 -0
  25. package/cmovedata.d.tlua +476 -0
  26. package/cnavarea.d.tlua +845 -0
  27. package/cnavladder.d.tlua +209 -0
  28. package/cnewparticleeffect.d.tlua +259 -0
  29. package/color.d.tlua +339 -0
  30. package/concommand.d.tlua +69 -0
  31. package/constraint.d.tlua +311 -0
  32. package/construct.d.tlua +26 -0
  33. package/contentheader.d.tlua +32 -0
  34. package/contenticon.d.tlua +86 -0
  35. package/contentsidebar.d.tlua +45 -0
  36. package/contentsidebartoolbox.d.tlua +13 -0
  37. package/contextbase.d.tlua +37 -0
  38. package/controlpanel.d.tlua +140 -0
  39. package/controlpresets.d.tlua +118 -0
  40. package/convar.d.tlua +162 -0
  41. package/cookie.d.tlua +60 -0
  42. package/coroutine.d.tlua +90 -0
  43. package/crecipientfilter.d.tlua +152 -0
  44. package/csent.d.tlua +10 -0
  45. package/csoundpatch.d.tlua +150 -0
  46. package/ctakedamageinfo.d.tlua +366 -0
  47. package/ctrllistbox.d.tlua +12 -0
  48. package/ctrlnumpad.d.tlua +73 -0
  49. package/cusercmd.d.tlua +320 -0
  50. package/custom_classes.d.tlua +65 -0
  51. package/custom_entity_fields.d.tlua +96 -0
  52. package/cvars.d.tlua +80 -0
  53. package/dadjustablemodelpanel.d.tlua +81 -0
  54. package/dalphabar.d.tlua +27 -0
  55. package/dbinder.d.tlua +37 -0
  56. package/dbubblecontainer.d.tlua +18 -0
  57. package/dbutton.d.tlua +88 -0
  58. package/dcategoryheader.d.tlua +13 -0
  59. package/dcategorylist.d.tlua +11 -0
  60. package/dcheckbox.d.tlua +46 -0
  61. package/dcheckboxlabel.d.tlua +90 -0
  62. package/dcollapsiblecategory.d.tlua +240 -0
  63. package/dcolorbutton.d.tlua +73 -0
  64. package/dcolorcombo.d.tlua +54 -0
  65. package/dcolorcube.d.tlua +137 -0
  66. package/dcolormixer.d.tlua +303 -0
  67. package/dcolorpalette.d.tlua +294 -0
  68. package/dcolumnsheet.d.tlua +49 -0
  69. package/dcombobox.d.tlua +161 -0
  70. package/ddragbase.d.tlua +151 -0
  71. package/ddrawer.d.tlua +72 -0
  72. package/debug.d.tlua +236 -0
  73. package/debugoverlay.d.tlua +193 -0
  74. package/dentityproperties.d.tlua +63 -0
  75. package/derma.d.tlua +119 -0
  76. package/dexpandbutton.d.tlua +30 -0
  77. package/dfilebrowser.d.tlua +228 -0
  78. package/dform.d.tlua +176 -0
  79. package/dframe.d.tlua +261 -0
  80. package/dgrid.d.tlua +113 -0
  81. package/dhorizontaldivider.d.tlua +196 -0
  82. package/dhorizontalscroller.d.tlua +104 -0
  83. package/dhscrollbar.d.tlua +109 -0
  84. package/dhtml.d.tlua +91 -0
  85. package/dhtmlcontrols.d.tlua +62 -0
  86. package/diconbrowser.d.tlua +113 -0
  87. package/diconlayout.d.tlua +190 -0
  88. package/dimage.d.tlua +221 -0
  89. package/dimagebutton.d.tlua +103 -0
  90. package/dkillicon.d.tlua +9 -0
  91. package/dlabel.d.tlua +385 -0
  92. package/dlabeleditable.d.tlua +51 -0
  93. package/dlabelurl.d.tlua +100 -0
  94. package/dlistbox.d.tlua +82 -0
  95. package/dlistboxitem.d.tlua +42 -0
  96. package/dlistlayout.d.tlua +14 -0
  97. package/dlistview.d.tlua +360 -0
  98. package/dlistview_column.d.tlua +135 -0
  99. package/dlistview_columnplain.d.tlua +11 -0
  100. package/dlistview_draggerbar.d.tlua +11 -0
  101. package/dlistview_line.d.tlua +140 -0
  102. package/dlistviewheaderlabel.d.tlua +11 -0
  103. package/dlistviewlabel.d.tlua +11 -0
  104. package/dlistviewline.d.tlua +11 -0
  105. package/dmenu.d.tlua +266 -0
  106. package/dmenubar.d.tlua +42 -0
  107. package/dmenuoption.d.tlua +135 -0
  108. package/dmenuoptioncvar.d.tlua +64 -0
  109. package/dmodelpanel.d.tlua +207 -0
  110. package/dmodelselect.d.tlua +20 -0
  111. package/dmodelselectmulti.d.tlua +19 -0
  112. package/dnotify.d.tlua +93 -0
  113. package/dnumberscratch.d.tlua +284 -0
  114. package/dnumberwang.d.tlua +147 -0
  115. package/dnumpad.d.tlua +11 -0
  116. package/dnumslider.d.tlua +182 -0
  117. package/dpanel.d.tlua +152 -0
  118. package/dpanellist.d.tlua +109 -0
  119. package/dpaneloverlay.d.tlua +65 -0
  120. package/dpanelselect.d.tlua +13 -0
  121. package/dpanpanel.d.tlua +64 -0
  122. package/dprogress.d.tlua +27 -0
  123. package/dproperties.d.tlua +52 -0
  124. package/dproperty_boolean.d.tlua +12 -0
  125. package/dproperty_combo.d.tlua +31 -0
  126. package/dproperty_entity.d.tlua +12 -0
  127. package/dproperty_float.d.tlua +12 -0
  128. package/dproperty_generic.d.tlua +50 -0
  129. package/dproperty_int.d.tlua +12 -0
  130. package/dproperty_vectorcolor.d.tlua +14 -0
  131. package/dpropertysheet.d.tlua +167 -0
  132. package/dragndrop.d.tlua +123 -0
  133. package/draw.d.tlua +162 -0
  134. package/drgbpicker.d.tlua +49 -0
  135. package/drive.d.tlua +159 -0
  136. package/dscrollbargrip.d.tlua +13 -0
  137. package/dscrollpanel.d.tlua +110 -0
  138. package/dshape.d.tlua +72 -0
  139. package/dsizetocontents.d.tlua +46 -0
  140. package/dslider.d.tlua +302 -0
  141. package/dsprite.d.tlua +84 -0
  142. package/dtab.d.tlua +81 -0
  143. package/dtextentry.d.tlua +442 -0
  144. package/dtilelayout.d.tlua +218 -0
  145. package/dtooltip.d.tlua +76 -0
  146. package/dtree.d.tlua +185 -0
  147. package/dtree_node.d.tlua +793 -0
  148. package/dtree_node_button.d.tlua +13 -0
  149. package/duplicator.d.tlua +338 -0
  150. package/dverticaldivider.d.tlua +223 -0
  151. package/dvscrollbar.d.tlua +109 -0
  152. package/editablepanel.d.tlua +10 -0
  153. package/effect.d.tlua +121 -0
  154. package/effects.d.tlua +77 -0
  155. package/engine.d.tlua +248 -0
  156. package/entity.d.tlua +8295 -0
  157. package/ents.d.tlua +267 -0
  158. package/enums.d.tlua +7082 -0
  159. package/file.d.tlua +419 -0
  160. package/file_class.d.tlua +7 -0
  161. package/fingerposer.d.tlua +12 -0
  162. package/fingervar.d.tlua +13 -0
  163. package/frame.d.tlua +11 -0
  164. package/frame_blend.d.tlua +105 -0
  165. package/game.d.tlua +482 -0
  166. package/gameevent.d.tlua +968 -0
  167. package/gamemode.d.tlua +48 -0
  168. package/global.d.tlua +3156 -0
  169. package/gm.d.tlua +3218 -0
  170. package/gmod.d.tlua +20 -0
  171. package/gmsave.d.tlua +53 -0
  172. package/gui.d.tlua +232 -0
  173. package/gwen.d.tlua +55 -0
  174. package/halo.d.tlua +42 -0
  175. package/hammer.d.tlua +17 -0
  176. package/hook.d.tlua +64 -0
  177. package/html.d.tlua +22 -0
  178. package/http.d.tlua +72 -0
  179. package/iconeditor.d.tlua +130 -0
  180. package/igmodaudiochannel.d.tlua +419 -0
  181. package/imagecheckbox.d.tlua +48 -0
  182. package/imaterial.d.tlua +288 -0
  183. package/imesh.d.tlua +70 -0
  184. package/index.d.tlua +277 -0
  185. package/input.d.tlua +252 -0
  186. package/invalidateinternalentitycache.d.tlua +13 -0
  187. package/irestore.d.tlua +94 -0
  188. package/isave.d.tlua +94 -0
  189. package/itexture.d.tlua +108 -0
  190. package/ivideowriter.d.tlua +53 -0
  191. package/jit.d.tlua +243 -0
  192. package/killicon.d.tlua +84 -0
  193. package/label.d.tlua +20 -0
  194. package/language.d.tlua +26 -0
  195. package/list.d.tlua +112 -0
  196. package/makeballoon.d.tlua +15 -0
  197. package/markup.d.tlua +38 -0
  198. package/markupobject.d.tlua +53 -0
  199. package/material.d.tlua +9 -0
  200. package/math.d.tlua +899 -0
  201. package/matproxy.d.tlua +60 -0
  202. package/matselect.d.tlua +106 -0
  203. package/menu.d.tlua +20 -0
  204. package/menubar.d.tlua +39 -0
  205. package/mesh.d.tlua +183 -0
  206. package/modelimage.d.tlua +12 -0
  207. package/motionsensor.d.tlua +115 -0
  208. package/navmesh.d.tlua +274 -0
  209. package/net.d.tlua +639 -0
  210. package/nextbot.d.tlua +380 -0
  211. package/notification.d.tlua +35 -0
  212. package/npc.d.tlua +1787 -0
  213. package/numpad.d.tlua +89 -0
  214. package/os.d.tlua +56 -0
  215. package/package.d.tlua +15 -0
  216. package/package.json +18 -0
  217. package/panel.d.tlua +3650 -0
  218. package/panellist.d.tlua +13 -0
  219. package/pathfollower.d.tlua +301 -0
  220. package/permissions.d.tlua +77 -0
  221. package/physcollide.d.tlua +40 -0
  222. package/physenv.d.tlua +136 -0
  223. package/physobj.d.tlua +799 -0
  224. package/pixelvis_handle_t.d.tlua +9 -0
  225. package/player.d.tlua +3320 -0
  226. package/player_manager.d.tlua +147 -0
  227. package/preseteditor.d.tlua +13 -0
  228. package/presets.d.tlua +79 -0
  229. package/projectedtexture.d.tlua +553 -0
  230. package/properties.d.tlua +65 -0
  231. package/propselect.d.tlua +50 -0
  232. package/radiobutton.d.tlua +13 -0
  233. package/render.d.tlua +1700 -0
  234. package/resource.d.tlua +73 -0
  235. package/richtext.d.tlua +17 -0
  236. package/sandbox.d.tlua +576 -0
  237. package/saverestore.d.tlua +148 -0
  238. package/schedule.d.tlua +69 -0
  239. package/scripted_ents.d.tlua +124 -0
  240. package/search.d.tlua +26 -0
  241. package/serverlist.d.tlua +85 -0
  242. package/slidebar.d.tlua +12 -0
  243. package/slider.d.tlua +11 -0
  244. package/sound.d.tlua +140 -0
  245. package/spawnicon.d.tlua +95 -0
  246. package/spawnmenu.d.tlua +286 -0
  247. package/spawnmenucontentpanel.d.tlua +52 -0
  248. package/sql.d.tlua +154 -0
  249. package/stack.d.tlua +57 -0
  250. package/steamworks.d.tlua +208 -0
  251. package/string.d.tlua +535 -0
  252. package/structures.d.tlua +4442 -0
  253. package/surface.d.tlua +463 -0
  254. package/surfaceinfo.d.tlua +70 -0
  255. package/system.d.tlua +134 -0
  256. package/table.d.tlua +533 -0
  257. package/task.d.tlua +92 -0
  258. package/team.d.tlua +195 -0
  259. package/textentry.d.tlua +12 -0
  260. package/tgaimage.d.tlua +11 -0
  261. package/timer.d.tlua +198 -0
  262. package/tool.d.tlua +466 -0
  263. package/ugcpublishwindow.d.tlua +83 -0
  264. package/umsg.d.tlua +147 -0
  265. package/undo.d.tlua +122 -0
  266. package/urllabel.d.tlua +13 -0
  267. package/usermessage.d.tlua +48 -0
  268. package/utf8.d.tlua +89 -0
  269. package/util.d.tlua +1087 -0
  270. package/vector.d.tlua +413 -0
  271. package/vehicle.d.tlua +472 -0
  272. package/vgui.d.tlua +201 -0
  273. package/video.d.tlua +17 -0
  274. package/vmatrix.d.tlua +392 -0
  275. package/weapon.d.tlua +913 -0
  276. package/weapons.d.tlua +90 -0
  277. package/widgets.d.tlua +29 -0
  278. package/workshopfilebase.d.tlua +68 -0
@@ -0,0 +1,968 @@
1
+ // AUTO-GENERATED tlua declarations. Do not edit by hand.
2
+
3
+ /**
4
+ * Used to interface with the built-in game events system.
5
+ *
6
+ * **NOTE**: All Serverside gameevents are networked and called clientside. It could happen that a gameevent is called twice because of this like [OnRequestFullUpdate](https://wiki.facepunch.com/gmod/gameevent/OnRequestFullUpdate).
7
+ *
8
+ *
9
+ * The following is a list of all available game events.
10
+ *
11
+ *
12
+ * @source https://wiki.facepunch.com/gmod/gameevent
13
+ */
14
+ declare gameevent: GameeventLib;
15
+
16
+ /**
17
+ * Called when a player requests a full update from the server.
18
+ * Called Clientside when the Update is received or when another player requested a full update.
19
+ *
20
+ * **NOTE**: When this event is called the first time for a client, [net](https://wiki.facepunch.com/gmod/net) messages will be reliably received by the client.
21
+ * This gameevent is called twice for the player, because it is first called serverside and networked, but then also called clientside.
22
+ *
23
+ *
24
+ *
25
+ * If `sv_parallel_sendsnapshot` is enabled, then this gameevent **won't** be called reliably since currently gmod discards of gameevents from other threads.
26
+ *
27
+ *
28
+ * @realm shared and menu
29
+ * @source https://wiki.facepunch.com/gmod/gameevent/OnRequestFullUpdate
30
+ */
31
+ interface OnRequestFullUpdate {
32
+ /**
33
+ * The SteamID the player has. Will be `BOT` for bots and `STEAM_0:0:0` in single-player.
34
+ */
35
+ networkid: string;
36
+ /**
37
+ * The Player:Nick the player has.
38
+ */
39
+ name: string;
40
+ /**
41
+ * The Player:UserID the player has.
42
+ */
43
+ userid: number;
44
+ /**
45
+ * The Entity:EntIndex of the player, minus one.
46
+ */
47
+ index: number;
48
+ }
49
+
50
+ /**
51
+ * Called when a player earns an achievement.
52
+ *
53
+ * @realm shared and menu
54
+ * @source https://wiki.facepunch.com/gmod/gameevent/achievement_earned
55
+ */
56
+ interface achievement_earned {
57
+ /**
58
+ * The achievement ID.
59
+ */
60
+ achievement: number;
61
+ /**
62
+ * The Player:UserID of the player.
63
+ */
64
+ player: number;
65
+ }
66
+
67
+ /**
68
+ * Called when a player makes progress on an achievement.
69
+ *
70
+ * **NOTE**: Only called clientside for the player who made progress.
71
+ *
72
+ *
73
+ * @realm client and menu
74
+ * @source https://wiki.facepunch.com/gmod/gameevent/achievement_event
75
+ */
76
+ interface achievement_event {
77
+ /**
78
+ * the name of the achievement.
79
+ */
80
+ achievement_name: string;
81
+ /**
82
+ * amount of steps toward achievement.
83
+ */
84
+ cur_val: number;
85
+ /**
86
+ * total amount of steps in achievement.
87
+ */
88
+ max_val: number;
89
+ }
90
+
91
+ /**
92
+ * Called when a func_break is broken by a player.
93
+ *
94
+ * @realm shared and menu
95
+ * @source https://wiki.facepunch.com/gmod/gameevent/break_breakable
96
+ */
97
+ interface break_breakable {
98
+ /**
99
+ * The Entity:EntIndex of the broken prop.
100
+ */
101
+ entindex: number;
102
+ /**
103
+ * The Player:UserID of the connected player.
104
+ */
105
+ userid: number;
106
+ /**
107
+ * Material index of the broken entity.
108
+ */
109
+ material: number;
110
+ }
111
+
112
+ /**
113
+ * Called when a prop_dynamic or prop_physics is broken by a player.
114
+ *
115
+ * @realm shared and menu
116
+ * @source https://wiki.facepunch.com/gmod/gameevent/break_prop
117
+ */
118
+ interface break_prop {
119
+ /**
120
+ * The Entity:EntIndex of the broken prop.
121
+ */
122
+ entindex: number;
123
+ /**
124
+ * The Player:UserID of the connected player. Seems to be 0 every time.
125
+ */
126
+ userid: number;
127
+ }
128
+
129
+ /**
130
+ * Called when trying to connect to a Server.
131
+ *
132
+ * **NOTE**: This is only available in the Menu state because this is called before the Client State has even started.
133
+ * When this is event is called, it will reset [engine.TickCount](https://wiki.facepunch.com/gmod/engine.TickCount) back to **1**.
134
+ *
135
+ *
136
+ * @realm menu
137
+ * @source https://wiki.facepunch.com/gmod/gameevent/client_beginconnect
138
+ */
139
+ interface client_beginconnect {
140
+ /**
141
+ * The Server address. Will be `localhost:27015` in hosted games.
142
+ */
143
+ address: string;
144
+ /**
145
+ * The IP of the Server. Will be `16777343` in hosted games. Use the `address` instead of this.
146
+ */
147
+ ip: number;
148
+ /**
149
+ * The port of the Server. Will be `27015` in hosted games.
150
+ */
151
+ port: number;
152
+ /**
153
+ * The Source why the client is trying to connect to the Server.
154
+ * If you use `connect [IP:Port]` to connect to a Server, this will be an empty string.
155
+ */
156
+ source: string;
157
+ }
158
+
159
+ /**
160
+ * Called when the connection to a Server has been established.
161
+ *
162
+ * **NOTE**: This is only available in the Menu state because this is called before the Client State has even started.
163
+ *
164
+ *
165
+ * @realm menu
166
+ * @source https://wiki.facepunch.com/gmod/gameevent/client_connected
167
+ */
168
+ interface client_connected {
169
+ /**
170
+ * The Server address. Will be **loopback** in hosted games.
171
+ */
172
+ address: string;
173
+ /**
174
+ * The IP of the Server. Will be **0** in hosted games. Use the **address** instead of this.
175
+ */
176
+ ip: number;
177
+ /**
178
+ * The port of the Server. Will be **0** in hosted games.
179
+ */
180
+ port: number;
181
+ }
182
+
183
+ /**
184
+ * Called when the client is disconnecting from the server.
185
+ *
186
+ * **NOTE**: Only called clientside for the disconnecting Player.
187
+ * message - will be an empty String if the client intentionally disconnects from the server.
188
+ * This is called multiple times in the **Menu state** when connecting to a server.
189
+ *
190
+ *
191
+ * @realm client and menu
192
+ * @source https://wiki.facepunch.com/gmod/gameevent/client_disconnect
193
+ */
194
+ interface client_disconnect {
195
+ /**
196
+ * The disconnecting reason. Can be an empty String.
197
+ */
198
+ message: string;
199
+ }
200
+
201
+ /**
202
+ * Called when an entity dies.
203
+ *
204
+ * **NOTE**: This is not called when a player dies using [Player:KillSilent](https://wiki.facepunch.com/gmod/Player:KillSilent).
205
+ *
206
+ *
207
+ * @realm shared and menu
208
+ * @source https://wiki.facepunch.com/gmod/gameevent/entity_killed
209
+ */
210
+ interface entity_killed {
211
+ /**
212
+ * The Entity:EntIndex of the inflictor.
213
+ */
214
+ entindex_inflictor: number;
215
+ /**
216
+ * The Entity:EntIndex of the attacker.
217
+ */
218
+ entindex_attacker: number;
219
+ /**
220
+ * Damage type(s), a combination of Enums/DMG.
221
+ */
222
+ damagebits: number;
223
+ /**
224
+ * The Entity:EntIndex of the victim.
225
+ */
226
+ entindex_killed: number;
227
+ }
228
+
229
+ /**
230
+ * Called when a flare sets an NPC on fire.
231
+ *
232
+ * @realm shared and menu
233
+ * @source https://wiki.facepunch.com/gmod/gameevent/flare_ignite_npc
234
+ */
235
+ interface flare_ignite_npc {
236
+ /**
237
+ * The Entity:EntIndex of the ignited NPC.
238
+ */
239
+ entindex: number;
240
+ }
241
+
242
+ /**
243
+ * Called when the freeze cam starts spectating something.
244
+ * Example cause:
245
+ * ```
246
+ * local ply = Entity( 1 )
247
+ * ply:Spectate( OBS_MODE_FREEZECAM )
248
+ *
249
+ * ply:SpectateEntity( ply )
250
+ * ```
251
+ *
252
+ * @realm client and menu
253
+ * @source https://wiki.facepunch.com/gmod/gameevent/freezecam_started
254
+ */
255
+ interface freezecam_started {
256
+ }
257
+
258
+ /**
259
+ * Called when a map is loaded.
260
+ *
261
+ * **NOTE**: This is only available in the Menu state because this is called before the Client State has even started.
262
+ *
263
+ *
264
+ * @realm menu
265
+ * @source https://wiki.facepunch.com/gmod/gameevent/game_newmap
266
+ */
267
+ interface game_newmap {
268
+ /**
269
+ * The Map name.
270
+ */
271
+ mapname: string;
272
+ }
273
+
274
+ /**
275
+ * Called when the freeze cam is finished.
276
+ * Example cause:
277
+ * ```
278
+ * local ply = Entity( 1 )
279
+ * ply:Spectate( OBS_MODE_FREEZECAM )
280
+ *
281
+ * timer.Simple( 1, function()
282
+ * ply:UnSpectate()
283
+ * end )
284
+ * ```
285
+ *
286
+ * @realm client and menu
287
+ * @source https://wiki.facepunch.com/gmod/gameevent/hide_freezepanel
288
+ */
289
+ interface hide_freezepanel {
290
+ }
291
+
292
+ /**
293
+ * Called when a Client becomes the Cameraman.
294
+ *
295
+ * @realm client and menu
296
+ * @source https://wiki.facepunch.com/gmod/gameevent/hltv_cameraman
297
+ */
298
+ interface hltv_cameraman {
299
+ /**
300
+ * The Entity:EntIndex of the new Cameraman.
301
+ */
302
+ index: number;
303
+ }
304
+
305
+ /**
306
+ * Called when the HLTV observer mode changes.
307
+ *
308
+ * @realm client and menu
309
+ * @source https://wiki.facepunch.com/gmod/gameevent/hltv_changed_mode
310
+ */
311
+ interface hltv_changed_mode {
312
+ /**
313
+ * The new Enums/OBS_MODE.
314
+ */
315
+ newmode: number;
316
+ /**
317
+ * The Entity:EntIndex of our Target.
318
+ */
319
+ obs_target: number;
320
+ /**
321
+ * The old Enums/OBS_MODE.
322
+ */
323
+ oldmode: number;
324
+ }
325
+
326
+ /**
327
+ * Called when the HLTV observer target changes.
328
+ *
329
+ * @realm client and menu
330
+ * @source https://wiki.facepunch.com/gmod/gameevent/hltv_changed_target
331
+ */
332
+ interface hltv_changed_target {
333
+ /**
334
+ * The Enums/OBS_MODE.
335
+ */
336
+ mode: number;
337
+ /**
338
+ * The Entity:EntIndex of the new Target.
339
+ */
340
+ obs_target: number;
341
+ /**
342
+ * The Entity:EntIndex of the old Target.
343
+ */
344
+ old_target: number;
345
+ }
346
+
347
+ /**
348
+ * Called when the view changes.
349
+ *
350
+ * @realm client and menu
351
+ * @source https://wiki.facepunch.com/gmod/gameevent/hltv_chase
352
+ */
353
+ interface hltv_chase {
354
+ /**
355
+ * The distance from the Target.
356
+ */
357
+ distance: number;
358
+ /**
359
+ * The inertia.
360
+ */
361
+ inertia: number;
362
+ /**
363
+ * `1` if we should use Enums/OBS_MODE. else, we use Enums/OBS_MODE.
364
+ */
365
+ ineye: number;
366
+ /**
367
+ * The phi.
368
+ */
369
+ phi: number;
370
+ /**
371
+ * The Entity:EntIndex of the Primary target.
372
+ */
373
+ target1: number;
374
+ /**
375
+ * The Entity:EntIndex of the Secondary target.
376
+ */
377
+ target2: number;
378
+ /**
379
+ * The theta.
380
+ */
381
+ theta: number;
382
+ }
383
+
384
+ /**
385
+ * Called when the fixed view changes.
386
+ *
387
+ * @realm client and menu
388
+ * @source https://wiki.facepunch.com/gmod/gameevent/hltv_fixed
389
+ */
390
+ interface hltv_fixed {
391
+ /**
392
+ * The X position.
393
+ */
394
+ posx: number;
395
+ /**
396
+ * The Y position.
397
+ */
398
+ posy: number;
399
+ /**
400
+ * The Z position.
401
+ */
402
+ posz: number;
403
+ /**
404
+ * The phi.
405
+ */
406
+ phi: number;
407
+ /**
408
+ * The Entity:EntIndex of the target.
409
+ */
410
+ target: number;
411
+ /**
412
+ * The theta.
413
+ */
414
+ theta: number;
415
+ /**
416
+ * The FOV.
417
+ */
418
+ fov: number;
419
+ }
420
+
421
+ /**
422
+ * Called when a message is sent with `tv_msg`.
423
+ *
424
+ * @realm client and menu
425
+ * @source https://wiki.facepunch.com/gmod/gameevent/hltv_message
426
+ */
427
+ interface hltv_message {
428
+ /**
429
+ * The Text.
430
+ */
431
+ text: string;
432
+ }
433
+
434
+ /**
435
+ * Called when the HLTV ranks all cameras.
436
+ *
437
+ * @realm server
438
+ * @source https://wiki.facepunch.com/gmod/gameevent/hltv_rank_camera
439
+ */
440
+ interface hltv_rank_camera {
441
+ /**
442
+ * The id of the Camera.
443
+ */
444
+ index: number;
445
+ /**
446
+ * The rank.
447
+ */
448
+ rank: number;
449
+ /**
450
+ * The Entity:EntIndex of the Target.
451
+ */
452
+ target: number;
453
+ }
454
+
455
+ /**
456
+ * Called when the HLTV ranks all players.
457
+ *
458
+ * @realm server
459
+ * @source https://wiki.facepunch.com/gmod/gameevent/hltv_rank_entity
460
+ */
461
+ interface hltv_rank_entity {
462
+ /**
463
+ * The Entity:EntIndex of the Entity.
464
+ */
465
+ index: number;
466
+ /**
467
+ * The rank.
468
+ */
469
+ rank: number;
470
+ /**
471
+ * The Entity:EntIndex of the Target.
472
+ */
473
+ target: number;
474
+ }
475
+
476
+ /**
477
+ * Called when the HLTVServer stats are updated.
478
+ * They should be updated every 8 seconds.
479
+ * All of these stats are global and shared by the master server.
480
+ *
481
+ * @realm shared and menu
482
+ * @source https://wiki.facepunch.com/gmod/gameevent/hltv_status
483
+ */
484
+ interface hltv_status {
485
+ /**
486
+ * The address of the master.
487
+ */
488
+ master: string;
489
+ /**
490
+ * The number of total clients.
491
+ */
492
+ clients: number;
493
+ /**
494
+ * The number of total slots.
495
+ */
496
+ slots: number;
497
+ /**
498
+ * The number of total proxies.
499
+ */
500
+ proxies: number;
501
+ }
502
+
503
+ /**
504
+ * Called when the SourceTV client is spawned.
505
+ *
506
+ * @realm client and menu
507
+ * @source https://wiki.facepunch.com/gmod/gameevent/hltv_title
508
+ */
509
+ interface hltv_title {
510
+ /**
511
+ * The SourceTV Name.
512
+ */
513
+ text: string;
514
+ }
515
+
516
+ /**
517
+ * Called **only** in the specific realm when the game is existing.
518
+ *
519
+ * **NOTE**: This is not called reliable serverside.
520
+ *
521
+ *
522
+ * @realm shared and menu
523
+ * @source https://wiki.facepunch.com/gmod/gameevent/host_quit
524
+ */
525
+ interface host_quit {
526
+ }
527
+
528
+ /**
529
+ * Called when a player has entered the game (connected and loaded).
530
+ * From this point you can use [Global.Player](https://wiki.facepunch.com/gmod/Global.Player)(userid) (serverside or in singleplayer).
531
+ *
532
+ * **NOTE**: This is called almost directly after [GM:PlayerInitialSpawn](https://wiki.facepunch.com/gmod/GM:PlayerInitialSpawn) in the same tick, so you could just use that hook serverside.
533
+ *
534
+ * **WARNING**: Just like [GM:PlayerInitialSpawn](https://wiki.facepunch.com/gmod/GM:PlayerInitialSpawn), players may not have finished loading when its called. See the warning in [GM:PlayerInitialSpawn](https://wiki.facepunch.com/gmod/GM:PlayerInitialSpawn) for more details about possible issues
535
+ *
536
+ *
537
+ * @realm shared and menu
538
+ * @source https://wiki.facepunch.com/gmod/gameevent/player_activate
539
+ */
540
+ interface player_activate {
541
+ /**
542
+ * The Player:UserID of the Player.
543
+ */
544
+ userid: number;
545
+ }
546
+
547
+ /**
548
+ * Called when a player changes their Steam name.
549
+ * **NOTE**: Functions like [Player:Nick](https://wiki.facepunch.com/gmod/Player:Nick) return the old name here.
550
+ *
551
+ *
552
+ * @realm shared and menu
553
+ * @source https://wiki.facepunch.com/gmod/gameevent/player_changename
554
+ */
555
+ interface player_changename {
556
+ /**
557
+ * The Player:UserID of the Player.
558
+ */
559
+ userid: number;
560
+ /**
561
+ * The old Name.
562
+ */
563
+ oldname: string;
564
+ /**
565
+ * The new Name.
566
+ */
567
+ newname: string;
568
+ }
569
+
570
+ /**
571
+ * Called when a player connects to the server.
572
+ *
573
+ * **NOTE**: This is only called serverside AND clientside for the listen server host. In other cases it's called serverside.
574
+ *
575
+ *
576
+ * @realm shared and menu
577
+ * @source https://wiki.facepunch.com/gmod/gameevent/player_connect
578
+ */
579
+ interface player_connect {
580
+ /**
581
+ * 0 if the player isn't a bot, 1 if they are.
582
+ */
583
+ bot: number;
584
+ /**
585
+ * The Player:SteamID the player has.
586
+ * Will be `BOT` for bots, `STEAM_0:0:0` or `STEAM_ID_PENDING` in single-player, and `STEAM_ID_LAN` when using the `-multirun` client option.
587
+ */
588
+ networkid: string;
589
+ /**
590
+ * The Player:Nick the player has.
591
+ */
592
+ name: string;
593
+ /**
594
+ * The Player:UserID the player has.
595
+ */
596
+ userid: number;
597
+ /**
598
+ * The Entity:EntIndex of the player, minus one.
599
+ */
600
+ index: number;
601
+ /**
602
+ * The Player:IPAddress of the connecting player.
603
+ * Will be `none` for bots and `loopback` for listen server and single-player hosts.
604
+ */
605
+ address: string;
606
+ }
607
+
608
+ /**
609
+ * Called when a player connects to the server.
610
+ *
611
+ * **NOTE**: This is not called clientside for the local player or in single-player.
612
+ *
613
+ *
614
+ * @realm shared and menu
615
+ * @source https://wiki.facepunch.com/gmod/gameevent/player_connect_client
616
+ */
617
+ interface player_connect_client {
618
+ /**
619
+ * 0 if the player isn't a bot, 1 if they are.
620
+ */
621
+ bot: number;
622
+ /**
623
+ * The SteamID the player has. Will be `BOT` for bots and `STEAM_0:0:0` in single-player.
624
+ */
625
+ networkid: string;
626
+ /**
627
+ * The Player:Nick the player has.
628
+ */
629
+ name: string;
630
+ /**
631
+ * The Player:UserID the player has.
632
+ */
633
+ userid: number;
634
+ /**
635
+ * The Entity:EntIndex of the player, minus one.
636
+ */
637
+ index: number;
638
+ }
639
+
640
+ /**
641
+ * Called when a player disconnects from the server.
642
+ *
643
+ * **NOTE**: This is also called when a player cancels connecting to the server.
644
+ * This is not called clientside for the local player or in single-player.
645
+ * When this gameevent is called on the client side, the player will be NULL!. so you cannot use `Player(data.userid)`!
646
+ *
647
+ *
648
+ * @realm shared and menu
649
+ * @source https://wiki.facepunch.com/gmod/gameevent/player_disconnect
650
+ */
651
+ interface player_disconnect {
652
+ /**
653
+ * 0 if the player isn't a bot, 1 if they are.
654
+ */
655
+ bot: number;
656
+ /**
657
+ * The SteamID the player has. Will be `BOT` for bots and `STEAM_0:0:0` in single-player.
658
+ */
659
+ networkid: string;
660
+ /**
661
+ * The Player:Nick the player has.
662
+ */
663
+ name: string;
664
+ /**
665
+ * The Player:UserID the player has.
666
+ */
667
+ userid: number;
668
+ /**
669
+ * The disconnect reason.
670
+ */
671
+ reason: string;
672
+ }
673
+
674
+ /**
675
+ * Called when the player takes damage.
676
+ *
677
+ * **NOTE**: This is called after [GM:EntityTakeDamage](https://wiki.facepunch.com/gmod/GM:EntityTakeDamage) so you could just use that hook serverside.
678
+ *
679
+ *
680
+ * @realm shared and menu
681
+ * @source https://wiki.facepunch.com/gmod/gameevent/player_hurt
682
+ */
683
+ interface player_hurt {
684
+ /**
685
+ * The new health after being damaged.
686
+ */
687
+ health: number;
688
+ /**
689
+ * Event priority number used by HLTV.
690
+ */
691
+ priority: number;
692
+ /**
693
+ * The Player:UserID of the victim.
694
+ */
695
+ userid: number;
696
+ /**
697
+ * The Player:UserID of the attacker.
698
+ */
699
+ attacker: number;
700
+ }
701
+
702
+ /**
703
+ * Called when a player's info has changed over the network.
704
+ * When a Client joins the Server, this gameevent is called for each player on the server for the client.
705
+ * So if 32 Players are on the Server, this gameevent is called 32 times on the Client.
706
+ *
707
+ * @realm shared and menu
708
+ * @source https://wiki.facepunch.com/gmod/gameevent/player_info
709
+ */
710
+ interface player_info {
711
+ /**
712
+ * The Player:AccountID of the Player.
713
+ */
714
+ friendsid: number;
715
+ /**
716
+ * The Entity:EntIndex of the Player minus one.
717
+ */
718
+ index: number;
719
+ /**
720
+ * 1 or 0 if it is a bot or not.
721
+ */
722
+ bot: number;
723
+ /**
724
+ * The Player:UserID of the Player.
725
+ */
726
+ userid: number;
727
+ /**
728
+ * The Player:Name of the Player.
729
+ */
730
+ name: string;
731
+ /**
732
+ * The Player:SteamID of the Player.
733
+ */
734
+ networkid: string;
735
+ }
736
+
737
+ /**
738
+ * Called when the player says a message.
739
+ *
740
+ * **NOTE**: This is called after [GM:PlayerSay](https://wiki.facepunch.com/gmod/GM:PlayerSay) so you could just use that hook serverside.
741
+ *
742
+ *
743
+ * @realm shared and menu
744
+ * @source https://wiki.facepunch.com/gmod/gameevent/player_say
745
+ */
746
+ interface player_say {
747
+ /**
748
+ * Event priority number used by HLTV. Hardcoded to be 1.
749
+ */
750
+ priority: number;
751
+ /**
752
+ * The Player:UserID of the Player. For Console the UserID is 0.
753
+ */
754
+ userid: number;
755
+ /**
756
+ * The text that was said.
757
+ */
758
+ text: string;
759
+ /**
760
+ * `1` If it's only for the team, else `0`.
761
+ */
762
+ teamonly: number;
763
+ }
764
+
765
+ /**
766
+ * Called when a player spawns.
767
+ *
768
+ * **NOTE**: This is not called clientside for the local player or in single-player.
769
+ *
770
+ *
771
+ * @realm shared and menu
772
+ * @source https://wiki.facepunch.com/gmod/gameevent/player_spawn
773
+ */
774
+ interface player_spawn {
775
+ /**
776
+ * The Player:UserID the player has.
777
+ */
778
+ userid: number;
779
+ }
780
+
781
+ /**
782
+ * Called when a Ragdoll is going to be Dissolved.
783
+ *
784
+ * @realm shared and menu
785
+ * @source https://wiki.facepunch.com/gmod/gameevent/ragdoll_dissolved
786
+ */
787
+ interface ragdoll_dissolved {
788
+ /**
789
+ * The Entity:EntIndex of the disolved Ragdoll.
790
+ */
791
+ entindex: number;
792
+ }
793
+
794
+ /**
795
+ * Called when a Player is banned using [Player:Ban](https://wiki.facepunch.com/gmod/Player:Ban), **banip** or the **banid** command.
796
+ *
797
+ * **NOTE**: If **banip** was used the networkid will be an empty string.
798
+ * If **banid** was used the ip will be an empty string.
799
+ *
800
+ *
801
+ * @realm shared and menu
802
+ * @source https://wiki.facepunch.com/gmod/gameevent/server_addban
803
+ */
804
+ interface server_addban {
805
+ /**
806
+ * The Player:SteamID the player has. Will be `BOT` for bots and `STEAM_0:0:0` in single-player.
807
+ */
808
+ networkid: string;
809
+ /**
810
+ * The Player:Nick the player has.
811
+ */
812
+ name: string;
813
+ /**
814
+ * The Player:UserID the player has.
815
+ */
816
+ userid: number;
817
+ /**
818
+ * The Player:IPAddress of the player.
819
+ */
820
+ ip: string;
821
+ /**
822
+ * The Duration of the Ban (in minutes).
823
+ */
824
+ duration: string;
825
+ /**
826
+ * The name of the Person who Banned the Player or Console.
827
+ */
828
+ by: string;
829
+ /**
830
+ * whether the player was also kicked.
831
+ */
832
+ kicked: boolean;
833
+ }
834
+
835
+ /**
836
+ * Called when a convar with FCVAR_NOTIFY is changed on the server.
837
+ *
838
+ * @realm shared and menu
839
+ * @source https://wiki.facepunch.com/gmod/gameevent/server_cvar
840
+ */
841
+ interface server_cvar {
842
+ /**
843
+ * The convar name. e.g "sv_cheats".
844
+ */
845
+ cvarname: string;
846
+ /**
847
+ * The new value. Always a string. e.g "1".
848
+ */
849
+ cvarvalue: string;
850
+ }
851
+
852
+ /**
853
+ * Called when a Player is unbanned using the **removeid** or **removeip** command.
854
+ *
855
+ * **NOTE**: If the player was banned using **banip** was used the networkid will be an empty string.
856
+ * If the player was banned using **banid** was used the ip will be an empty string.
857
+ *
858
+ *
859
+ * @realm shared and menu
860
+ * @source https://wiki.facepunch.com/gmod/gameevent/server_removeban
861
+ */
862
+ interface server_removeban {
863
+ /**
864
+ * The Player:SteamID of the banned Player.
865
+ */
866
+ networkid: string;
867
+ /**
868
+ * The Player:IPAddress of the banned Player.
869
+ */
870
+ ip: string;
871
+ /**
872
+ * The Person who unbanned the Player. Can be Console.
873
+ */
874
+ by: string;
875
+ }
876
+
877
+ /**
878
+ * Called when joining a Server or when a Server spawned.
879
+ *
880
+ * **NOTE**: This is only available in the Menu state because this is called before the Client or Server State has even started.
881
+ *
882
+ *
883
+ * @realm menu
884
+ * @source https://wiki.facepunch.com/gmod/gameevent/server_spawn
885
+ */
886
+ interface server_spawn {
887
+ /**
888
+ * The hostname of the Server.
889
+ */
890
+ hostname: string;
891
+ /**
892
+ * The Server address. Will be **loopback** in hosted games.
893
+ */
894
+ address: string;
895
+ /**
896
+ * The IP of the Server. Will be **0** in hosted games. Use the **address** instead of this.
897
+ */
898
+ ip: number;
899
+ /**
900
+ * The port of the Server. Will be **0** in hosted games.
901
+ */
902
+ port: number;
903
+ /**
904
+ * The Game the Server is hosting. Will be **garrysmod**.
905
+ */
906
+ game: string;
907
+ /**
908
+ * The mapname the Server is currently on.
909
+ */
910
+ mapname: string;
911
+ /**
912
+ * The amount of slots the server has.
913
+ */
914
+ maxplayers: number;
915
+ /**
916
+ * The OS of the Server. **W**(WIN32), **L**(LINUX) or **O**(OSX).
917
+ */
918
+ os: string;
919
+ /**
920
+ * true if it's a dedicated server.
921
+ */
922
+ dedicated: boolean;
923
+ /**
924
+ * true if the Server is password protected.
925
+ */
926
+ password: boolean;
927
+ }
928
+
929
+ /**
930
+ * Called when the freeze cam is started.
931
+ * Example cause:
932
+ * ```
933
+ * Player:Spectate(OBS_MODE_FREEZECAM)
934
+ * ```
935
+ *
936
+ * @realm client and menu
937
+ * @source https://wiki.facepunch.com/gmod/gameevent/show_freezepanel
938
+ */
939
+ interface show_freezepanel {
940
+ /**
941
+ * The Index of the Entity that is being spectated or `0`.
942
+ */
943
+ killer: number;
944
+ }
945
+
946
+ /**
947
+ * Called when the Achievement Manager received the steam user stat data.
948
+ * As soon as this is called, all achievement data should be valid.
949
+ * Trying to access any achievement data before this may return in inaccurate data.
950
+ *
951
+ * @realm menu
952
+ * @source https://wiki.facepunch.com/gmod/gameevent/user_data_downloaded
953
+ */
954
+ interface user_data_downloaded {
955
+ }
956
+
957
+ interface GameeventLib {
958
+ /**
959
+ * Adds a [game event](https://wiki.facepunch.com/gmod/gameevent) listener, creating a new hook using the [hook](https://wiki.facepunch.com/gmod/hook) library, which can be listened to via [hook.Add](https://wiki.facepunch.com/gmod/hook.Add) with the given `eventName` as event.
960
+ * **NOTE**: All gameevents are called in the **Menu State**, but if you want to use them you need to use some DLL(like [this](https://github.com/RaphaelIT7/gmod-gameevent) one) or you need to create your own.
961
+ *
962
+ *
963
+ * @realm shared
964
+ * @source https://wiki.facepunch.com/gmod/gameevent.Listen
965
+ */
966
+ Listen(eventName: string): void;
967
+ }
968
+