@tlua/gmod 1.0.3 → 1.0.4

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.
@@ -0,0 +1,2412 @@
1
+ // AUTO-GENERATED tlua declarations.
2
+
3
+ interface HookLib {
4
+ /**
5
+ * Called when a map I/O event occurs.
6
+ *
7
+ * See also [Entity:Fire](https://wiki.facepunch.com/gmod/Entity:Fire) and [Entity:Input](https://wiki.facepunch.com/gmod/Entity:Input) for functions to fire Inputs on entities.
8
+ *
9
+ * @realm server
10
+ * @source https://wiki.facepunch.com/gmod/GM:AcceptInput
11
+ */
12
+ Add(eventName: "AcceptInput", identifier: any, func: (ent: Entity, input: string, activator: Entity, caller: Entity, value: any) => boolean): void;
13
+ /**
14
+ * Adds a death notice entry.
15
+ *
16
+ * @realm client
17
+ * @source https://wiki.facepunch.com/gmod/GM:AddDeathNotice
18
+ */
19
+ Add(eventName: "AddDeathNotice", identifier: any, func: (attacker: string, attackerTeam: number, inflictor: string, victim: string, victimTeam: number) => any): void;
20
+ /**
21
+ * Allows you to adjust the mouse sensitivity.
22
+ * @realm client
23
+ * @source https://wiki.facepunch.com/gmod/GM:AdjustMouseSensitivity
24
+ */
25
+ Add(eventName: "AdjustMouseSensitivity", identifier: any, func: (defaultSensitivity: number, localFOV: number, defaultFOV: number) => number): void;
26
+ /**
27
+ * Called when a player tries to pick up something using the "use" key, return to override.
28
+ *
29
+ * This hook will not be called if `sv_playerpickupallowed` is set to 0.
30
+ *
31
+ * See [GM:GravGunPickupAllowed](https://wiki.facepunch.com/gmod/GM:GravGunPickupAllowed) for the Gravity Gun pickup variant.
32
+ * See [GM:PhysgunPickup](https://wiki.facepunch.com/gmod/GM:PhysgunPickup) for the Physics Gun pickup variant.
33
+ *
34
+ * @realm server
35
+ * @source https://wiki.facepunch.com/gmod/GM:AllowPlayerPickup
36
+ */
37
+ Add(eventName: "AllowPlayerPickup", identifier: any, func: (ply: Player, ent: Entity) => boolean): void;
38
+ /**
39
+ * This hook is used to calculate animations for a player.
40
+ *
41
+ * **WARNING**: This hook must return the same values at the same time on both, client **and** server. On client for players to see the animations, on server for hit detection to work properly.
42
+ *
43
+ *
44
+ * @realm shared
45
+ * @source https://wiki.facepunch.com/gmod/GM:CalcMainActivity
46
+ */
47
+ Add(eventName: "CalcMainActivity", identifier: any, func: (ply: Player, vel: Vector) => (number, number)): void;
48
+ /**
49
+ * Called from [GM:CalcView](https://wiki.facepunch.com/gmod/GM:CalcView) when player is in driving a vehicle.
50
+ *
51
+ * This hook may not be called in gamemodes that override [GM:CalcView](https://wiki.facepunch.com/gmod/GM:CalcView).
52
+ *
53
+ * @realm client
54
+ * @source https://wiki.facepunch.com/gmod/GM:CalcVehicleView
55
+ */
56
+ Add(eventName: "CalcVehicleView", identifier: any, func: (veh: Vehicle, ply: Player, view: CamData) => table): void;
57
+ /**
58
+ * Allows override of the default view.
59
+ * @realm client
60
+ * @source https://wiki.facepunch.com/gmod/GM:CalcView
61
+ */
62
+ Add(eventName: "CalcView", identifier: any, func: (ply: Player, origin: Vector, angles: Angle, fov: number, znear: number, zfar: number) => CamData): void;
63
+ /**
64
+ * Allows overriding the position and angle of the viewmodel.
65
+ * @realm client
66
+ * @source https://wiki.facepunch.com/gmod/GM:CalcViewModelView
67
+ */
68
+ Add(eventName: "CalcViewModelView", identifier: any, func: (wep: Weapon, vm: Entity, oldPos: Vector, oldAng: Angle, pos: Vector, ang: Angle) => (Vector, Angle)): void;
69
+ /**
70
+ * Called whenever a players tries to create an undo.
71
+ * @realm server
72
+ * @source https://wiki.facepunch.com/gmod/GM:CanCreateUndo
73
+ */
74
+ Add(eventName: "CanCreateUndo", identifier: any, func: (ply: Player, undo: Undo) => boolean): void;
75
+ /**
76
+ * Called when a variable is about to be edited on an Entity (called by `Edit Properties...` menu), to determine if the edit should be permitted.
77
+ *
78
+ * See [Editable entities](https://wiki.facepunch.com/gmod/Editable_Entities) for more details about the system.
79
+ *
80
+ * By default, Sandbox will also call [ENTITY:CanEditVariables](https://wiki.facepunch.com/gmod/ENTITY:CanEditVariables) if no hook returns a value.
81
+ *
82
+ * @realm server
83
+ * @source https://wiki.facepunch.com/gmod/GM:CanEditVariable
84
+ */
85
+ Add(eventName: "CanEditVariable", identifier: any, func: (ent: Entity, ply: Player, key: string, value: string, editor: table) => boolean): void;
86
+ /**
87
+ * Determines if the player can exit the vehicle on their own. [Player:ExitVehicle](https://wiki.facepunch.com/gmod/Player:ExitVehicle) will bypass this hook.
88
+ *
89
+ * See [GM:CanPlayerEnterVehicle](https://wiki.facepunch.com/gmod/GM:CanPlayerEnterVehicle) for the opposite hook.
90
+ * See also [GM:PlayerLeaveVehicle](https://wiki.facepunch.com/gmod/GM:PlayerLeaveVehicle) for a hook that will be called whenever a player exits any vehicle for any reason.
91
+ *
92
+ * @realm server
93
+ * @source https://wiki.facepunch.com/gmod/GM:CanExitVehicle
94
+ */
95
+ Add(eventName: "CanExitVehicle", identifier: any, func: (veh: Vehicle, ply: Player) => boolean): void;
96
+ /**
97
+ * Determines whether or not a given player player can enter the given vehicle. [Player:EnterVehicle](https://wiki.facepunch.com/gmod/Player:EnterVehicle) will still call this hook.
98
+ *
99
+ * Called just before [GM:PlayerEnteredVehicle](https://wiki.facepunch.com/gmod/GM:PlayerEnteredVehicle). See also [GM:CanExitVehicle](https://wiki.facepunch.com/gmod/GM:CanExitVehicle).
100
+ *
101
+ * @realm server
102
+ * @source https://wiki.facepunch.com/gmod/GM:CanPlayerEnterVehicle
103
+ */
104
+ Add(eventName: "CanPlayerEnterVehicle", identifier: any, func: (player: Player, vehicle: Vehicle, role: number) => boolean): void;
105
+ /**
106
+ * Determines if the player can kill themselves using the `kill` or `explode` console commands.
107
+ * @realm server
108
+ * @source https://wiki.facepunch.com/gmod/GM:CanPlayerSuicide
109
+ */
110
+ Add(eventName: "CanPlayerSuicide", identifier: any, func: (player: Player) => boolean): void;
111
+ /**
112
+ * Determines if the player can unfreeze the entity.
113
+ * @realm server
114
+ * @source https://wiki.facepunch.com/gmod/GM:CanPlayerUnfreeze
115
+ */
116
+ Add(eventName: "CanPlayerUnfreeze", identifier: any, func: (player: Player, entity: Entity, phys: PhysObj) => boolean): void;
117
+ /**
118
+ * Controls if a [property](https://wiki.facepunch.com/gmod/properties) can be used or not.
119
+ * @realm shared
120
+ * @source https://wiki.facepunch.com/gmod/GM:CanProperty
121
+ */
122
+ Add(eventName: "CanProperty", identifier: any, func: (ply: Player, property: string, ent: Entity) => boolean): void;
123
+ /**
124
+ * Called whenever a players tries to undo.
125
+ * @realm server
126
+ * @source https://wiki.facepunch.com/gmod/GM:CanUndo
127
+ */
128
+ Add(eventName: "CanUndo", identifier: any, func: (ply: Player, undo: Undo) => boolean): void;
129
+ /**
130
+ * Called each frame to record demos to video using [IVideoWriter](https://wiki.facepunch.com/gmod/IVideoWriter).
131
+ *
132
+ * **NOTE**: This hook is called every frame regardless of whether or not a demo is being recorded
133
+ *
134
+ *
135
+ * @realm menu
136
+ * @source https://wiki.facepunch.com/gmod/GM:CaptureVideo
137
+ */
138
+ Add(eventName: "CaptureVideo", identifier: any, func: () => void): void;
139
+ /**
140
+ * Called when a message is printed to the chat box. Note, that this isn't working with player messages even though there are arguments for it.
141
+ *
142
+ * For player messages see [GM:PlayerSay](https://wiki.facepunch.com/gmod/GM:PlayerSay) and [GM:OnPlayerChat](https://wiki.facepunch.com/gmod/GM:OnPlayerChat)
143
+ *
144
+ * @realm client
145
+ * @source https://wiki.facepunch.com/gmod/GM:ChatText
146
+ */
147
+ Add(eventName: "ChatText", identifier: any, func: (index: number, name: string, text: string, type: string) => boolean): void;
148
+ /**
149
+ * Called whenever the content of the user's chat input box is changed.
150
+ * @realm client
151
+ * @source https://wiki.facepunch.com/gmod/GM:ChatTextChanged
152
+ */
153
+ Add(eventName: "ChatTextChanged", identifier: any, func: (text: string) => void): void;
154
+ /**
155
+ * Called when a **non local player** connects to allow the Lua system to check the password.
156
+ *
157
+ * The default behaviour in the base gamemodes emulates what would normally happen. If `sv_password` is set and its value matches the password passed in by the client (via `password` concommand) - then they are allowed to join. If `sv_password` isn't set it lets them in too.
158
+ *
159
+ * @realm server
160
+ * @source https://wiki.facepunch.com/gmod/GM:CheckPassword
161
+ */
162
+ Add(eventName: "CheckPassword", identifier: any, func: (steamID64: string, ipAddress: string, svPassword: string, clPassword: string, name: string) => (boolean, string)): void;
163
+ /**
164
+ * Called when a player's sign on state changes.
165
+ * You cannot get a valid player object from the userID at any point during this hook.
166
+ *
167
+ * @realm shared
168
+ * @source https://wiki.facepunch.com/gmod/GM:ClientSignOnStateChanged
169
+ */
170
+ Add(eventName: "ClientSignOnStateChanged", identifier: any, func: (userID: number, oldState: number, newState: number) => void): void;
171
+ /**
172
+ * Called when derma menus are closed with [Global.CloseDermaMenus](https://wiki.facepunch.com/gmod/Global.CloseDermaMenus).
173
+ * @realm client and menu
174
+ * @source https://wiki.facepunch.com/gmod/GM:CloseDermaMenus
175
+ */
176
+ Add(eventName: "CloseDermaMenus", identifier: any, func: () => void): void;
177
+ /**
178
+ * Called whenever an entity becomes a clientside ragdoll.
179
+ *
180
+ * See [GM:CreateEntityRagdoll](https://wiki.facepunch.com/gmod/GM:CreateEntityRagdoll) for serverside ragdolls.
181
+ *
182
+ * @realm client
183
+ * @source https://wiki.facepunch.com/gmod/GM:CreateClientsideRagdoll
184
+ */
185
+ Add(eventName: "CreateClientsideRagdoll", identifier: any, func: (entity: Entity, ragdoll: Entity) => void): void;
186
+ /**
187
+ * Called when a serverside ragdoll of an entity has been created.
188
+ *
189
+ * See [GM:CreateClientsideRagdoll](https://wiki.facepunch.com/gmod/GM:CreateClientsideRagdoll) for clientside ragdolls.
190
+ *
191
+ * @realm server
192
+ * @source https://wiki.facepunch.com/gmod/GM:CreateEntityRagdoll
193
+ */
194
+ Add(eventName: "CreateEntityRagdoll", identifier: any, func: (owner: Entity, ragdoll: Entity) => void): void;
195
+ /**
196
+ * Allows you to change the players movements before they're sent to the server.
197
+ *
198
+ * See [Game Movement](https://wiki.facepunch.com/gmod/Game_Movement) for an explanation on the move system.
199
+ *
200
+ * **NOTE**: Due to this hook being clientside only, it could be overridden by the user allowing them to completely skip your logic, it is recommended to use [GM:StartCommand](https://wiki.facepunch.com/gmod/GM:StartCommand) in a shared file instead.
201
+ *
202
+ *
203
+ * @realm client
204
+ * @source https://wiki.facepunch.com/gmod/GM:CreateMove
205
+ */
206
+ Add(eventName: "CreateMove", identifier: any, func: (cmd: CUserCmd) => boolean): void;
207
+ /**
208
+ * Teams are created within this hook using [team.SetUp](https://wiki.facepunch.com/gmod/team.SetUp).
209
+ *
210
+ * This hook is called before [GM:PreGamemodeLoaded](https://wiki.facepunch.com/gmod/GM:PreGamemodeLoaded).
211
+ *
212
+ * @realm shared
213
+ * @source https://wiki.facepunch.com/gmod/GM:CreateTeams
214
+ */
215
+ Add(eventName: "CreateTeams", identifier: any, func: () => void): void;
216
+ /**
217
+ * Called upon an animation event, this is the ideal place to call player animation functions such as [Player:AddVCDSequenceToGestureSlot](https://wiki.facepunch.com/gmod/Player:AddVCDSequenceToGestureSlot), [Player:AnimRestartGesture](https://wiki.facepunch.com/gmod/Player:AnimRestartGesture) and so on.
218
+ * @realm shared
219
+ * @source https://wiki.facepunch.com/gmod/GM:DoAnimationEvent
220
+ */
221
+ Add(eventName: "DoAnimationEvent", identifier: any, func: (ply: Player, event: number, data?: number) => number): void;
222
+ /**
223
+ * Handles the player's death.
224
+ *
225
+ * This hook is **not** called if the player is killed by [Player:KillSilent](https://wiki.facepunch.com/gmod/Player:KillSilent). See [GM:PlayerSilentDeath](https://wiki.facepunch.com/gmod/GM:PlayerSilentDeath) for that.
226
+ *
227
+ * * [GM:PlayerDeath](https://wiki.facepunch.com/gmod/GM:PlayerDeath) is called after this hook
228
+ * * [GM:PostPlayerDeath](https://wiki.facepunch.com/gmod/GM:PostPlayerDeath) is called after that
229
+ *
230
+ * **NOTE**: [Player:Alive](https://wiki.facepunch.com/gmod/Player:Alive) will return false in this hook.
231
+ *
232
+ *
233
+ *
234
+ * @realm server
235
+ * @source https://wiki.facepunch.com/gmod/GM:DoPlayerDeath
236
+ */
237
+ Add(eventName: "DoPlayerDeath", identifier: any, func: (ply: Player, attacker: Entity, dmg: CTakeDamageInfo) => void): void;
238
+ /**
239
+ * This hook is called every frame to draw all of the current death notices.
240
+ * @realm client
241
+ * @source https://wiki.facepunch.com/gmod/GM:DrawDeathNotice
242
+ */
243
+ Add(eventName: "DrawDeathNotice", identifier: any, func: (x: number, y: number) => void): void;
244
+ /**
245
+ * Called every frame before drawing the in-game monitors ( Breencast, in-game TVs, etc ), but doesn't seem to be doing anything, trying to render 2D or 3D elements fail.
246
+ * @realm client
247
+ * @source https://wiki.facepunch.com/gmod/GM:DrawMonitors
248
+ */
249
+ Add(eventName: "DrawMonitors", identifier: any, func: () => void): void;
250
+ /**
251
+ * Called after all other 2D draw hooks are called. Draws over all VGUI Panels and HUDs.
252
+ *
253
+ * Unlike [GM:HUDPaint](https://wiki.facepunch.com/gmod/GM:HUDPaint), this hook is called with the game paused and while the Camera SWEP is equipped.
254
+ *
255
+ * Does not get called when `r_drawvgui` is disabled.
256
+ *
257
+ *
258
+ *
259
+ * @realm client and menu
260
+ * @source https://wiki.facepunch.com/gmod/GM:DrawOverlay
261
+ */
262
+ Add(eventName: "DrawOverlay", identifier: any, func: () => void): void;
263
+ /**
264
+ * Allows you to override physgun effects rendering.
265
+ *
266
+ * **NOTE**: This is still called when `physgun_drawbeams` is set to `0`, because this hook is also capable of overriding physgun sprite effects, while the convar does not.
267
+ *
268
+ *
269
+ * @realm client
270
+ * @source https://wiki.facepunch.com/gmod/GM:DrawPhysgunBeam
271
+ */
272
+ Add(eventName: "DrawPhysgunBeam", identifier: any, func: (ply: Player, physgun: Weapon, enabled: boolean, target: Entity, physBone: number, hitPos: Vector) => boolean): void;
273
+ /**
274
+ * Called right before an entity stops driving. Overriding this hook will cause it to not call [drive.End](https://wiki.facepunch.com/gmod/drive.End) and the player will not stop driving.
275
+ * @realm shared
276
+ * @source https://wiki.facepunch.com/gmod/GM:EndEntityDriving
277
+ */
278
+ Add(eventName: "EndEntityDriving", identifier: any, func: (ent: Entity, ply: Player) => void): void;
279
+ /**
280
+ * Called whenever a sound has been played. This will not be called clientside if the server played the sound without the client also calling [Entity:EmitSound](https://wiki.facepunch.com/gmod/Entity:EmitSound).
281
+ *
282
+ * @realm shared
283
+ * @source https://wiki.facepunch.com/gmod/GM:EntityEmitSound
284
+ */
285
+ Add(eventName: "EntityEmitSound", identifier: any, func: (data: EmitSoundInfo) => boolean): void;
286
+ /**
287
+ * Called every time a bullet is about to be fired from an entity, which allows to completely modify the bullet structure before the bullet is actually fired.
288
+ *
289
+ * See [GM:PostEntityFireBullets](https://wiki.facepunch.com/gmod/GM:PostEntityFireBullets) if you wish to hook the final bullet values, such as the aim direction post spread calculations.
290
+ *
291
+ * **WARNING**: This hook is called directly from [Entity:FireBullets](https://wiki.facepunch.com/gmod/Entity:FireBullets). Due to this, you cannot call [Entity:FireBullets](https://wiki.facepunch.com/gmod/Entity:FireBullets) inside this hook or an infinite loop will occur crashing the game.
292
+ *
293
+ *
294
+ * @realm shared
295
+ * @source https://wiki.facepunch.com/gmod/GM:EntityFireBullets
296
+ */
297
+ Add(eventName: "EntityFireBullets", identifier: any, func: (entity: Entity, data: Bullet) => boolean): void;
298
+ /**
299
+ * Called when a key-value pair is set on an entity on map spawn. Is **not** called by [Entity:SetKeyValue](https://wiki.facepunch.com/gmod/Entity:SetKeyValue).
300
+ *
301
+ * See [ENTITY:KeyValue](https://wiki.facepunch.com/gmod/ENTITY:KeyValue) for a [scripted entities](https://wiki.facepunch.com/gmod/scripted_entities) hook, and its scripted weapon alternative: [WEAPON:KeyValue](https://wiki.facepunch.com/gmod/WEAPON:KeyValue).
302
+ *
303
+ * @realm shared
304
+ * @source https://wiki.facepunch.com/gmod/GM:EntityKeyValue
305
+ */
306
+ Add(eventName: "EntityKeyValue", identifier: any, func: (ent: Entity, key: string, value: string) => string): void;
307
+ /**
308
+ * Called when an NW2Var is changed.
309
+ * If a NW2Var is set on an entity that is based on a Lua Entity could result in the NW2Var being mixed up with other ones and being updated multiple times.
310
+ * **NOTE**: This hook is fired before the client value is actually changed. Calling the GetNW2 function for the specified variable name within this hook will return the old value, not the current/updated one.
311
+ *
312
+ * This hook gets called for all NW2Vars on all Entities in a full update. The old value will be nil in this case.
313
+ * If this hook seems to be called for no apparent reason, check if it's caused by a full update.
314
+ *
315
+ *
316
+ * @realm shared
317
+ * @source https://wiki.facepunch.com/gmod/GM:EntityNetworkedVarChanged
318
+ */
319
+ Add(eventName: "EntityNetworkedVarChanged", identifier: any, func: (ent: Entity, name: string, oldval: any, newval: any) => void): void;
320
+ /**
321
+ * Called right before removal of an entity.
322
+ * **WARNING**: This hook is called clientside during full updates due to how networking works in the Source Engine.
323
+ *
324
+ * This can happen when the client briefly loses connection to the server, and can be simulated via `cl_fullupdate` for testing purposes.
325
+ *
326
+ *
327
+ * @realm shared
328
+ * @source https://wiki.facepunch.com/gmod/GM:EntityRemoved
329
+ */
330
+ Add(eventName: "EntityRemoved", identifier: any, func: (ent: Entity, fullUpdate: boolean) => void): void;
331
+ /**
332
+ * Called when an entity is about to take damage. You can modify all parts of the damage info in this hook or completely block the damage event.
333
+ *
334
+ * See [GM:PostEntityTakeDamage](https://wiki.facepunch.com/gmod/GM:PostEntityTakeDamage) if you wish to hook the final damage event.
335
+ *
336
+ * **WARNING**: Applying damage from this hook to the entity taking damage will lead to infinite loop/crash.
337
+ *
338
+ *
339
+ * @realm server
340
+ * @source https://wiki.facepunch.com/gmod/GM:EntityTakeDamage
341
+ */
342
+ Add(eventName: "EntityTakeDamage", identifier: any, func: (target: Entity, dmg: CTakeDamageInfo) => boolean): void;
343
+ /**
344
+ * This hook polls the entity the player use action should be applied to.
345
+ *
346
+ * **NOTE**: The default behavior of this hook is in [CBasePlayer::FindUseEntity](https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/mp/src/game/shared/baseplayer_shared.cpp#L1068-L1270). Despite CBasePlayer::FindUseEntity being defined shared, it is only called serverside in practice, so this hook will be only called serverside, as well. It is possible for modules to call it clientside, so the Lua code should still be treated as shared.
347
+ *
348
+ *
349
+ * @realm shared
350
+ * @source https://wiki.facepunch.com/gmod/GM:FindUseEntity
351
+ */
352
+ Add(eventName: "FindUseEntity", identifier: any, func: (ply: Player, defaultEnt: Entity) => Entity): void;
353
+ /**
354
+ * Runs when user cancels/finishes typing.
355
+ * @realm client
356
+ * @source https://wiki.facepunch.com/gmod/GM:FinishChat
357
+ */
358
+ Add(eventName: "FinishChat", identifier: any, func: () => void): void;
359
+ /**
360
+ * Called after [GM:Move](https://wiki.facepunch.com/gmod/GM:Move), applies all the changes from the [CMoveData](https://wiki.facepunch.com/gmod/CMoveData) to the player.
361
+ *
362
+ * See [Game Movement](https://wiki.facepunch.com/gmod/Game_Movement) for an explanation on the move system.
363
+ *
364
+ * @realm shared
365
+ * @source https://wiki.facepunch.com/gmod/GM:FinishMove
366
+ */
367
+ Add(eventName: "FinishMove", identifier: any, func: (ply: Player, mv: CMoveData) => boolean): void;
368
+ /**
369
+ * Called to allow override of the default Derma skin for all panels.
370
+ *
371
+ * **NOTE**: This hook is only called on Lua start up, changing its value (or adding new hooks) after it has been already called will not have any effect.
372
+ *
373
+ * **NOTE**: You can [Panel:SetSkin](https://wiki.facepunch.com/gmod/Panel:SetSkin) "Default" (or other skins) on the frame/base panel and they will still take priority
374
+ *
375
+ *
376
+ * @realm client
377
+ * @source https://wiki.facepunch.com/gmod/GM:ForceDermaSkin
378
+ */
379
+ Add(eventName: "ForceDermaSkin", identifier: any, func: () => string): void;
380
+ /**
381
+ * Called when game content has been changed, for example an addon or a mountable game was (un)mounted.
382
+ * @realm shared and menu
383
+ * @source https://wiki.facepunch.com/gmod/GM:GameContentChanged
384
+ */
385
+ Add(eventName: "GameContentChanged", identifier: any, func: () => void): void;
386
+ /**
387
+ * An internal function used to get an untranslated string to show in the kill feed as the entity's name. See [GM:SendDeathNotice](https://wiki.facepunch.com/gmod/GM:SendDeathNotice)
388
+ *
389
+ * @realm server
390
+ * @source https://wiki.facepunch.com/gmod/GM:GetDeathNoticeEntityName
391
+ */
392
+ Add(eventName: "GetDeathNoticeEntityName", identifier: any, func: (name: string | Entity) => string): void;
393
+ /**
394
+ * Called when a player takes damage from falling, allows to override the damage.
395
+ * @realm server
396
+ * @source https://wiki.facepunch.com/gmod/GM:GetFallDamage
397
+ */
398
+ Add(eventName: "GetFallDamage", identifier: any, func: (ply: Player, speed: number) => number): void;
399
+ /**
400
+ * Called when the game(server) needs to update the text shown in the server browser as the gamemode. Runs at a ~2s interval, runs even when the server is hibernating.
401
+ *
402
+ * **NOTE**: This hook (and the `sv_gamename_override` command) may not work on some popular gamemodes like DarkRP or Trouble Terrorist Town. This is not a bug, it's just how it works. See [here](https://github.com/Facepunch/garrysmod-issues/issues/4637#issuecomment-677884989) for more information.
403
+ *
404
+ * Also, it **only** works on dedicated servers and is called at regular intervals (about one second) **even** if the server has no players and the hibernation function is enabled.
405
+ *
406
+ *
407
+ * @realm shared
408
+ * @source https://wiki.facepunch.com/gmod/GM:GetGameDescription
409
+ */
410
+ Add(eventName: "GetGameDescription", identifier: any, func: () => string): void;
411
+ /**
412
+ * Allows you to modify the Source Engine's motion blur shaders.
413
+ * @realm client
414
+ * @source https://wiki.facepunch.com/gmod/GM:GetMotionBlurValues
415
+ */
416
+ Add(eventName: "GetMotionBlurValues", identifier: any, func: (horizontal: number, vertical: number, forward: number, rotational: number) => (number, number, number, number)): void;
417
+ /**
418
+ * Called to determine preferred carry angles for the entity. It works for both, +use pickup and gravity gun pickup.
419
+ *
420
+ * **WARNING**: Due to nature of the gravity gun coding in multiplayer, this hook **MAY** seem to not work ( but rest assured it does ), due to clientside prediction not knowing the carry angles. The +use pickup doesn't present this issue as it doesn't predict the player carrying the object clientside ( as you may notice by the prop lagging behind in multiplayer )
421
+ *
422
+ *
423
+ * **NOTE**: This hook can **not** override preferred carry angles of props such as the sawblade and the harpoon.
424
+ *
425
+ *
426
+ * @realm server
427
+ * @source https://wiki.facepunch.com/gmod/GM:GetPreferredCarryAngles
428
+ */
429
+ Add(eventName: "GetPreferredCarryAngles", identifier: any, func: (ent: Entity, ply: Player) => Angle): void;
430
+ /**
431
+ * Returns the color for the given entity's team. This is used in chat and deathnotice text.
432
+ * @realm client
433
+ * @source https://wiki.facepunch.com/gmod/GM:GetTeamColor
434
+ */
435
+ Add(eventName: "GetTeamColor", identifier: any, func: (ent: Entity) => Color): void;
436
+ /**
437
+ * Returns the team color for the given team index.
438
+ * @realm client
439
+ * @source https://wiki.facepunch.com/gmod/GM:GetTeamNumColor
440
+ */
441
+ Add(eventName: "GetTeamNumColor", identifier: any, func: (team: number) => Color): void;
442
+ /**
443
+ * Override this hook to disable/change ear-grabbing in your gamemode. By default, it is not called anywhere on the server.
444
+ * @realm shared
445
+ * @source https://wiki.facepunch.com/gmod/GM:GrabEarAnimation
446
+ */
447
+ Add(eventName: "GrabEarAnimation", identifier: any, func: (ply: Player) => void): void;
448
+ /**
449
+ * Called when an entity is released by a gravity gun.
450
+ *
451
+ * See [GM:PhysgunDrop](https://wiki.facepunch.com/gmod/GM:PhysgunDrop) for the Physics Gun drop variant.
452
+ *
453
+ * @realm server
454
+ * @source https://wiki.facepunch.com/gmod/GM:GravGunOnDropped
455
+ */
456
+ Add(eventName: "GravGunOnDropped", identifier: any, func: (ply: Player, ent: Entity) => void): void;
457
+ /**
458
+ * Called when an entity is picked up by a gravity gun.
459
+ *
460
+ * See [GM:OnPlayerPhysicsPickup](https://wiki.facepunch.com/gmod/GM:OnPlayerPhysicsPickup) for the player `+use` pickup variant.
461
+ * See [GM:OnPhysgunPickup](https://wiki.facepunch.com/gmod/GM:OnPhysgunPickup) for the Physics Gun pickup variant.
462
+ *
463
+ * @realm server
464
+ * @source https://wiki.facepunch.com/gmod/GM:GravGunOnPickedUp
465
+ */
466
+ Add(eventName: "GravGunOnPickedUp", identifier: any, func: (ply: Player, ent: Entity) => void): void;
467
+ /**
468
+ * Called every tick to poll whether a player is allowed to pick up an entity with the gravity gun or not.
469
+ *
470
+ * See [GM:AllowPlayerPickup](https://wiki.facepunch.com/gmod/GM:AllowPlayerPickup) for the +USE pickup variant.
471
+ * See [GM:PhysgunPickup](https://wiki.facepunch.com/gmod/GM:PhysgunPickup) for the Physics Gun pickup variant.
472
+ *
473
+ * Calls [ENTITY:GravGunPickupAllowed](https://wiki.facepunch.com/gmod/ENTITY:GravGunPickupAllowed) on the entity being hovered every frame in Sandbox-derived gamemodes.
474
+ *
475
+ * @realm server
476
+ * @source https://wiki.facepunch.com/gmod/GM:GravGunPickupAllowed
477
+ */
478
+ Add(eventName: "GravGunPickupAllowed", identifier: any, func: (ply: Player, ent: Entity) => boolean): void;
479
+ /**
480
+ * Called when an entity is about to be punted with the gravity gun (primary fire).
481
+ *
482
+ * By default this function makes [ENTITY:GravGunPunt](https://wiki.facepunch.com/gmod/ENTITY:GravGunPunt) work in Sandbox derived gamemodes.
483
+ *
484
+ * @realm shared
485
+ * @source https://wiki.facepunch.com/gmod/GM:GravGunPunt
486
+ */
487
+ Add(eventName: "GravGunPunt", identifier: any, func: (ply: Player, ent: Entity) => boolean): void;
488
+ /**
489
+ * Called when the mouse has been double clicked on any panel derived from CGModBase, such as the panel used by [gui.EnableScreenClicker](https://wiki.facepunch.com/gmod/gui.EnableScreenClicker) and the panel used by [Panel:ParentToHUD](https://wiki.facepunch.com/gmod/Panel:ParentToHUD).
490
+ *
491
+ * By default this hook calls [GM:GUIMousePressed](https://wiki.facepunch.com/gmod/GM:GUIMousePressed).
492
+ *
493
+ * @realm client
494
+ * @source https://wiki.facepunch.com/gmod/GM:GUIMouseDoublePressed
495
+ */
496
+ Add(eventName: "GUIMouseDoublePressed", identifier: any, func: (mouseCode: number, aimVector: Vector) => void): void;
497
+ /**
498
+ * Called whenever a players presses a mouse key on the context menu in Sandbox or on any panel derived from CGModBase, such as the panel used by [gui.EnableScreenClicker](https://wiki.facepunch.com/gmod/gui.EnableScreenClicker) and the panel used by [Panel:ParentToHUD](https://wiki.facepunch.com/gmod/Panel:ParentToHUD).
499
+ *
500
+ * See [GM:VGUIMousePressed](https://wiki.facepunch.com/gmod/GM:VGUIMousePressed) for a hook that is called on all VGUI elements.
501
+ *
502
+ * @realm client
503
+ * @source https://wiki.facepunch.com/gmod/GM:GUIMousePressed
504
+ */
505
+ Add(eventName: "GUIMousePressed", identifier: any, func: (mouseCode: number, aimVector: Vector) => void): void;
506
+ /**
507
+ * Called whenever a players releases a mouse key on the context menu in Sandbox or on any panel derived from CGModBase, such as the panel used by [gui.EnableScreenClicker](https://wiki.facepunch.com/gmod/gui.EnableScreenClicker) and the panel used by [Panel:ParentToHUD](https://wiki.facepunch.com/gmod/Panel:ParentToHUD).
508
+ * @realm client
509
+ * @source https://wiki.facepunch.com/gmod/GM:GUIMouseReleased
510
+ */
511
+ Add(eventName: "GUIMouseReleased", identifier: any, func: (mouseCode: number, aimVector: Vector) => void): void;
512
+ /**
513
+ * Called to handle player armor reduction, when player receives damage.
514
+ *
515
+ * Clarify hook order with other damage hooks.
516
+ *
517
+ * @realm server
518
+ * @source https://wiki.facepunch.com/gmod/GM:HandlePlayerArmorReduction
519
+ */
520
+ Add(eventName: "HandlePlayerArmorReduction", identifier: any, func: (ply: Player, dmginfo: CTakeDamageInfo) => void): void;
521
+ /**
522
+ * Allows to override player driving animations.
523
+ * @realm shared
524
+ * @source https://wiki.facepunch.com/gmod/GM:HandlePlayerDriving
525
+ */
526
+ Add(eventName: "HandlePlayerDriving", identifier: any, func: (ply: Player) => boolean): void;
527
+ /**
528
+ * Allows to override player crouch animations.
529
+ * @realm shared
530
+ * @source https://wiki.facepunch.com/gmod/GM:HandlePlayerDucking
531
+ */
532
+ Add(eventName: "HandlePlayerDucking", identifier: any, func: (ply: Player, velocity: Vector) => boolean): void;
533
+ /**
534
+ * Called every frame by the player model animation system. Allows to override player jumping animations.
535
+ * @realm shared
536
+ * @source https://wiki.facepunch.com/gmod/GM:HandlePlayerJumping
537
+ */
538
+ Add(eventName: "HandlePlayerJumping", identifier: any, func: (ply: Player, velocity: Vector) => boolean): void;
539
+ /**
540
+ * Called every frame by the player model animation system. Allows to override player landing animations.
541
+ * @realm shared
542
+ * @source https://wiki.facepunch.com/gmod/GM:HandlePlayerLanding
543
+ */
544
+ Add(eventName: "HandlePlayerLanding", identifier: any, func: (ply: Player, velocity: Vector, onGround: boolean) => boolean): void;
545
+ /**
546
+ * Allows to override player noclip animations.
547
+ * @realm shared
548
+ * @source https://wiki.facepunch.com/gmod/GM:HandlePlayerNoClipping
549
+ */
550
+ Add(eventName: "HandlePlayerNoClipping", identifier: any, func: (ply: Player, velocity: Vector) => boolean): void;
551
+ /**
552
+ * Allows to override player swimming animations.
553
+ * @realm shared
554
+ * @source https://wiki.facepunch.com/gmod/GM:HandlePlayerSwimming
555
+ */
556
+ Add(eventName: "HandlePlayerSwimming", identifier: any, func: (ply: Player, velocity: Vector) => boolean): void;
557
+ /**
558
+ * Allows to override player flying ( in mid-air, not noclipping ) animations.
559
+ * @realm shared
560
+ * @source https://wiki.facepunch.com/gmod/GM:HandlePlayerVaulting
561
+ */
562
+ Add(eventName: "HandlePlayerVaulting", identifier: any, func: (ply: Player, velocity: Vector) => boolean): void;
563
+ /**
564
+ * Hides the team selection panel.
565
+ * @realm client
566
+ * @source https://wiki.facepunch.com/gmod/GM:HideTeam
567
+ */
568
+ Add(eventName: "HideTeam", identifier: any, func: () => void): void;
569
+ /**
570
+ * Called when the client has picked up ammo. Override to disable default HUD notification.
571
+ * @realm client
572
+ * @source https://wiki.facepunch.com/gmod/GM:HUDAmmoPickedUp
573
+ */
574
+ Add(eventName: "HUDAmmoPickedUp", identifier: any, func: (itemName: string, amount: number) => void): void;
575
+ /**
576
+ * Renders the HUD pick-up history. Override to hide default or draw your own HUD.
577
+ * @realm client
578
+ * @source https://wiki.facepunch.com/gmod/GM:HUDDrawPickupHistory
579
+ */
580
+ Add(eventName: "HUDDrawPickupHistory", identifier: any, func: () => void): void;
581
+ /**
582
+ * Called every frame to render the scoreboard.
583
+ *
584
+ *
585
+ * It is recommended to use Derma and VGUI for this job instead of this hook. Called right after [GM:HUDPaint](https://wiki.facepunch.com/gmod/GM:HUDPaint).
586
+ *
587
+ *
588
+ *
589
+ * @realm client
590
+ * @source https://wiki.facepunch.com/gmod/GM:HUDDrawScoreBoard
591
+ */
592
+ Add(eventName: "HUDDrawScoreBoard", identifier: any, func: () => void): void;
593
+ /**
594
+ * Called from [GM:HUDPaint](https://wiki.facepunch.com/gmod/GM:HUDPaint) to draw player info when you hover over a player with your crosshair or mouse.
595
+ * @realm client
596
+ * @source https://wiki.facepunch.com/gmod/GM:HUDDrawTargetID
597
+ */
598
+ Add(eventName: "HUDDrawTargetID", identifier: any, func: () => boolean): void;
599
+ /**
600
+ * Called when an item has been picked up. Override to disable the default HUD notification.
601
+ * @realm client
602
+ * @source https://wiki.facepunch.com/gmod/GM:HUDItemPickedUp
603
+ */
604
+ Add(eventName: "HUDItemPickedUp", identifier: any, func: (itemName: string) => void): void;
605
+ /**
606
+ * Called whenever the HUD should be drawn.
607
+ *
608
+ * This is the ideal place to draw custom HUD elements.
609
+ *
610
+ * To prevent the default game HUD from drawing, use [GM:HUDShouldDraw](https://wiki.facepunch.com/gmod/GM:HUDShouldDraw).
611
+ *
612
+ * This hook does **not** get called when the Camera SWEP is held, or when the esc menu is open.
613
+ * If you need to draw in those situations, use [GM:DrawOverlay](https://wiki.facepunch.com/gmod/GM:DrawOverlay) instead.
614
+ *
615
+ *
616
+ *
617
+ * @realm client
618
+ * @source https://wiki.facepunch.com/gmod/GM:HUDPaint
619
+ */
620
+ Add(eventName: "HUDPaint", identifier: any, func: () => void): void;
621
+ /**
622
+ * Called before [GM:HUDPaint](https://wiki.facepunch.com/gmod/GM:HUDPaint) when the HUD background is being drawn.
623
+ *
624
+ * Just like [GM:HUDPaint](https://wiki.facepunch.com/gmod/GM:HUDPaint), this hook will not be called when the main menu is visible. [GM:PostDrawHUD](https://wiki.facepunch.com/gmod/GM:PostDrawHUD) does not have this behavior.
625
+ *
626
+ * Things rendered in this hook will **always** appear behind things rendered in [GM:HUDPaint](https://wiki.facepunch.com/gmod/GM:HUDPaint).
627
+ *
628
+ *
629
+ *
630
+ * @realm client
631
+ * @source https://wiki.facepunch.com/gmod/GM:HUDPaintBackground
632
+ */
633
+ Add(eventName: "HUDPaintBackground", identifier: any, func: () => void): void;
634
+ /**
635
+ * Called when the Gamemode is about to draw a given element on the client's HUD (heads-up display).
636
+ *
637
+ * **WARNING**: This hook is called HUNDREDS of times per second (more than 5 times per frame on average). You shouldn't be performing any computationally intensive operations. For Weapons you SHOULD use [WEAPON:HUDShouldDraw](https://wiki.facepunch.com/gmod/WEAPON:HUDShouldDraw) instead.
638
+ *
639
+ *
640
+ * @realm client
641
+ * @source https://wiki.facepunch.com/gmod/GM:HUDShouldDraw
642
+ */
643
+ Add(eventName: "HUDShouldDraw", identifier: any, func: (name: string) => boolean): void;
644
+ /**
645
+ * Called when a weapon has been picked up. Override to disable the default HUD notification.
646
+ * @realm client
647
+ * @source https://wiki.facepunch.com/gmod/GM:HUDWeaponPickedUp
648
+ */
649
+ Add(eventName: "HUDWeaponPickedUp", identifier: any, func: (weapon: Weapon) => void): void;
650
+ /**
651
+ * Called after the gamemode loads and starts.
652
+ *
653
+ * No entities would be present at the time this hook is called, please see [GM:InitPostEntity](https://wiki.facepunch.com/gmod/GM:InitPostEntity) for a one time fire hook after all map entities have been initialized.
654
+ * @realm shared
655
+ * @source https://wiki.facepunch.com/gmod/GM:Initialize
656
+ */
657
+ Add(eventName: "Initialize", identifier: any, func: () => void): void;
658
+ /**
659
+ * Called after all the entities are initialized. Starting from this hook [Global.LocalPlayer](https://wiki.facepunch.com/gmod/Global.LocalPlayer) will return valid object.
660
+ *
661
+ * **NOTE**: At this point the client only knows about the entities that are within the spawnpoints' [PVS (Potential Visibility Set)](https://developer.valvesoftware.com/wiki/PVS "PVS - Valve Developer Community"). For instance, if the server sends an entity that is not within this PVS, the client will receive it as NULL entity.
662
+ *
663
+ *
664
+ * @realm shared
665
+ * @source https://wiki.facepunch.com/gmod/GM:InitPostEntity
666
+ */
667
+ Add(eventName: "InitPostEntity", identifier: any, func: () => void): void;
668
+ /**
669
+ * Allows you to modify the supplied User Command with mouse input. This could be used to make moving the mouse do funky things to view angles.
670
+ * @realm client
671
+ * @source https://wiki.facepunch.com/gmod/GM:InputMouseApply
672
+ */
673
+ Add(eventName: "InputMouseApply", identifier: any, func: (cmd: CUserCmd, x: number, y: number, ang: Angle) => boolean): void;
674
+ /**
675
+ * Check if a player can spawn at a certain spawnpoint.
676
+ * @realm server
677
+ * @source https://wiki.facepunch.com/gmod/GM:IsSpawnpointSuitable
678
+ */
679
+ Add(eventName: "IsSpawnpointSuitable", identifier: any, func: (ply: Player, spawnpoint: Entity, makeSuitable: boolean) => boolean): void;
680
+ /**
681
+ * Called whenever a player pressed a key included within the IN keys.
682
+ *
683
+ * For a more general purpose function that handles all kinds of input, see [GM:PlayerButtonDown](https://wiki.facepunch.com/gmod/GM:PlayerButtonDown).
684
+ * See [GM:KeyRelease](https://wiki.facepunch.com/gmod/GM:KeyRelease) for the key release event.
685
+ *
686
+ * Despite being a predicted hook, it will still be called in singleplayer for your convenience.
687
+ *
688
+ * **WARNING**: Due to this being a predicted hook, [Global.ParticleEffect](https://wiki.facepunch.com/gmod/Global.ParticleEffect)s created only serverside from this hook will not be networked to the client, so make sure to do that on both realms.
689
+ *
690
+ *
691
+ * @realm shared
692
+ * @source https://wiki.facepunch.com/gmod/GM:KeyPress
693
+ */
694
+ Add(eventName: "KeyPress", identifier: any, func: (ply: Player, key: number) => void): void;
695
+ /**
696
+ * Runs when a IN key was released by a player.
697
+ *
698
+ * For a more general purpose function that handles all kinds of input, see [GM:PlayerButtonUp](https://wiki.facepunch.com/gmod/GM:PlayerButtonUp).
699
+ * See [GM:KeyPress](https://wiki.facepunch.com/gmod/GM:KeyPress) for the key press event.
700
+ *
701
+ * Despite being a predicted hook, it will still be called in singleplayer for your convenience.
702
+ *
703
+ * @realm shared
704
+ * @source https://wiki.facepunch.com/gmod/GM:KeyRelease
705
+ */
706
+ Add(eventName: "KeyRelease", identifier: any, func: (ply: Player, key: number) => void): void;
707
+ /**
708
+ * **INTERNAL**: This is used internally - although you're able to use it you probably shouldn't.
709
+ * Called from `gm_load` when the game should load a map.
710
+ * @realm server
711
+ * @source https://wiki.facepunch.com/gmod/GM:LoadGModSave
712
+ */
713
+ Add(eventName: "LoadGModSave", identifier: any, func: (data: string, map: string, timestamp: number) => void): void;
714
+ /**
715
+ * Called while an addon from the Steam workshop is downloading. Used by default to update details on the fancy workshop download panel.
716
+ * @realm menu
717
+ * @source https://wiki.facepunch.com/gmod/GM:LoadGModSaveFailed
718
+ */
719
+ Add(eventName: "LoadGModSaveFailed", identifier: any, func: (reason: string, workshopid: string) => void): void;
720
+ /**
721
+ * Called when `menu.lua` has finished loading.
722
+ * @realm menu
723
+ * @source https://wiki.facepunch.com/gmod/GM:MenuStart
724
+ */
725
+ Add(eventName: "MenuStart", identifier: any, func: () => void): void;
726
+ /**
727
+ * Override this gamemode function to disable mouth movement when talking on voice chat. By default, it is not called anywhere on the server.
728
+ * @realm shared
729
+ * @source https://wiki.facepunch.com/gmod/GM:MouthMoveAnimation
730
+ */
731
+ Add(eventName: "MouthMoveAnimation", identifier: any, func: (ply: Player) => void): void;
732
+ /**
733
+ * The Move hook is called for you to manipulate the player's MoveData.
734
+ *
735
+ * You shouldn't adjust the player's position in any way in the move hook. This is because due to prediction errors, the netcode might run the move hook multiple times as packets arrive late. Therefore you should only adjust the movedata construct in this hook.
736
+ *
737
+ * Generally you shouldn't have to use this hook - if you want to make a custom move type you should look at the drive system.
738
+ *
739
+ * This hook is called after [GM:PlayerTick](https://wiki.facepunch.com/gmod/GM:PlayerTick).
740
+ *
741
+ * See [Game Movement](https://wiki.facepunch.com/gmod/Game_Movement) for an explanation on the move system.
742
+ *
743
+ * @realm shared
744
+ * @source https://wiki.facepunch.com/gmod/GM:Move
745
+ */
746
+ Add(eventName: "Move", identifier: any, func: (ply: Player, mv: CMoveData) => boolean): void;
747
+ /**
748
+ * Returning true in this hook will cause it to render depth buffers defined with [render.GetResolvedFullFrameDepth](https://wiki.facepunch.com/gmod/render.GetResolvedFullFrameDepth).
749
+ * @realm client
750
+ * @source https://wiki.facepunch.com/gmod/GM:NeedsDepthPass
751
+ */
752
+ Add(eventName: "NeedsDepthPass", identifier: any, func: () => boolean): void;
753
+ /**
754
+ * Called when an entity has been created over the network.
755
+ * @realm client
756
+ * @source https://wiki.facepunch.com/gmod/GM:NetworkEntityCreated
757
+ */
758
+ Add(eventName: "NetworkEntityCreated", identifier: any, func: (ent: Entity) => void): void;
759
+ /**
760
+ * Called when a player's SteamID has been validated by Steam.
761
+ *
762
+ * See also [GM:PlayerAuthed](https://wiki.facepunch.com/gmod/GM:PlayerAuthed) and [Player:IsFullyAuthenticated](https://wiki.facepunch.com/gmod/Player:IsFullyAuthenticated).
763
+ *
764
+ * **NOTE**: This hook doesn't work intentionally in singleplayer [because the SteamID is not validated](https://github.com/Facepunch/garrysmod-issues/issues/4906#issuecomment-819337130) in that case. This also applies to `sv_lan 1` servers for every duplicate `-multirun` client.
765
+ *
766
+ *
767
+ * @realm server
768
+ * @source https://wiki.facepunch.com/gmod/GM:NetworkIDValidated
769
+ */
770
+ Add(eventName: "NetworkIDValidated", identifier: any, func: (name: string, steamID: string, ownerID: string) => void): void;
771
+ /**
772
+ * Called whenever this entity changes its transmission state for this [Global.LocalPlayer](https://wiki.facepunch.com/gmod/Global.LocalPlayer), such as exiting or re entering the [PVS (Potential Visibility Set)](https://developer.valvesoftware.com/wiki/PVS "PVS - Valve Developer Community").
773
+ *
774
+ * **NOTE**: This is the best place to handle the reset of [Entity:SetPredictable](https://wiki.facepunch.com/gmod/Entity:SetPredictable), as this would be usually called when the player lags and requests a full packet update.
775
+ *
776
+ * When the entity stops transmitting, [Entity:IsDormant](https://wiki.facepunch.com/gmod/Entity:IsDormant) will only return true **after** this hook.
777
+ *
778
+ *
779
+ * @realm client
780
+ * @source https://wiki.facepunch.com/gmod/GM:NotifyShouldTransmit
781
+ */
782
+ Add(eventName: "NotifyShouldTransmit", identifier: any, func: (entity: Entity, shouldtransmit: boolean) => void): void;
783
+ /**
784
+ * Called when a player has achieved an achievement. You can get the name and other information from an achievement ID with the [achievements](https://wiki.facepunch.com/gmod/achievements) library.
785
+ * @realm client
786
+ * @source https://wiki.facepunch.com/gmod/GM:OnAchievementAchieved
787
+ */
788
+ Add(eventName: "OnAchievementAchieved", identifier: any, func: (ply: Player, achievement: number) => void): void;
789
+ /**
790
+ * Called when the local player presses TAB while having their chatbox opened.
791
+ *
792
+ * **WARNING**: This function now uses [player.Iterator](https://wiki.facepunch.com/gmod/player.Iterator). This means it can't run all the time, as an error in the [GM:OnEntityCreated](https://wiki.facepunch.com/gmod/GM:OnEntityCreated) or [GM:EntityRemoved](https://wiki.facepunch.com/gmod/GM:EntityRemoved) hooks is likely to interrupt it. Make sure that no addon causes an error in these hooks.
793
+ *
794
+ *
795
+ * @realm client
796
+ * @source https://wiki.facepunch.com/gmod/GM:OnChatTab
797
+ */
798
+ Add(eventName: "OnChatTab", identifier: any, func: (text: string) => string): void;
799
+ /**
800
+ * Called when the player cleans up something.
801
+ * @realm client
802
+ * @source https://wiki.facepunch.com/gmod/GM:OnCleanup
803
+ */
804
+ Add(eventName: "OnCleanup", identifier: any, func: (name: string) => boolean): void;
805
+ /**
806
+ * Called on the server when a Lua error occurs on a client and is sent to the server.
807
+ *
808
+ * This hook allows server-side code to detect and log client-side errors.
809
+ *
810
+ * See [GM:OnLuaError](https://wiki.facepunch.com/gmod/GM:OnLuaError) for a hook that captures Lua errors directly within its [realm](https://wiki.facepunch.com/gmod/States).
811
+ *
812
+ * **WARNING**: Note that the stack argument can contain a table with 0 values.
813
+ *
814
+ * **NOTE**: Warning: the hook "protects" against lua error spam. If it has 5 errors in less than 1 second, the hook will not receive any of these 4 errors.
815
+ *
816
+ *
817
+ *
818
+ * @realm server
819
+ * @source https://wiki.facepunch.com/gmod/GM:OnClientLuaError
820
+ */
821
+ Add(eventName: "OnClientLuaError", identifier: any, func: (error: string, ply: Player, stack: table, name: string) => void): void;
822
+ /**
823
+ * Called when a caption/subtitle has been emitted to the closed caption box.
824
+ * @realm client
825
+ * @source https://wiki.facepunch.com/gmod/GM:OnCloseCaptionEmit
826
+ */
827
+ Add(eventName: "OnCloseCaptionEmit", identifier: any, func: (soundScript: string, duration: number, fromPlayer: boolean, fullText: string) => boolean): void;
828
+ /**
829
+ * Called when the context menu keybind (+menu_context) is released, which by default is C.
830
+ *
831
+ * This hook will not run if [input.IsKeyTrapping](https://wiki.facepunch.com/gmod/input.IsKeyTrapping) returns true.
832
+ *
833
+ * See also [GM:OnContextMenuOpen](https://wiki.facepunch.com/gmod/GM:OnContextMenuOpen).
834
+ *
835
+ * @realm client
836
+ * @source https://wiki.facepunch.com/gmod/GM:OnContextMenuClose
837
+ */
838
+ Add(eventName: "OnContextMenuClose", identifier: any, func: () => void): void;
839
+ /**
840
+ * Called when the context menu keybind (`+menu_context`) is pressed, which by default is C.
841
+ *
842
+ * See also [GM:OnContextMenuClose](https://wiki.facepunch.com/gmod/GM:OnContextMenuClose).
843
+ *
844
+ * @realm client
845
+ * @source https://wiki.facepunch.com/gmod/GM:OnContextMenuOpen
846
+ */
847
+ Add(eventName: "OnContextMenuOpen", identifier: any, func: () => void): void;
848
+ /**
849
+ * Called when the crazy physics detection detects an entity with crazy physics, i.e. position being far outside of the map, velocities being near or at infinity, etc. The primary reason for this system is to prevent program crashes in physics engine.
850
+ * @realm shared
851
+ * @source https://wiki.facepunch.com/gmod/GM:OnCrazyPhysics
852
+ */
853
+ Add(eventName: "OnCrazyPhysics", identifier: any, func: (ent: Entity, physobj: PhysObj) => void): void;
854
+ /**
855
+ * Called when a player has been hurt by an explosion. Override to disable default sound effect.
856
+ * @realm server
857
+ * @source https://wiki.facepunch.com/gmod/GM:OnDamagedByExplosion
858
+ */
859
+ Add(eventName: "OnDamagedByExplosion", identifier: any, func: (ply: Player, dmginfo: CTakeDamageInfo) => void): void;
860
+ /**
861
+ * Called as soon as the entity is created. Very little of the entity's properties will be initialized at this stage. (keyvalues, classname, flags, anything), especially on the serverside.
862
+ *
863
+ * **WARNING**: Removing the created entity during this event can lead to unexpected problems. Use [Global.SafeRemoveEntityDelayed](https://wiki.facepunch.com/gmod/Global.SafeRemoveEntityDelayed)( entity, 0 ) to safely remove the entity.
864
+ *
865
+ *
866
+ * @realm shared
867
+ * @source https://wiki.facepunch.com/gmod/GM:OnEntityCreated
868
+ */
869
+ Add(eventName: "OnEntityCreated", identifier: any, func: (entity: Entity) => void): void;
870
+ /**
871
+ * Called when the [Entity:WaterLevel](https://wiki.facepunch.com/gmod/Entity:WaterLevel) of an entity is changed.
872
+ *
873
+ * 0 - The entity isn't in water.
874
+ *
875
+ * 1 - Slightly submerged (at least to the feet).
876
+ *
877
+ * 2 - The majority of the entity is submerged (at least to the waist).
878
+ *
879
+ * 3 - Completely submerged.
880
+ *
881
+ * **WARNING**: This hook can be considered a physics callback, so changing collision rules ([Entity:SetSolidFlags](https://wiki.facepunch.com/gmod/Entity:SetSolidFlags)) in it may lead to a crash!
882
+ *
883
+ *
884
+ * @realm server
885
+ * @source https://wiki.facepunch.com/gmod/GM:OnEntityWaterLevelChanged
886
+ */
887
+ Add(eventName: "OnEntityWaterLevelChanged", identifier: any, func: (entity: Entity, old: number, _new: number) => void): void;
888
+ /**
889
+ * Called when the gamemode is loaded. [gmod.GetGamemode](https://wiki.facepunch.com/gmod/gmod.GetGamemode) will be functional at this point.
890
+ *
891
+ * [Global.LocalPlayer](https://wiki.facepunch.com/gmod/Global.LocalPlayer)() returns NULL at the time this is run.
892
+ *
893
+ * @realm shared
894
+ * @source https://wiki.facepunch.com/gmod/GM:OnGamemodeLoaded
895
+ */
896
+ Add(eventName: "OnGamemodeLoaded", identifier: any, func: () => void): void;
897
+ /**
898
+ * Called when a Lua error occurs.
899
+ * If you want to retrieve client errors on the server side, you can use this hook: [GM:OnClientLuaError](https://wiki.facepunch.com/gmod/GM:OnClientLuaError)
900
+ * **NOTE**: On the [server realm](https://wiki.facepunch.com/gmod/States), this hook will only account for server-side errors, not client-side ones.
901
+ *
902
+ *
903
+ * @realm shared and menu
904
+ * @source https://wiki.facepunch.com/gmod/GM:OnLuaError
905
+ */
906
+ Add(eventName: "OnLuaError", identifier: any, func: (error: string, realm: string, stack: table, name: string, id: string) => void): void;
907
+ /**
908
+ * Called when a Addon Conflict occurs, only works in the Menu realm.
909
+ *
910
+ * @realm menu
911
+ * @source https://wiki.facepunch.com/gmod/GM:OnNotifyAddonConflict
912
+ */
913
+ Add(eventName: "OnNotifyAddonConflict", identifier: any, func: (addon1: string, addon2: string, fileName: string) => void): void;
914
+ /**
915
+ * Called whenever an NPC drops an item upon its death, such as health kits, armor batteries, etc.
916
+ *
917
+ * It will NOT be called for dropped weapons, with exception of Half-Life: Source NPCs, since they don't use actual weapon entities and create a weapon entity on death.
918
+ * [GM:PlayerDroppedWeapon](https://wiki.facepunch.com/gmod/GM:PlayerDroppedWeapon) works for NPC weapon drops already. (Yes, it's not a typo)
919
+ *
920
+ * It will also not be called for live grenades spawned by Zombine.
921
+ *
922
+ * @realm server
923
+ * @source https://wiki.facepunch.com/gmod/GM:OnNPCDropItem
924
+ */
925
+ Add(eventName: "OnNPCDropItem", identifier: any, func: (npc: NPC, item: Entity) => void): void;
926
+ /**
927
+ * Called whenever an NPC is killed.
928
+ * @realm server
929
+ * @source https://wiki.facepunch.com/gmod/GM:OnNPCKilled
930
+ */
931
+ Add(eventName: "OnNPCKilled", identifier: any, func: (npc: NPC, attacker: Entity, inflictor: Entity) => void): void;
932
+ /**
933
+ * Called when the main menu has been blocked by [GM:OnPauseMenuShow](https://wiki.facepunch.com/gmod/GM:OnPauseMenuShow) four times in a small interval. This is used internally to explain to the user that they can hold SHIFT to force open the main menu.
934
+ *
935
+ * @realm menu
936
+ * @source https://wiki.facepunch.com/gmod/GM:OnPauseMenuBlockedTooManyTimes
937
+ */
938
+ Add(eventName: "OnPauseMenuBlockedTooManyTimes", identifier: any, func: () => void): void;
939
+ /**
940
+ * Called when the pause menu is attempting to be opened. Allows you to prevent the main menu from being opened that time.
941
+ *
942
+ * The user can hold SHIFT to not call this hook. If the main menu is blocked multiple times in short succession, a warning will be displayed to the end user on how to bypass the hook.
943
+ *
944
+ * @realm client
945
+ * @source https://wiki.facepunch.com/gmod/GM:OnPauseMenuShow
946
+ */
947
+ Add(eventName: "OnPauseMenuShow", identifier: any, func: () => boolean): void;
948
+ /**
949
+ * Called when a permission gets Granted or Revoked.
950
+ *
951
+ * @realm menu
952
+ * @source https://wiki.facepunch.com/gmod/GM:OnPermissionsChanged
953
+ */
954
+ Add(eventName: "OnPermissionsChanged", identifier: any, func: () => void): void;
955
+ /**
956
+ * Called when a player freezes an entity with the physgun.
957
+ *
958
+ * @realm server
959
+ * @source https://wiki.facepunch.com/gmod/GM:OnPhysgunFreeze
960
+ */
961
+ Add(eventName: "OnPhysgunFreeze", identifier: any, func: (weapon: Entity, physobj: PhysObj, ent: Entity, ply: Player) => boolean): void;
962
+ /**
963
+ * Called to when a player has successfully picked up an entity with their Physics Gun.
964
+ *
965
+ * Not to be confused with [GM:PhysgunPickup](https://wiki.facepunch.com/gmod/GM:PhysgunPickup) which is called to ask if the player should be able to pick up an entity.
966
+ *
967
+ *
968
+ * See [GM:GravGunOnPickedUp](https://wiki.facepunch.com/gmod/GM:GravGunOnPickedUp) for the Gravity Gun pickup variant.
969
+ * See [GM:OnPlayerPhysicsPickup](https://wiki.facepunch.com/gmod/GM:OnPlayerPhysicsPickup) for the player `+use` pickup variant.
970
+ *
971
+ *
972
+ * @realm server
973
+ * @source https://wiki.facepunch.com/gmod/GM:OnPhysgunPickup
974
+ */
975
+ Add(eventName: "OnPhysgunPickup", identifier: any, func: (ply: Player, ent: Entity) => void): void;
976
+ /**
977
+ * Called when a player reloads with the physgun. Override this to disable default unfreezing behavior.
978
+ * @realm server
979
+ * @source https://wiki.facepunch.com/gmod/GM:OnPhysgunReload
980
+ */
981
+ Add(eventName: "OnPhysgunReload", identifier: any, func: (physgun: Weapon, ply: Player) => boolean): void;
982
+ /**
983
+ * Called when a player has changed team using [GM:PlayerJoinTeam](https://wiki.facepunch.com/gmod/GM:PlayerJoinTeam).
984
+ *
985
+ * **WARNING**: This hook will not work with [hook.Add](https://wiki.facepunch.com/gmod/hook.Add) and it is only called manually from [GM:PlayerJoinTeam](https://wiki.facepunch.com/gmod/GM:PlayerJoinTeam) by the base gamemode
986
+ *
987
+ *
988
+ * @realm server
989
+ * @source https://wiki.facepunch.com/gmod/GM:OnPlayerChangedTeam
990
+ * @deprecated Use GM:PlayerChangedTeam instead, which works for every Player:SetTeam call.
991
+ */
992
+ Add(eventName: "OnPlayerChangedTeam", identifier: any, func: (ply: Player, oldTeam: number, newTeam: number) => void): void;
993
+ /**
994
+ * Called whenever a player sends a chat message. For the serverside equivalent, see [GM:PlayerSay](https://wiki.facepunch.com/gmod/GM:PlayerSay).
995
+ * **NOTE**: The input (or suppression) of this hook is based on the output from [GM:PlayerSay](https://wiki.facepunch.com/gmod/GM:PlayerSay). Chat events suppressed serverside do not call this hook.
996
+ *
997
+ *
998
+ * @realm client
999
+ * @source https://wiki.facepunch.com/gmod/GM:OnPlayerChat
1000
+ */
1001
+ Add(eventName: "OnPlayerChat", identifier: any, func: (ply: Player, text: string, teamChat: boolean, isDead: boolean) => boolean): void;
1002
+ /**
1003
+ * Called when a player makes contact with the ground after a jump or a fall.
1004
+ * @realm shared
1005
+ * @source https://wiki.facepunch.com/gmod/GM:OnPlayerHitGround
1006
+ */
1007
+ Add(eventName: "OnPlayerHitGround", identifier: any, func: (player: Entity, inWater: boolean, onFloater: boolean, speed: number) => boolean): void;
1008
+ /**
1009
+ * Called when a player jumps.
1010
+ * @realm shared
1011
+ * @source https://wiki.facepunch.com/gmod/GM:OnPlayerJump
1012
+ */
1013
+ Add(eventName: "OnPlayerJump", identifier: any, func: (player: Entity, speed: number) => void): void;
1014
+ /**
1015
+ * Called when a player +use drops an entity.
1016
+ * @realm server
1017
+ * @source https://wiki.facepunch.com/gmod/GM:OnPlayerPhysicsDrop
1018
+ */
1019
+ Add(eventName: "OnPlayerPhysicsDrop", identifier: any, func: (ply: Player, ent: Entity, thrown: boolean) => void): void;
1020
+ /**
1021
+ * Called when a player +use pickups up an entity. This will be called after the entity passes though [GM:AllowPlayerPickup](https://wiki.facepunch.com/gmod/GM:AllowPlayerPickup).
1022
+ *
1023
+ * See [GM:GravGunOnPickedUp](https://wiki.facepunch.com/gmod/GM:GravGunOnPickedUp) for the Gravity Gun pickup variant.
1024
+ * See [GM:OnPhysgunPickup](https://wiki.facepunch.com/gmod/GM:OnPhysgunPickup) for the Physics Gun pickup variant.
1025
+ *
1026
+ * @realm server
1027
+ * @source https://wiki.facepunch.com/gmod/GM:OnPlayerPhysicsPickup
1028
+ */
1029
+ Add(eventName: "OnPlayerPhysicsPickup", identifier: any, func: (ply: Player, ent: Entity) => void): void;
1030
+ /**
1031
+ * Called when gamemode has been reloaded by auto refresh.
1032
+ *
1033
+ * **NOTE**: It seems that this event can be triggered more than once for a single refresh event.
1034
+ *
1035
+ *
1036
+ * @realm shared
1037
+ * @source https://wiki.facepunch.com/gmod/GM:OnReloaded
1038
+ */
1039
+ Add(eventName: "OnReloaded", identifier: any, func: () => void): void;
1040
+ /**
1041
+ * Called when the player's screen resolution of the game changes. This also called when changing MSAA settings.
1042
+ *
1043
+ * [Global.ScrW](https://wiki.facepunch.com/gmod/Global.ScrW) and [Global.ScrH](https://wiki.facepunch.com/gmod/Global.ScrH) will return the new values when this hook is called.
1044
+ *
1045
+ * @realm client
1046
+ * @source https://wiki.facepunch.com/gmod/GM:OnScreenSizeChanged
1047
+ */
1048
+ Add(eventName: "OnScreenSizeChanged", identifier: any, func: (oldWidth: number, oldHeight: number, newWidth: number, newHeight: number) => void): void;
1049
+ /**
1050
+ * Called when a player releases the `+menu` bind on their keyboard, which is bound to Q by default.
1051
+ * @realm client
1052
+ * @source https://wiki.facepunch.com/gmod/GM:OnSpawnMenuClose
1053
+ */
1054
+ Add(eventName: "OnSpawnMenuClose", identifier: any, func: () => void): void;
1055
+ /**
1056
+ * Called when a player presses the `+menu` bind on their keyboard, which is bound to Q by default.
1057
+ * @realm client
1058
+ * @source https://wiki.facepunch.com/gmod/GM:OnSpawnMenuOpen
1059
+ */
1060
+ Add(eventName: "OnSpawnMenuOpen", identifier: any, func: () => void): void;
1061
+ /**
1062
+ * Called when a [DTextEntry](https://wiki.facepunch.com/gmod/DTextEntry) gets focus.
1063
+ *
1064
+ * This hook is run from [DTextEntry:OnGetFocus](https://wiki.facepunch.com/gmod/DTextEntry:OnGetFocus) and [PANEL:OnMousePressed](https://wiki.facepunch.com/gmod/PANEL:OnMousePressed) of [DTextEntry](https://wiki.facepunch.com/gmod/DTextEntry).
1065
+ *
1066
+ * @realm client
1067
+ * @source https://wiki.facepunch.com/gmod/GM:OnTextEntryGetFocus
1068
+ */
1069
+ Add(eventName: "OnTextEntryGetFocus", identifier: any, func: (panel: Panel) => void): void;
1070
+ /**
1071
+ * Called when a [DTextEntry](https://wiki.facepunch.com/gmod/DTextEntry) loses focus.
1072
+ * @realm client
1073
+ * @source https://wiki.facepunch.com/gmod/GM:OnTextEntryLoseFocus
1074
+ */
1075
+ Add(eventName: "OnTextEntryLoseFocus", identifier: any, func: (panel: Panel) => void): void;
1076
+ /**
1077
+ * Called when the player undoes something.
1078
+ * @realm client
1079
+ * @source https://wiki.facepunch.com/gmod/GM:OnUndo
1080
+ */
1081
+ Add(eventName: "OnUndo", identifier: any, func: (name: string, customText: string) => boolean): void;
1082
+ /**
1083
+ * Called when the player changes their weapon to another one - and their viewmodel model changes.
1084
+ *
1085
+ * This is not always called clientside.
1086
+ *
1087
+ * @realm shared
1088
+ * @source https://wiki.facepunch.com/gmod/GM:OnViewModelChanged
1089
+ */
1090
+ Add(eventName: "OnViewModelChanged", identifier: any, func: (viewmodel: Entity, oldModel: string, newModel: string) => void): void;
1091
+ /**
1092
+ * Called when a player drops an entity with the Physgun.
1093
+ *
1094
+ * See [GM:GravGunOnDropped](https://wiki.facepunch.com/gmod/GM:GravGunOnDropped) for the Gravity Gun drop variant.
1095
+ *
1096
+ * @realm shared
1097
+ * @source https://wiki.facepunch.com/gmod/GM:PhysgunDrop
1098
+ */
1099
+ Add(eventName: "PhysgunDrop", identifier: any, func: (player: Player, entity: Entity) => void): void;
1100
+ /**
1101
+ * Called to determine if a player should be able to pick up an entity with the Physics Gun.
1102
+ *
1103
+ * See [GM:OnPhysgunPickup](https://wiki.facepunch.com/gmod/GM:OnPhysgunPickup) for a hook which is called when a player has successfully picked up an entity.
1104
+ *
1105
+ * See [GM:GravGunPickupAllowed](https://wiki.facepunch.com/gmod/GM:GravGunPickupAllowed) for the Gravity Gun pickup variant.
1106
+ * See [GM:AllowPlayerPickup](https://wiki.facepunch.com/gmod/GM:AllowPlayerPickup) for the `+USE` pickup variant.
1107
+ *
1108
+ * @realm shared
1109
+ * @source https://wiki.facepunch.com/gmod/GM:PhysgunPickup
1110
+ */
1111
+ Add(eventName: "PhysgunPickup", identifier: any, func: (player: Player, entity: Entity) => boolean): void;
1112
+ /**
1113
+ * Called after player's reserve ammo count changes.
1114
+ *
1115
+ * @realm shared
1116
+ * @source https://wiki.facepunch.com/gmod/GM:PlayerAmmoChanged
1117
+ */
1118
+ Add(eventName: "PlayerAmmoChanged", identifier: any, func: (ply: Player, ammoID: number, oldCount: number, newCount: number) => void): void;
1119
+ /**
1120
+ * Called after the player gets their [Player:UniqueID](https://wiki.facepunch.com/gmod/Player:UniqueID) set for the first time. This hook will also be called in singleplayer.
1121
+ *
1122
+ * See [GM:NetworkIDValidated](https://wiki.facepunch.com/gmod/GM:NetworkIDValidated) for a hook that is called with the player's SteamID is validated by Steam.
1123
+ *
1124
+ * @realm server
1125
+ * @source https://wiki.facepunch.com/gmod/GM:PlayerAuthed
1126
+ */
1127
+ Add(eventName: "PlayerAuthed", identifier: any, func: (ply: Player, steamid: string, uniqueid: string) => void): void;
1128
+ /**
1129
+ * Runs when a bind has been pressed. Allows to block commands.
1130
+ *
1131
+ * **NOTE**: By using the "alias" console command, this hook can be effectively circumvented. To prevent this use [input.TranslateAlias](https://wiki.facepunch.com/gmod/input.TranslateAlias).
1132
+ *
1133
+ * To stop the user from using `+attack`, `+left` and any other movement commands of the sort, please look into using [GM:StartCommand](https://wiki.facepunch.com/gmod/GM:StartCommand) instead.
1134
+ *
1135
+ *
1136
+ * The third argument will always be true.
1137
+ *
1138
+ * This does not run for function keys binds (F1-F12).
1139
+ *
1140
+ * @realm client
1141
+ * @source https://wiki.facepunch.com/gmod/GM:PlayerBindPress
1142
+ */
1143
+ Add(eventName: "PlayerBindPress", identifier: any, func: (ply: Player, bind: string, pressed: boolean, code: number) => boolean): void;
1144
+ /**
1145
+ * Called when a player presses a button.
1146
+ *
1147
+ * This will not be called if player has a panel opened with keyboard input enabled, use [PANEL:OnKeyCodePressed](https://wiki.facepunch.com/gmod/PANEL:OnKeyCodePressed) instead.
1148
+ *
1149
+ * See [GM:KeyPress](https://wiki.facepunch.com/gmod/GM:KeyPress) for an alternative that uses [Enums/IN](https://wiki.facepunch.com/gmod/Enums/IN).
1150
+ * See [GM:PlayerButtonUp](https://wiki.facepunch.com/gmod/GM:PlayerButtonUp) for the "key release" event.
1151
+ *
1152
+ * @realm shared
1153
+ * @source https://wiki.facepunch.com/gmod/GM:PlayerButtonDown
1154
+ */
1155
+ Add(eventName: "PlayerButtonDown", identifier: any, func: (ply: Player, button: BUTTON_CODE) => void): void;
1156
+ /**
1157
+ * Called when a player releases a button.
1158
+ *
1159
+ * This will not be called if player has a panel opened with keyboard input enabled, use [PANEL:OnKeyCodeReleased](https://wiki.facepunch.com/gmod/PANEL:OnKeyCodeReleased) instead.
1160
+ *
1161
+ * See [GM:KeyRelease](https://wiki.facepunch.com/gmod/GM:KeyRelease) for an alternative that uses [Enums/IN](https://wiki.facepunch.com/gmod/Enums/IN).
1162
+ * See [GM:PlayerButtonDown](https://wiki.facepunch.com/gmod/GM:PlayerButtonDown) for the "key press" event.
1163
+ *
1164
+ * @realm shared
1165
+ * @source https://wiki.facepunch.com/gmod/GM:PlayerButtonUp
1166
+ */
1167
+ Add(eventName: "PlayerButtonUp", identifier: any, func: (ply: Player, button: BUTTON_CODE) => void): void;
1168
+ /**
1169
+ * Decides whether a player can hear another player using voice chat.
1170
+ *
1171
+ * **WARNING**: This hook is called **players count * speaking players count** times every 0.3 seconds if at least 1 player is talking or every 5 seconds if no one is talking.
1172
+ * You should ensure that your code is efficient, or this will definitely influence performance.
1173
+ *
1174
+ *
1175
+ * @realm server
1176
+ * @source https://wiki.facepunch.com/gmod/GM:PlayerCanHearPlayersVoice
1177
+ */
1178
+ Add(eventName: "PlayerCanHearPlayersVoice", identifier: any, func: (listener: Player, talker: Player) => (boolean, boolean)): void;
1179
+ /**
1180
+ * Returns whether or not a player is allowed to join a team
1181
+ * **WARNING**: This hook will not work with [hook.Add](https://wiki.facepunch.com/gmod/hook.Add) and it is only called manually from [GM:PlayerJoinTeam](https://wiki.facepunch.com/gmod/GM:PlayerJoinTeam) by the base gamemode
1182
+ *
1183
+ *
1184
+ * @realm server
1185
+ * @source https://wiki.facepunch.com/gmod/GM:PlayerCanJoinTeam
1186
+ */
1187
+ Add(eventName: "PlayerCanJoinTeam", identifier: any, func: (ply: Player, team: number) => boolean): void;
1188
+ /**
1189
+ * Returns whether or not a player is allowed to pick an item up. (ammo, health, armor)
1190
+ *
1191
+ * This will typically only work for base game entities, unless mod authors that implement similar entities also manually call this hook.
1192
+ *
1193
+ * See [GM:PlayerCanPickupWeapon](https://wiki.facepunch.com/gmod/GM:PlayerCanPickupWeapon) for a hook that controls weapon pickups.
1194
+ *
1195
+ * @realm server
1196
+ * @source https://wiki.facepunch.com/gmod/GM:PlayerCanPickupItem
1197
+ */
1198
+ Add(eventName: "PlayerCanPickupItem", identifier: any, func: (ply: Player, item: Entity) => boolean): void;
1199
+ /**
1200
+ * Returns whether or not a player is allowed to pick up a weapon.
1201
+ *
1202
+ * If this returns `false`, [Player:Give](https://wiki.facepunch.com/gmod/Player:Give) won't work.
1203
+ *
1204
+ * See [GM:PlayerCanPickupItem](https://wiki.facepunch.com/gmod/GM:PlayerCanPickupItem) for a hook that affects things like health kits, armor batteries and ammo entities.
1205
+ *
1206
+ * See [GM:WeaponEquip](https://wiki.facepunch.com/gmod/GM:WeaponEquip) for a hook that is called when a player successfully picks up a weapon after passing this hook.
1207
+ *
1208
+ * @realm server
1209
+ * @source https://wiki.facepunch.com/gmod/GM:PlayerCanPickupWeapon
1210
+ */
1211
+ Add(eventName: "PlayerCanPickupWeapon", identifier: any, func: (ply: Player, weapon: Weapon) => boolean): void;
1212
+ /**
1213
+ * Returns whether or not the player can see the other player's chat.
1214
+ * **NOTE**: The **speaker** parameter does not have to be a valid [Player](https://wiki.facepunch.com/gmod/Player) object which happens when console messages are displayed for example.
1215
+ *
1216
+ * @realm server
1217
+ * @source https://wiki.facepunch.com/gmod/GM:PlayerCanSeePlayersChat
1218
+ */
1219
+ Add(eventName: "PlayerCanSeePlayersChat", identifier: any, func: (text: string, teamOnly: boolean, listener: Player, speaker: Player) => boolean): void;
1220
+ /**
1221
+ * Called when a player has changed team using [Player:SetTeam](https://wiki.facepunch.com/gmod/Player:SetTeam).
1222
+ * **WARNING**: Avoid calling [Player:SetTeam](https://wiki.facepunch.com/gmod/Player:SetTeam) in this hook as it may cause an infinite loop!
1223
+ *
1224
+ * **WARNING**: [Player:Team](https://wiki.facepunch.com/gmod/Player:Team) inside this hook will return `oldTeam`.
1225
+ *
1226
+ *
1227
+ * @realm server
1228
+ * @source https://wiki.facepunch.com/gmod/GM:PlayerChangedTeam
1229
+ */
1230
+ Add(eventName: "PlayerChangedTeam", identifier: any, func: (ply: Player, oldTeam: number, newTeam: number) => void): void;
1231
+ /**
1232
+ * Called whenever a player is about to spawn something to see if they hit a limit for whatever they are spawning.
1233
+ * **NOTE**: This hook will not be called in singleplayer, as singleplayer does not have limits.
1234
+ *
1235
+ * @realm shared
1236
+ * @source https://wiki.facepunch.com/gmod/GM:PlayerCheckLimit
1237
+ */
1238
+ Add(eventName: "PlayerCheckLimit", identifier: any, func: (ply: Player, limitName: string, current: number, defaultMax: number) => boolean): void;
1239
+ /**
1240
+ * **INTERNAL**: This is used internally - although you're able to use it you probably shouldn't.
1241
+ *
1242
+ *
1243
+ * Called whenever a player's class is changed on the server-side with [player_manager.SetPlayerClass](https://wiki.facepunch.com/gmod/player_manager.SetPlayerClass).
1244
+ *
1245
+ * @realm client
1246
+ * @source https://wiki.facepunch.com/gmod/GM:PlayerClassChanged
1247
+ */
1248
+ Add(eventName: "PlayerClassChanged", identifier: any, func: (ply: Player, newID: number) => void): void;
1249
+ /**
1250
+ * Executes when a player connects to the server. Called before the player has been assigned a [UserID](https://wiki.facepunch.com/gmod/Player:UserID) and entity. See the [player_connect](https://wiki.facepunch.com/gmod/gameevent/player_connect) gameevent for a version of this hook called after the player entity has been created.
1251
+ *
1252
+ * **NOTE**: This is only called clientside for listen server hosts.
1253
+ *
1254
+ * **NOTE**: This is not called clientside for the local player.
1255
+ *
1256
+ *
1257
+ * @realm shared
1258
+ * @source https://wiki.facepunch.com/gmod/GM:PlayerConnect
1259
+ */
1260
+ Add(eventName: "PlayerConnect", identifier: any, func: (name: string, ip: string) => void): void;
1261
+ /**
1262
+ * Called when a player is killed by [Player:Kill](https://wiki.facepunch.com/gmod/Player:Kill) or any other normal means.
1263
+ *
1264
+ * This hook is **not** called if the player is killed by [Player:KillSilent](https://wiki.facepunch.com/gmod/Player:KillSilent). See [GM:PlayerSilentDeath](https://wiki.facepunch.com/gmod/GM:PlayerSilentDeath) for that.
1265
+ *
1266
+ * * [GM:DoPlayerDeath](https://wiki.facepunch.com/gmod/GM:DoPlayerDeath) is called **before** this hook.
1267
+ * * [GM:PostPlayerDeath](https://wiki.facepunch.com/gmod/GM:PostPlayerDeath) is called **after** this hook.
1268
+ *
1269
+ * See [Player:LastHitGroup](https://wiki.facepunch.com/gmod/Player:LastHitGroup) if you need to get the last hit hitgroup of the player.
1270
+ *
1271
+ * **NOTE**: [Player:Alive](https://wiki.facepunch.com/gmod/Player:Alive) will return false in this hook.
1272
+ *
1273
+ *
1274
+ *
1275
+ * @realm server
1276
+ * @source https://wiki.facepunch.com/gmod/GM:PlayerDeath
1277
+ */
1278
+ Add(eventName: "PlayerDeath", identifier: any, func: (victim: Player, inflictor: Entity, attacker: Entity) => void): void;
1279
+ /**
1280
+ * Returns whether or not the default death sound should be muted.
1281
+ * @realm server
1282
+ * @source https://wiki.facepunch.com/gmod/GM:PlayerDeathSound
1283
+ */
1284
+ Add(eventName: "PlayerDeathSound", identifier: any, func: (ply: Player) => boolean): void;
1285
+ /**
1286
+ * Called every think while the player is dead. The return value will determine if the player respawns.
1287
+ *
1288
+ * Overwriting this function will prevent players from respawning by pressing space or clicking.
1289
+ *
1290
+ * This hook is not called for players with the [FL_FROZEN](https://wiki.facepunch.com/gmod/Enums/FL) flag applied.
1291
+ *
1292
+ * @realm server
1293
+ * @source https://wiki.facepunch.com/gmod/GM:PlayerDeathThink
1294
+ */
1295
+ Add(eventName: "PlayerDeathThink", identifier: any, func: (ply: Player) => boolean): void;
1296
+ /**
1297
+ * Called when a player leaves the server. See the [player_disconnect gameevent](https://wiki.facepunch.com/gmod/gameevent/player_disconnect) for a shared version of this hook.
1298
+ *
1299
+ * This is not called in single-player or listen servers for the host.
1300
+ *
1301
+ * @realm server
1302
+ * @source https://wiki.facepunch.com/gmod/GM:PlayerDisconnected
1303
+ */
1304
+ Add(eventName: "PlayerDisconnected", identifier: any, func: (ply: Player) => void): void;
1305
+ /**
1306
+ * Called to update the player's animation during a drive.
1307
+ * @realm shared
1308
+ * @source https://wiki.facepunch.com/gmod/GM:PlayerDriveAnimate
1309
+ */
1310
+ Add(eventName: "PlayerDriveAnimate", identifier: any, func: (ply: Player) => void): void;
1311
+ /**
1312
+ * Called when a weapon is dropped by a player via [Player:DropWeapon](https://wiki.facepunch.com/gmod/Player:DropWeapon). Despite its name, this hook is also called for NPC weapon drops.
1313
+ *
1314
+ * Also called when a weapon is removed from a player via [Player:StripWeapon](https://wiki.facepunch.com/gmod/Player:StripWeapon).
1315
+ *
1316
+ * See also [GM:WeaponEquip](https://wiki.facepunch.com/gmod/GM:WeaponEquip) for a hook when a player picks up a weapon.
1317
+ *
1318
+ * The weapon's [Entity:GetOwner](https://wiki.facepunch.com/gmod/Entity:GetOwner) will be NULL at the time this hook is called.
1319
+ *
1320
+ * [WEAPON:OnDrop](https://wiki.facepunch.com/gmod/WEAPON:OnDrop) will be called before this hook is.
1321
+ *
1322
+ * @realm server
1323
+ * @source https://wiki.facepunch.com/gmod/GM:PlayerDroppedWeapon
1324
+ */
1325
+ Add(eventName: "PlayerDroppedWeapon", identifier: any, func: (owner: Player | NPC, wep: Weapon) => void): void;
1326
+ /**
1327
+ * Called when player stops using voice chat.
1328
+ * @realm client
1329
+ * @source https://wiki.facepunch.com/gmod/GM:PlayerEndVoice
1330
+ */
1331
+ Add(eventName: "PlayerEndVoice", identifier: any, func: (ply: Player) => void): void;
1332
+ /**
1333
+ * Called when a player enters a vehicle.
1334
+ *
1335
+ * Called just after [GM:CanPlayerEnterVehicle](https://wiki.facepunch.com/gmod/GM:CanPlayerEnterVehicle).
1336
+ *
1337
+ * See also [GM:PlayerLeaveVehicle](https://wiki.facepunch.com/gmod/GM:PlayerLeaveVehicle).
1338
+ *
1339
+ * @realm server
1340
+ * @source https://wiki.facepunch.com/gmod/GM:PlayerEnteredVehicle
1341
+ */
1342
+ Add(eventName: "PlayerEnteredVehicle", identifier: any, func: (ply: Player, veh: Vehicle, role: number) => void): void;
1343
+ /**
1344
+ * Called before firing clientside animation events on a player model.
1345
+ *
1346
+ * See [GM:PlayerHandleAnimEvent](https://wiki.facepunch.com/gmod/GM:PlayerHandleAnimEvent) for the serverside version.
1347
+ *
1348
+ * @realm client
1349
+ * @source https://wiki.facepunch.com/gmod/GM:PlayerFireAnimationEvent
1350
+ */
1351
+ Add(eventName: "PlayerFireAnimationEvent", identifier: any, func: (ply: Player, pos: Vector, ang: Angle, event: number, name: string) => boolean): void;
1352
+ /**
1353
+ * Called whenever a player steps. Return true to mute the normal sound.
1354
+ *
1355
+ * See [GM:PlayerStepSoundTime](https://wiki.facepunch.com/gmod/GM:PlayerStepSoundTime) for a related hook about footstep frequency.
1356
+ * **NOTE**: This hook is called on all clients.
1357
+ *
1358
+ *
1359
+ * @realm shared
1360
+ * @source https://wiki.facepunch.com/gmod/GM:PlayerFootstep
1361
+ */
1362
+ Add(eventName: "PlayerFootstep", identifier: any, func: (ply: Player, pos: Vector, foot: number, sound: string, volume: number, filter: CRecipientFilter) => boolean): void;
1363
+ /**
1364
+ * Called when a player freezes an object.
1365
+ * @realm server
1366
+ * @source https://wiki.facepunch.com/gmod/GM:PlayerFrozeObject
1367
+ */
1368
+ Add(eventName: "PlayerFrozeObject", identifier: any, func: (ply: Player, ent: Entity, physobj: PhysObj) => void): void;
1369
+ /**
1370
+ * Called before firing serverside animation events on the player models.
1371
+ *
1372
+ * See [GM:PlayerFireAnimationEvent](https://wiki.facepunch.com/gmod/GM:PlayerFireAnimationEvent) for the clientside version.
1373
+ *
1374
+ * @realm server
1375
+ * @source https://wiki.facepunch.com/gmod/GM:PlayerHandleAnimEvent
1376
+ */
1377
+ Add(eventName: "PlayerHandleAnimEvent", identifier: any, func: (ply: Player, event: number, eventTime: number, cycle: number, type: number, options: string) => void): void;
1378
+ /**
1379
+ * Called when a player gets hurt.
1380
+ * @realm server
1381
+ * @source https://wiki.facepunch.com/gmod/GM:PlayerHurt
1382
+ */
1383
+ Add(eventName: "PlayerHurt", identifier: any, func: (victim: Player, attacker: Entity, healthRemaining: number, damageTaken: number) => void): void;
1384
+ /**
1385
+ * Called when the player spawns for the first time.
1386
+ *
1387
+ * See [GM:PlayerSpawn](https://wiki.facepunch.com/gmod/GM:PlayerSpawn) for a hook called every player spawn.
1388
+ *
1389
+ * **NOTE**: This hook is called before the player has fully loaded, when the player is still in seeing the `Starting Lua` screen. For example, trying to use the [Entity:GetModel](https://wiki.facepunch.com/gmod/Entity:GetModel) function will return the default model (`models/player.mdl`).
1390
+ *
1391
+ *
1392
+ * **WARNING**: Sending [net](https://wiki.facepunch.com/gmod/net) messages to the spawned player in this hook may cause them to be received before the player finishes loading, for example [Global.LocalPlayer](https://wiki.facepunch.com/gmod/Global.LocalPlayer) might return NULL since [GM:InitPostEntity](https://wiki.facepunch.com/gmod/GM:InitPostEntity) may have not been called yet clientside though the net message **won't** be lost and the client still should receive it (more information here: https://github.com/Facepunch/garrysmod-requests/issues/718).
1393
+ *
1394
+ * Workaround without networking:
1395
+ * ```
1396
+ * local load_queue = {}
1397
+ *
1398
+ * hook.Add( "PlayerInitialSpawn", "myAddonName/Load", function( ply )
1399
+ * load_queue[ ply ] = true
1400
+ * end )
1401
+ *
1402
+ * hook.Add( "StartCommand", "myAddonName/Load", function( ply, cmd )
1403
+ * if load_queue[ ply ] and not cmd:IsForced() then
1404
+ * load_queue[ ply ] = nil
1405
+ *
1406
+ * -- Send what you need here if it requires the client to be fully loaded!
1407
+ * end
1408
+ * end )
1409
+ * ```
1410
+ *
1411
+ *
1412
+ * With networking:
1413
+ * ```
1414
+ * -- CLIENT
1415
+ * hook.Add( "InitPostEntity", "Ready", function()
1416
+ * net.Start( "cool_addon_client_ready" )
1417
+ * net.SendToServer()
1418
+ * end )
1419
+ * ```
1420
+ * ```
1421
+ * -- SERVER
1422
+ * util.AddNetworkString( "cool_addon_client_ready" )
1423
+ *
1424
+ * net.Receive( "cool_addon_client_ready", function( len, ply )
1425
+ * -- Send what you need here!
1426
+ * end )
1427
+ * ```
1428
+ *
1429
+ *
1430
+ * @realm server
1431
+ * @source https://wiki.facepunch.com/gmod/GM:PlayerInitialSpawn
1432
+ */
1433
+ Add(eventName: "PlayerInitialSpawn", identifier: any, func: (player: Player, transition: boolean) => void): void;
1434
+ /**
1435
+ * Makes the player join a specified team. This is a convenience function that calls [Player:SetTeam](https://wiki.facepunch.com/gmod/Player:SetTeam) and runs the [GM:OnPlayerChangedTeam](https://wiki.facepunch.com/gmod/GM:OnPlayerChangedTeam) hook.
1436
+ * @realm server
1437
+ * @source https://wiki.facepunch.com/gmod/GM:PlayerJoinTeam
1438
+ */
1439
+ Add(eventName: "PlayerJoinTeam", identifier: any, func: (ply: Player, team: number) => void): void;
1440
+ /**
1441
+ * Called when a player leaves a vehicle for any reason, including [Player:ExitVehicle](https://wiki.facepunch.com/gmod/Player:ExitVehicle).
1442
+ *
1443
+ * See [GM:PlayerEnteredVehicle](https://wiki.facepunch.com/gmod/GM:PlayerEnteredVehicle) for the opposite hook.
1444
+ *
1445
+ * **NOTE**: For vehicles with exit animations, this will be called **at the end** of the animation, **not at the start**!
1446
+ *
1447
+ *
1448
+ * @realm server
1449
+ * @source https://wiki.facepunch.com/gmod/GM:PlayerLeaveVehicle
1450
+ */
1451
+ Add(eventName: "PlayerLeaveVehicle", identifier: any, func: (ply: Player, veh: Vehicle) => void): void;
1452
+ /**
1453
+ * Called to give players the default set of weapons.
1454
+ *
1455
+ *
1456
+ * **NOTE**: This function may not work in your custom gamemode if you have overridden your [GM:PlayerSpawn](https://wiki.facepunch.com/gmod/GM:PlayerSpawn) and you do not use self.BaseClass.PlayerSpawn or [hook.Call](https://wiki.facepunch.com/gmod/hook.Call).
1457
+ *
1458
+ *
1459
+ * @realm server
1460
+ * @source https://wiki.facepunch.com/gmod/GM:PlayerLoadout
1461
+ */
1462
+ Add(eventName: "PlayerLoadout", identifier: any, func: (ply: Player) => void): void;
1463
+ /**
1464
+ * Called when a player tries to switch noclip mode.
1465
+ *
1466
+ * [MOVETYPE_NOCLIP](https://wiki.facepunch.com/gmod/Enums/MOVETYPE#MOVETYPE_NOCLIP) can be used to determine if a player is currently in noclip mode.
1467
+ *
1468
+ * @realm shared
1469
+ * @source https://wiki.facepunch.com/gmod/GM:PlayerNoClip
1470
+ */
1471
+ Add(eventName: "PlayerNoClip", identifier: any, func: (ply: Player, desiredState: boolean) => boolean): void;
1472
+ /**
1473
+ * Called after the player's think, just after [GM:FinishMove](https://wiki.facepunch.com/gmod/GM:FinishMove).
1474
+ *
1475
+ *
1476
+ * **NOTE**: On the client side, it is only called for the local player.
1477
+ *
1478
+ *
1479
+ * @realm shared
1480
+ * @source https://wiki.facepunch.com/gmod/GM:PlayerPostThink
1481
+ */
1482
+ Add(eventName: "PlayerPostThink", identifier: any, func: (ply: Player) => void): void;
1483
+ /**
1484
+ * Request a player to join the team. This function will check if the team is available to join or not.
1485
+ *
1486
+ * This hook is called when the player runs "changeteam" in the console.
1487
+ *
1488
+ * To prevent the player from changing teams, see [GM:PlayerCanJoinTeam](https://wiki.facepunch.com/gmod/GM:PlayerCanJoinTeam)
1489
+ *
1490
+ * @realm server
1491
+ * @source https://wiki.facepunch.com/gmod/GM:PlayerRequestTeam
1492
+ */
1493
+ Add(eventName: "PlayerRequestTeam", identifier: any, func: (ply: Player, team: number) => void): void;
1494
+ /**
1495
+ * Called when a player dispatched a chat message. For the clientside equivalent, see [GM:OnPlayerChat](https://wiki.facepunch.com/gmod/GM:OnPlayerChat).
1496
+ *
1497
+ * **NOTE**: It may be more reliable to use [gameevent/player_say](https://wiki.facepunch.com/gmod/gameevent/player_say) to read messages serverside because addons commonly return values in this hook to change chat messages.
1498
+ *
1499
+ *
1500
+ * @realm server
1501
+ * @source https://wiki.facepunch.com/gmod/GM:PlayerSay
1502
+ */
1503
+ Add(eventName: "PlayerSay", identifier: any, func: (sender: Player, text: string, teamChat: boolean) => string): void;
1504
+ /**
1505
+ * Called to determine a spawn point for a player to spawn at.
1506
+ * **NOTE**: The spawn point entity will also impact the player's eye angle. For example, if the entity is upside down, the player's view will be as well.
1507
+ *
1508
+ *
1509
+ * @realm server
1510
+ * @source https://wiki.facepunch.com/gmod/GM:PlayerSelectSpawn
1511
+ */
1512
+ Add(eventName: "PlayerSelectSpawn", identifier: any, func: (ply: Player, transition: boolean) => Entity): void;
1513
+ /**
1514
+ * Find a team spawn point entity for this player.
1515
+ * @realm server
1516
+ * @source https://wiki.facepunch.com/gmod/GM:PlayerSelectTeamSpawn
1517
+ */
1518
+ Add(eventName: "PlayerSelectTeamSpawn", identifier: any, func: (team: number, ply: Player) => Entity): void;
1519
+ /**
1520
+ * Called whenever view model hands needs setting a model. By default this calls [PLAYER:GetHandsModel](https://wiki.facepunch.com/gmod/PLAYER:GetHandsModel) and if that fails, sets the hands model according to his player model.
1521
+ * @realm server
1522
+ * @source https://wiki.facepunch.com/gmod/GM:PlayerSetHandsModel
1523
+ */
1524
+ Add(eventName: "PlayerSetHandsModel", identifier: any, func: (ply: Player, ent: Entity) => void): void;
1525
+ /**
1526
+ * Called whenever a player spawns and must choose a model. A good place to assign a model to a player.
1527
+ * **NOTE**: This function may not work in your custom gamemode if you have overridden your [GM:PlayerSpawn](https://wiki.facepunch.com/gmod/GM:PlayerSpawn) and you do not use [self.BaseClass.PlayerSpawn](https://wiki.facepunch.com/gmod/Global.DEFINE_BASECLASS) in it, or [hook.Call](https://wiki.facepunch.com/gmod/hook.Call) this hook from [GM:PlayerSpawn](https://wiki.facepunch.com/gmod/GM:PlayerSpawn).
1528
+ *
1529
+ *
1530
+ * @realm server
1531
+ * @source https://wiki.facepunch.com/gmod/GM:PlayerSetModel
1532
+ */
1533
+ Add(eventName: "PlayerSetModel", identifier: any, func: (ply: Player) => void): void;
1534
+ /**
1535
+ * Returns true if the player should take damage from the given attacker.
1536
+ *
1537
+ * **WARNING**: Applying damage from this hook to the player taking damage will lead to infinite loop/crash.
1538
+ *
1539
+ *
1540
+ * @realm server
1541
+ * @source https://wiki.facepunch.com/gmod/GM:PlayerShouldTakeDamage
1542
+ */
1543
+ Add(eventName: "PlayerShouldTakeDamage", identifier: any, func: (ply: Player, attacker: Entity) => boolean): void;
1544
+ /**
1545
+ * Allows to suppress player taunts.
1546
+ * @realm server
1547
+ * @source https://wiki.facepunch.com/gmod/GM:PlayerShouldTaunt
1548
+ */
1549
+ Add(eventName: "PlayerShouldTaunt", identifier: any, func: (ply: Player, act: number) => boolean): void;
1550
+ /**
1551
+ * Called when the player is killed by [Player:KillSilent](https://wiki.facepunch.com/gmod/Player:KillSilent).
1552
+ *
1553
+ * The player is already considered dead when this hook is called.
1554
+ *
1555
+ * * See [GM:PlayerDeath](https://wiki.facepunch.com/gmod/GM:PlayerDeath) for a hook which handles all other death causes.
1556
+ * * [GM:PostPlayerDeath](https://wiki.facepunch.com/gmod/GM:PostPlayerDeath) is called **after** this hook.
1557
+ *
1558
+ * **NOTE**: [Player:Alive](https://wiki.facepunch.com/gmod/Player:Alive) will return true in this hook.
1559
+ *
1560
+ *
1561
+ * @realm server
1562
+ * @source https://wiki.facepunch.com/gmod/GM:PlayerSilentDeath
1563
+ */
1564
+ Add(eventName: "PlayerSilentDeath", identifier: any, func: (ply: Player) => void): void;
1565
+ /**
1566
+ * Called whenever a player spawns, including respawns.
1567
+ *
1568
+ * See [GM:PlayerInitialSpawn](https://wiki.facepunch.com/gmod/GM:PlayerInitialSpawn) for a hook called only the first time a player spawns.
1569
+ *
1570
+ * See the [player_spawn gameevent](https://wiki.facepunch.com/gmod/gameevent/player_spawn) for a shared version of this hook.
1571
+ *
1572
+ * **WARNING**: By default, in "base" derived gamemodes, this hook will also call [GM:PlayerLoadout](https://wiki.facepunch.com/gmod/GM:PlayerLoadout) and [GM:PlayerSetModel](https://wiki.facepunch.com/gmod/GM:PlayerSetModel), which may override your [Entity:SetModel](https://wiki.facepunch.com/gmod/Entity:SetModel) and [Player:Give](https://wiki.facepunch.com/gmod/Player:Give) calls. Consider using the other hooks or a 0-second timer.
1573
+ *
1574
+ *
1575
+ * @realm server
1576
+ * @source https://wiki.facepunch.com/gmod/GM:PlayerSpawn
1577
+ */
1578
+ Add(eventName: "PlayerSpawn", identifier: any, func: (player: Player, transition: boolean) => void): void;
1579
+ /**
1580
+ * Called to spawn the player as a spectator.
1581
+ * @realm server
1582
+ * @source https://wiki.facepunch.com/gmod/GM:PlayerSpawnAsSpectator
1583
+ */
1584
+ Add(eventName: "PlayerSpawnAsSpectator", identifier: any, func: (ply: Player) => void): void;
1585
+ /**
1586
+ * Determines if the player can spray using the `impulse 201` console command.
1587
+ * @realm server
1588
+ * @source https://wiki.facepunch.com/gmod/GM:PlayerSpray
1589
+ */
1590
+ Add(eventName: "PlayerSpray", identifier: any, func: (sprayer: Player) => boolean): void;
1591
+ /**
1592
+ * Called when player starts taunting.
1593
+ * @realm server
1594
+ * @source https://wiki.facepunch.com/gmod/GM:PlayerStartTaunt
1595
+ */
1596
+ Add(eventName: "PlayerStartTaunt", identifier: any, func: (ply: Player, act: number, length: number) => void): void;
1597
+ /**
1598
+ * Called when a player starts using voice chat.
1599
+ * **NOTE**: Set mp_show_voice_icons to 0, if you want disable icons above player.
1600
+ *
1601
+ *
1602
+ * @realm client
1603
+ * @source https://wiki.facepunch.com/gmod/GM:PlayerStartVoice
1604
+ */
1605
+ Add(eventName: "PlayerStartVoice", identifier: any, func: (ply: Player, plyIndex?: number) => boolean): void;
1606
+ /**
1607
+ * Allows you to override the time between footsteps.
1608
+ *
1609
+ * See [GM:PlayerFootstep](https://wiki.facepunch.com/gmod/GM:PlayerFootstep) for a related hook about footstep sounds themselves.
1610
+ * **NOTE**: This hook is called on all clients.
1611
+ *
1612
+ *
1613
+ * @realm shared
1614
+ * @source https://wiki.facepunch.com/gmod/GM:PlayerStepSoundTime
1615
+ */
1616
+ Add(eventName: "PlayerStepSoundTime", identifier: any, func: (ply: Player, type: number, walking: boolean) => number): void;
1617
+ /**
1618
+ * Called whenever a player attempts to either turn on or off their flashlight, returning false will deny the change.
1619
+ * **NOTE**: Also gets called when using [Player:Flashlight](https://wiki.facepunch.com/gmod/Player:Flashlight).
1620
+ *
1621
+ *
1622
+ *
1623
+ * @realm server
1624
+ * @source https://wiki.facepunch.com/gmod/GM:PlayerSwitchFlashlight
1625
+ */
1626
+ Add(eventName: "PlayerSwitchFlashlight", identifier: any, func: (ply: Player, enabled: boolean) => boolean): void;
1627
+ /**
1628
+ * Called when a player attempts to switch their weapon.
1629
+ *
1630
+ * Primary usage of this hook is to prevent/allow weapon switching, **not** to detect weapon switching. It will not be called for [Player:SetActiveWeapon](https://wiki.facepunch.com/gmod/Player:SetActiveWeapon).
1631
+ *
1632
+ * @realm shared
1633
+ * @source https://wiki.facepunch.com/gmod/GM:PlayerSwitchWeapon
1634
+ */
1635
+ Add(eventName: "PlayerSwitchWeapon", identifier: any, func: (player: Player, oldWeapon: Weapon, newWeapon: Weapon) => boolean): void;
1636
+ /**
1637
+ * The Move hook is called for you to manipulate the player's [CMoveData](https://wiki.facepunch.com/gmod/CMoveData). This hook is called moments before [GM:Move](https://wiki.facepunch.com/gmod/GM:Move) and [GM:PlayerNoClip](https://wiki.facepunch.com/gmod/GM:PlayerNoClip).
1638
+ *
1639
+ * **WARNING**: This hook will not run when inside a vehicle. [GM:VehicleMove](https://wiki.facepunch.com/gmod/GM:VehicleMove) will be called instead.
1640
+ *
1641
+ *
1642
+ * @realm shared
1643
+ * @source https://wiki.facepunch.com/gmod/GM:PlayerTick
1644
+ */
1645
+ Add(eventName: "PlayerTick", identifier: any, func: (player: Player, mv: CMoveData) => void): void;
1646
+ /**
1647
+ * Called when a player has been hit by a trace and damaged (such as from a bullet). Returning true overrides the damage handling and prevents [GM:ScalePlayerDamage](https://wiki.facepunch.com/gmod/GM:ScalePlayerDamage) from being called.
1648
+ * @realm shared
1649
+ * @source https://wiki.facepunch.com/gmod/GM:PlayerTraceAttack
1650
+ */
1651
+ Add(eventName: "PlayerTraceAttack", identifier: any, func: (ply: Player, dmginfo: CTakeDamageInfo, dir: Vector, trace: TraceResult) => boolean): void;
1652
+ /**
1653
+ * Called when a player unfreezes an object.
1654
+ * @realm server
1655
+ * @source https://wiki.facepunch.com/gmod/GM:PlayerUnfrozeObject
1656
+ */
1657
+ Add(eventName: "PlayerUnfrozeObject", identifier: any, func: (ply: Player, ent: Entity, physobj: PhysObj) => void): void;
1658
+ /**
1659
+ * Triggered when the player presses use on an object. Continuously runs until USE is released but will not activate other Entities until the USE key is released; dependent on activation type of the Entity.
1660
+ *
1661
+ * @realm server
1662
+ * @source https://wiki.facepunch.com/gmod/GM:PlayerUse
1663
+ */
1664
+ Add(eventName: "PlayerUse", identifier: any, func: (ply: Player, ent: Entity) => boolean): void;
1665
+ /**
1666
+ * Called when it's time to populate the context menu menu bar at the top.
1667
+ * @realm client
1668
+ * @source https://wiki.facepunch.com/gmod/GM:PopulateMenuBar
1669
+ */
1670
+ Add(eventName: "PopulateMenuBar", identifier: any, func: (menubar: Panel) => void): void;
1671
+ /**
1672
+ * Called right after the map has cleaned up (usually because [game.CleanUpMap](https://wiki.facepunch.com/gmod/game.CleanUpMap) was called)
1673
+ *
1674
+ * See also [GM:PreCleanupMap](https://wiki.facepunch.com/gmod/GM:PreCleanupMap).
1675
+ *
1676
+ * @realm shared
1677
+ * @source https://wiki.facepunch.com/gmod/GM:PostCleanupMap
1678
+ */
1679
+ Add(eventName: "PostCleanupMap", identifier: any, func: () => void): void;
1680
+ /**
1681
+ * Called right after the 2D skybox has been drawn - allowing you to draw over it.
1682
+ *
1683
+ *
1684
+ *
1685
+ * @realm client
1686
+ * @source https://wiki.facepunch.com/gmod/GM:PostDraw2DSkyBox
1687
+ */
1688
+ Add(eventName: "PostDraw2DSkyBox", identifier: any, func: () => void): void;
1689
+ /**
1690
+ * Called after rendering effects. This is where halos are drawn. Called just before [GM:PreDrawHUD](https://wiki.facepunch.com/gmod/GM:PreDrawHUD) (The two hooks are basically identical).
1691
+ *
1692
+ * See [GM:PreDrawEffects](https://wiki.facepunch.com/gmod/GM:PreDrawEffects) for the associated hook.
1693
+ *
1694
+ *
1695
+ *
1696
+ * @realm client
1697
+ * @source https://wiki.facepunch.com/gmod/GM:PostDrawEffects
1698
+ */
1699
+ Add(eventName: "PostDrawEffects", identifier: any, func: () => void): void;
1700
+ /**
1701
+ * Called after [GM:PreDrawHUD](https://wiki.facepunch.com/gmod/GM:PreDrawHUD), [GM:HUDPaintBackground](https://wiki.facepunch.com/gmod/GM:HUDPaintBackground) and [GM:HUDPaint](https://wiki.facepunch.com/gmod/GM:HUDPaint) but before [GM:DrawOverlay](https://wiki.facepunch.com/gmod/GM:DrawOverlay).
1702
+ *
1703
+ * Unlike [GM:HUDPaint](https://wiki.facepunch.com/gmod/GM:HUDPaint)([Background](https://wiki.facepunch.com/gmod/GM:HUDPaintBackground)) hooks, this will still be called when the main menu is visible. And so will be [GM:PreDrawHUD](https://wiki.facepunch.com/gmod/GM:PreDrawHUD)
1704
+ *
1705
+ *
1706
+ *
1707
+ * @realm client
1708
+ * @source https://wiki.facepunch.com/gmod/GM:PostDrawHUD
1709
+ */
1710
+ Add(eventName: "PostDrawHUD", identifier: any, func: () => void): void;
1711
+ /**
1712
+ * Called after drawing opaque entities.
1713
+ *
1714
+ * See also [GM:PostDrawTranslucentRenderables](https://wiki.facepunch.com/gmod/GM:PostDrawTranslucentRenderables) and [GM:PreDrawOpaqueRenderables](https://wiki.facepunch.com/gmod/GM:PreDrawOpaqueRenderables).
1715
+ *
1716
+ *
1717
+ *
1718
+ * @realm client
1719
+ * @source https://wiki.facepunch.com/gmod/GM:PostDrawOpaqueRenderables
1720
+ */
1721
+ Add(eventName: "PostDrawOpaqueRenderables", identifier: any, func: (bDrawingDepth: boolean, bDrawingSkybox: boolean, isDraw3DSkybox: boolean) => void): void;
1722
+ /**
1723
+ * Called after the player hands are drawn.
1724
+ *
1725
+ * See [GM:PostDrawViewModel](https://wiki.facepunch.com/gmod/GM:PostDrawViewModel) for the view model alternative.
1726
+ * See [GM:PreDrawPlayerHands](https://wiki.facepunch.com/gmod/GM:PreDrawPlayerHands) for a hook that is called just before view model hands are drawn.
1727
+ *
1728
+ *
1729
+ * @realm client
1730
+ * @source https://wiki.facepunch.com/gmod/GM:PostDrawPlayerHands
1731
+ */
1732
+ Add(eventName: "PostDrawPlayerHands", identifier: any, func: (hands: Entity, vm: Entity, ply: Player, weapon: Weapon, flags: number) => void): void;
1733
+ /**
1734
+ * Called after drawing the 3D skybox. This will not be called if skybox rendering was prevented via the [GM:PreDrawSkyBox](https://wiki.facepunch.com/gmod/GM:PreDrawSkyBox) hook.
1735
+ *
1736
+ * See also [GM:PostDraw2DSkyBox](https://wiki.facepunch.com/gmod/GM:PostDraw2DSkyBox).
1737
+ *
1738
+ *
1739
+ *
1740
+ * @realm client
1741
+ * @source https://wiki.facepunch.com/gmod/GM:PostDrawSkyBox
1742
+ */
1743
+ Add(eventName: "PostDrawSkyBox", identifier: any, func: () => void): void;
1744
+ /**
1745
+ * Called after all translucent entities are drawn.
1746
+ *
1747
+ * See also [GM:PostDrawOpaqueRenderables](https://wiki.facepunch.com/gmod/GM:PostDrawOpaqueRenderables) and [GM:PreDrawTranslucentRenderables](https://wiki.facepunch.com/gmod/GM:PreDrawTranslucentRenderables).
1748
+ *
1749
+ *
1750
+ *
1751
+ * This is still called when r_drawentities or r_drawopaquerenderables is disabled.
1752
+ * This is not called when r_drawtranslucentworld is disabled.
1753
+ *
1754
+ * @realm client
1755
+ * @source https://wiki.facepunch.com/gmod/GM:PostDrawTranslucentRenderables
1756
+ */
1757
+ Add(eventName: "PostDrawTranslucentRenderables", identifier: any, func: (bDrawingDepth: boolean, bDrawingSkybox: boolean, isDraw3DSkybox: boolean) => void): void;
1758
+ /**
1759
+ * Called after view model is drawn.
1760
+ *
1761
+ * The render FOV in this hook is different from the main view, as view models are usually rendered with a different FOV. Every render operation will only be accurate with the view model entity.
1762
+ *
1763
+ * See [GM:PreDrawViewModel](https://wiki.facepunch.com/gmod/GM:PreDrawViewModel) for a hook that is called just before a view model is drawn.
1764
+ *
1765
+ * For view model hands alternative, see [GM:PostDrawPlayerHands](https://wiki.facepunch.com/gmod/GM:PostDrawPlayerHands).
1766
+ *
1767
+ *
1768
+ *
1769
+ *
1770
+ * @realm client
1771
+ * @source https://wiki.facepunch.com/gmod/GM:PostDrawViewModel
1772
+ */
1773
+ Add(eventName: "PostDrawViewModel", identifier: any, func: (viewmodel: Entity, player: Player, weapon: Weapon, flags: number) => void): void;
1774
+ /**
1775
+ * Called every time a bullet pellet (i.e. this hook is called multiple times for a shotgun shot) is fired from an entity. Notably this hook will have the final damage and aim direction for the bullet pellet.
1776
+ *
1777
+ * See [GM:EntityFireBullets](https://wiki.facepunch.com/gmod/GM:EntityFireBullets) if you wish to modify the bullets before they are fired.
1778
+ *
1779
+ * **WARNING**: This hook is called directly from [Entity:FireBullets](https://wiki.facepunch.com/gmod/Entity:FireBullets). Due to this, you cannot call [Entity:FireBullets](https://wiki.facepunch.com/gmod/Entity:FireBullets) inside this hook or an infinite loop will occur crashing the game.
1780
+ *
1781
+ *
1782
+ * @realm shared
1783
+ * @source https://wiki.facepunch.com/gmod/GM:PostEntityFireBullets
1784
+ */
1785
+ Add(eventName: "PostEntityFireBullets", identifier: any, func: (entity: Entity, data: FiredBullet) => boolean): void;
1786
+ /**
1787
+ * Called when an entity receives a damage event, after passing damage filters, etc.
1788
+ *
1789
+ * See [GM:EntityTakeDamage](https://wiki.facepunch.com/gmod/GM:EntityTakeDamage) if you wish to prevent damage events, or otherwise alter them.
1790
+ *
1791
+ * **WARNING**: Applying damage from this hook to the entity taking damage will lead to infinite loop/crash.
1792
+ *
1793
+ *
1794
+ * @realm server
1795
+ * @source https://wiki.facepunch.com/gmod/GM:PostEntityTakeDamage
1796
+ */
1797
+ Add(eventName: "PostEntityTakeDamage", identifier: any, func: (ent: Entity, dmginfo: CTakeDamageInfo, wasDamageTaken: boolean) => void): void;
1798
+ /**
1799
+ * Called after the gamemode has loaded.
1800
+ * @realm shared
1801
+ * @source https://wiki.facepunch.com/gmod/GM:PostGamemodeLoaded
1802
+ */
1803
+ Add(eventName: "PostGamemodeLoaded", identifier: any, func: () => void): void;
1804
+ /**
1805
+ * Called right after [GM:DoPlayerDeath](https://wiki.facepunch.com/gmod/GM:DoPlayerDeath), [GM:PlayerDeath](https://wiki.facepunch.com/gmod/GM:PlayerDeath) and [GM:PlayerSilentDeath](https://wiki.facepunch.com/gmod/GM:PlayerSilentDeath).
1806
+ *
1807
+ * This hook will be called for all deaths, including [Player:KillSilent](https://wiki.facepunch.com/gmod/Player:KillSilent)
1808
+ *
1809
+ * **NOTE**: [Player:Alive](https://wiki.facepunch.com/gmod/Player:Alive) will return false in this hook.
1810
+ *
1811
+ *
1812
+ *
1813
+ * @realm server
1814
+ * @source https://wiki.facepunch.com/gmod/GM:PostPlayerDeath
1815
+ */
1816
+ Add(eventName: "PostPlayerDeath", identifier: any, func: (ply: Player) => void): void;
1817
+ /**
1818
+ * Called after a given player in your [PVS (Potential Visibility Set)](https://developer.valvesoftware.com/wiki/PVS "PVS - Valve Developer Community") was drawn.
1819
+ *
1820
+ * This hook will not be called if player was prevented from being drawn via [GM:PrePlayerDraw](https://wiki.facepunch.com/gmod/GM:PrePlayerDraw).
1821
+ *
1822
+ *
1823
+ * @realm client
1824
+ * @source https://wiki.facepunch.com/gmod/GM:PostPlayerDraw
1825
+ */
1826
+ Add(eventName: "PostPlayerDraw", identifier: any, func: (ply: Player, flags: number) => void): void;
1827
+ /**
1828
+ * Allows you to suppress post processing effect drawing.
1829
+ * @realm client
1830
+ * @source https://wiki.facepunch.com/gmod/GM:PostProcessPermitted
1831
+ */
1832
+ Add(eventName: "PostProcessPermitted", identifier: any, func: (effect_name: string) => boolean): void;
1833
+ /**
1834
+ * Called after the frame has been rendered.
1835
+ * @realm client
1836
+ * @source https://wiki.facepunch.com/gmod/GM:PostRender
1837
+ */
1838
+ Add(eventName: "PostRender", identifier: any, func: () => void): void;
1839
+ /**
1840
+ * Called after the VGUI has been drawn.
1841
+ *
1842
+ *
1843
+ *
1844
+ * @realm client
1845
+ * @source https://wiki.facepunch.com/gmod/GM:PostRenderVGUI
1846
+ */
1847
+ Add(eventName: "PostRenderVGUI", identifier: any, func: () => void): void;
1848
+ /**
1849
+ * Called just after performing an undo.
1850
+ * @realm server
1851
+ * @source https://wiki.facepunch.com/gmod/GM:PostUndo
1852
+ */
1853
+ Add(eventName: "PostUndo", identifier: any, func: (undo: Undo, count: number) => void): void;
1854
+ /**
1855
+ * Called right before the map cleans up (usually because [game.CleanUpMap](https://wiki.facepunch.com/gmod/game.CleanUpMap) was called)
1856
+ *
1857
+ * See also [GM:PostCleanupMap](https://wiki.facepunch.com/gmod/GM:PostCleanupMap).
1858
+ *
1859
+ * @realm shared
1860
+ * @source https://wiki.facepunch.com/gmod/GM:PreCleanupMap
1861
+ */
1862
+ Add(eventName: "PreCleanupMap", identifier: any, func: () => void): void;
1863
+ /**
1864
+ * Called just after [GM:PreDrawViewModel](https://wiki.facepunch.com/gmod/GM:PreDrawViewModel) and can technically be considered as a "PostDrawAllViewModels".
1865
+ *
1866
+ * See [GM:PostDrawEffects](https://wiki.facepunch.com/gmod/GM:PostDrawEffects) for the associated hook.
1867
+ *
1868
+ *
1869
+ *
1870
+ * @realm client
1871
+ * @source https://wiki.facepunch.com/gmod/GM:PreDrawEffects
1872
+ */
1873
+ Add(eventName: "PreDrawEffects", identifier: any, func: () => void): void;
1874
+ /**
1875
+ * Called before rendering the halos. This is the place to call [halo.Add](https://wiki.facepunch.com/gmod/halo.Add). This hook is actually running inside of [GM:PostDrawEffects](https://wiki.facepunch.com/gmod/GM:PostDrawEffects).
1876
+ *
1877
+ *
1878
+ *
1879
+ * @realm client
1880
+ * @source https://wiki.facepunch.com/gmod/GM:PreDrawHalos
1881
+ */
1882
+ Add(eventName: "PreDrawHalos", identifier: any, func: () => void): void;
1883
+ /**
1884
+ * Called just after [GM:PostDrawEffects](https://wiki.facepunch.com/gmod/GM:PostDrawEffects) (duplicate of it). Drawing anything in it seems to work incorrectly.
1885
+ *
1886
+ * See [GM:PostDrawHUD](https://wiki.facepunch.com/gmod/GM:PostDrawHUD) for the associated hook.
1887
+ *
1888
+ * @realm client
1889
+ * @source https://wiki.facepunch.com/gmod/GM:PreDrawHUD
1890
+ */
1891
+ Add(eventName: "PreDrawHUD", identifier: any, func: () => void): void;
1892
+ /**
1893
+ * Called before all opaque entities are drawn.
1894
+ *
1895
+ * See also [GM:PreDrawTranslucentRenderables](https://wiki.facepunch.com/gmod/GM:PreDrawTranslucentRenderables) and [GM:PostDrawOpaqueRenderables](https://wiki.facepunch.com/gmod/GM:PostDrawOpaqueRenderables).
1896
+ *
1897
+ *
1898
+ *
1899
+ * @realm client
1900
+ * @source https://wiki.facepunch.com/gmod/GM:PreDrawOpaqueRenderables
1901
+ */
1902
+ Add(eventName: "PreDrawOpaqueRenderables", identifier: any, func: (isDrawingDepth: boolean, isDrawSkybox: boolean, isDraw3DSkybox: boolean) => boolean): void;
1903
+ /**
1904
+ * Called before the player hands are drawn.
1905
+ *
1906
+ * See [GM:PreDrawViewModel](https://wiki.facepunch.com/gmod/GM:PreDrawViewModel) for the view model alternative.
1907
+ * See [GM:PostDrawPlayerHands](https://wiki.facepunch.com/gmod/GM:PostDrawPlayerHands) for a hook that is called just before view model hands are drawn.
1908
+ *
1909
+ * @realm client
1910
+ * @source https://wiki.facepunch.com/gmod/GM:PreDrawPlayerHands
1911
+ */
1912
+ Add(eventName: "PreDrawPlayerHands", identifier: any, func: (hands: Entity, vm: Entity, ply: Player, weapon: Weapon, flags: number) => boolean): void;
1913
+ /**
1914
+ * Called before the 3D sky box is drawn. This will not be called for maps with no 3D skybox, or when the 3d skybox is disabled. (`r_3dsky 0`)
1915
+ *
1916
+ * See also [GM:PostDrawSkyBox](https://wiki.facepunch.com/gmod/GM:PostDrawSkyBox)
1917
+ *
1918
+ *
1919
+ *
1920
+ * @realm client
1921
+ * @source https://wiki.facepunch.com/gmod/GM:PreDrawSkyBox
1922
+ */
1923
+ Add(eventName: "PreDrawSkyBox", identifier: any, func: () => boolean): void;
1924
+ /**
1925
+ * Called before all the translucent entities are drawn.
1926
+ *
1927
+ * See also [GM:PreDrawOpaqueRenderables](https://wiki.facepunch.com/gmod/GM:PreDrawOpaqueRenderables) and [GM:PostDrawTranslucentRenderables](https://wiki.facepunch.com/gmod/GM:PostDrawTranslucentRenderables).
1928
+ *
1929
+ *
1930
+ *
1931
+ * This is still called when r_drawentities or r_drawopaquerenderables is disabled.
1932
+ * This is not called when r_drawtranslucentworld is disabled.
1933
+ *
1934
+ * @realm client
1935
+ * @source https://wiki.facepunch.com/gmod/GM:PreDrawTranslucentRenderables
1936
+ */
1937
+ Add(eventName: "PreDrawTranslucentRenderables", identifier: any, func: (isDrawingDepth: boolean, isDrawSkybox: boolean, isDraw3DSkybox: boolean) => boolean): void;
1938
+ /**
1939
+ * Called before the view model has been drawn.
1940
+ *
1941
+ * By default this hook also calls [WEAPON:PreDrawViewModel](https://wiki.facepunch.com/gmod/WEAPON:PreDrawViewModel), so you can use that if developing a scripted weapon.
1942
+ *
1943
+ * See [GM:PostDrawViewModel](https://wiki.facepunch.com/gmod/GM:PostDrawViewModel) for a hook that runs immediately after rendering a view model.
1944
+ * See [GM:PreDrawViewModels](https://wiki.facepunch.com/gmod/GM:PreDrawViewModels) for a hook that runs before **all** view models are drawn within a frame.
1945
+ *
1946
+ * For view model hands, see [GM:PreDrawPlayerHands](https://wiki.facepunch.com/gmod/GM:PreDrawPlayerHands).
1947
+ *
1948
+ *
1949
+ *
1950
+ * @realm client
1951
+ * @source https://wiki.facepunch.com/gmod/GM:PreDrawViewModel
1952
+ */
1953
+ Add(eventName: "PreDrawViewModel", identifier: any, func: (vm: Entity, ply: Player, weapon: Weapon, flags: number) => boolean): void;
1954
+ /**
1955
+ * Called just before all view models (there are 3 per player, see [Player:GetViewModel](https://wiki.facepunch.com/gmod/Player:GetViewModel)) and entities with `RENDERGROUP_VIEWMODEL` are drawn.
1956
+ *
1957
+ * See [GM:PreDrawViewModel](https://wiki.facepunch.com/gmod/GM:PreDrawViewModel) and [GM:PostDrawViewModel](https://wiki.facepunch.com/gmod/GM:PostDrawViewModel) for hooks that run for specific view models.
1958
+ *
1959
+ * You can use [GM:PreDrawEffects](https://wiki.facepunch.com/gmod/GM:PreDrawEffects) as a "`PostDrawViewModels`" hook as it is called just after the all the view model(s) are drawn.
1960
+ *
1961
+ *
1962
+ *
1963
+ * @realm client
1964
+ * @source https://wiki.facepunch.com/gmod/GM:PreDrawViewModels
1965
+ */
1966
+ Add(eventName: "PreDrawViewModels", identifier: any, func: () => void): void;
1967
+ /**
1968
+ * Called before the gamemode is loaded.
1969
+ * @realm shared
1970
+ * @source https://wiki.facepunch.com/gmod/GM:PreGamemodeLoaded
1971
+ */
1972
+ Add(eventName: "PreGamemodeLoaded", identifier: any, func: () => void): void;
1973
+ /**
1974
+ * Called before the player is drawn.
1975
+ *
1976
+ * See also [GM:PostPlayerDraw](https://wiki.facepunch.com/gmod/GM:PostPlayerDraw).
1977
+ *
1978
+ * @realm client
1979
+ * @source https://wiki.facepunch.com/gmod/GM:PrePlayerDraw
1980
+ */
1981
+ Add(eventName: "PrePlayerDraw", identifier: any, func: (player: Player, flags: number) => boolean): void;
1982
+ /**
1983
+ * Called by [scripted_ents.Register](https://wiki.facepunch.com/gmod/scripted_ents.Register).
1984
+ *
1985
+ * @realm shared
1986
+ * @source https://wiki.facepunch.com/gmod/GM:PreRegisterSENT
1987
+ */
1988
+ Add(eventName: "PreRegisterSENT", identifier: any, func: (ent: table, _class: string) => boolean): void;
1989
+ /**
1990
+ * Called when a Scripted Weapon (SWEP) is about to be registered, allowing addons to alter the weapon's SWEP table with custom data for later usage. Called internally from [weapons.Register](https://wiki.facepunch.com/gmod/weapons.Register).
1991
+ *
1992
+ * @realm shared
1993
+ * @source https://wiki.facepunch.com/gmod/GM:PreRegisterSWEP
1994
+ */
1995
+ Add(eventName: "PreRegisterSWEP", identifier: any, func: (swep: table, _class: string) => boolean): void;
1996
+ /**
1997
+ * Called before the renderer is about to start rendering the next frame.
1998
+ * @realm client
1999
+ * @source https://wiki.facepunch.com/gmod/GM:PreRender
2000
+ */
2001
+ Add(eventName: "PreRender", identifier: any, func: () => boolean): void;
2002
+ /**
2003
+ * Called just before performing an undo.
2004
+ * @realm server
2005
+ * @source https://wiki.facepunch.com/gmod/GM:PreUndo
2006
+ */
2007
+ Add(eventName: "PreUndo", identifier: any, func: (undo: Undo) => boolean): void;
2008
+ /**
2009
+ * This will prevent IN_ATTACK from sending to server when player tries to shoot from C menu.
2010
+ * @realm client
2011
+ * @source https://wiki.facepunch.com/gmod/GM:PreventScreenClicks
2012
+ */
2013
+ Add(eventName: "PreventScreenClicks", identifier: any, func: () => boolean): void;
2014
+ /**
2015
+ * Called when a prop has been destroyed.
2016
+ * @realm shared
2017
+ * @source https://wiki.facepunch.com/gmod/GM:PropBreak
2018
+ */
2019
+ Add(eventName: "PropBreak", identifier: any, func: (attacker: Player, prop: Entity) => void): void;
2020
+ /**
2021
+ * Render the scene. Used by the `Stereoscopy` post-processing effect.
2022
+ *
2023
+ * **NOTE**: Materials rendered in this hook require `$ignorez` parameter to draw properly.
2024
+ *
2025
+ *
2026
+ * @realm client
2027
+ * @source https://wiki.facepunch.com/gmod/GM:RenderScene
2028
+ */
2029
+ Add(eventName: "RenderScene", identifier: any, func: (origin: Vector, angles: Angle, fov: number) => boolean): void;
2030
+ /**
2031
+ * Used to render post processing effects.
2032
+ *
2033
+ *
2034
+ *
2035
+ * @realm client
2036
+ * @source https://wiki.facepunch.com/gmod/GM:RenderScreenspaceEffects
2037
+ */
2038
+ Add(eventName: "RenderScreenspaceEffects", identifier: any, func: () => void): void;
2039
+ /**
2040
+ * Called when the game is reloaded from a Source Engine save system ( not the Sandbox saves or dupes ).
2041
+ *
2042
+ * See [GM:Saved](https://wiki.facepunch.com/gmod/GM:Saved) for a hook that is called when such a save file is created.
2043
+ *
2044
+ * @realm shared
2045
+ * @source https://wiki.facepunch.com/gmod/GM:Restored
2046
+ */
2047
+ Add(eventName: "Restored", identifier: any, func: () => void): void;
2048
+ /**
2049
+ * Called when the game is saved using the Source Engine save system (not the Sandbox saves or dupes).
2050
+ *
2051
+ * See [GM:Restored](https://wiki.facepunch.com/gmod/GM:Restored) for a hook that is called when such a save file is loaded.
2052
+ *
2053
+ * See also the [saverestore](https://wiki.facepunch.com/gmod/saverestore) for relevant functions.
2054
+ *
2055
+ * @realm shared
2056
+ * @source https://wiki.facepunch.com/gmod/GM:Saved
2057
+ */
2058
+ Add(eventName: "Saved", identifier: any, func: () => void): void;
2059
+ /**
2060
+ * Called when an NPC takes damage.
2061
+ *
2062
+ * **NOTE**: This hook is called only when a specific hit group of the NPC is hit. In cases where the hitgroup doesn't matter, you should use [GM:EntityTakeDamage](https://wiki.facepunch.com/gmod/GM:EntityTakeDamage) instead!
2063
+ *
2064
+ *
2065
+ * @realm server
2066
+ * @source https://wiki.facepunch.com/gmod/GM:ScaleNPCDamage
2067
+ */
2068
+ Add(eventName: "ScaleNPCDamage", identifier: any, func: (npc: NPC, hitgroup: number, dmginfo: CTakeDamageInfo) => void): void;
2069
+ /**
2070
+ * This hook allows you to change how much damage a player receives when one takes damage to a specific body part.
2071
+ *
2072
+ * **NOTE**: This is called only for bullet damage a player receives, you should use [GM:EntityTakeDamage](https://wiki.facepunch.com/gmod/GM:EntityTakeDamage) instead if you need to detect **ALL** damage.
2073
+ *
2074
+ *
2075
+ * @realm shared
2076
+ * @source https://wiki.facepunch.com/gmod/GM:ScalePlayerDamage
2077
+ */
2078
+ Add(eventName: "ScalePlayerDamage", identifier: any, func: (ply: Player, hitgroup: number, dmginfo: CTakeDamageInfo) => boolean): void;
2079
+ /**
2080
+ * Called when player released the scoreboard button (TAB by default).
2081
+ * @realm client
2082
+ * @source https://wiki.facepunch.com/gmod/GM:ScoreboardHide
2083
+ */
2084
+ Add(eventName: "ScoreboardHide", identifier: any, func: () => void): void;
2085
+ /**
2086
+ * Called when player presses the scoreboard button (TAB by default).
2087
+ * @realm client
2088
+ * @source https://wiki.facepunch.com/gmod/GM:ScoreboardShow
2089
+ */
2090
+ Add(eventName: "ScoreboardShow", identifier: any, func: () => boolean): void;
2091
+ /**
2092
+ * An internal function used to send a death notice event to all clients.
2093
+ *
2094
+ * @realm server
2095
+ * @source https://wiki.facepunch.com/gmod/GM:SendDeathNotice
2096
+ */
2097
+ Add(eventName: "SendDeathNotice", identifier: any, func: (attacker: Entity | string | nil, inflictor: string, victim: Entity | string, flags: number) => void): void;
2098
+ /**
2099
+ * Sets player run and sprint speeds.
2100
+ * Using a speed of `0` can lead to prediction errors, and can cause players to move at `sv_maxvelocity`
2101
+ * **WARNING**: This is not a hook. Treat this as a utility function to set the player's speed.
2102
+ *
2103
+ *
2104
+ * @realm shared
2105
+ * @source https://wiki.facepunch.com/gmod/GM:SetPlayerSpeed
2106
+ */
2107
+ Add(eventName: "SetPlayerSpeed", identifier: any, func: (ply: Player, walkSpeed: number, runSpeed: number) => void): void;
2108
+ /**
2109
+ * SetupMove is called before the engine process movements. This allows us to override the players movement.
2110
+ *
2111
+ * See [Game Movement](https://wiki.facepunch.com/gmod/Game_Movement) for an explanation on the move system.
2112
+ *
2113
+ * @realm shared
2114
+ * @source https://wiki.facepunch.com/gmod/GM:SetupMove
2115
+ */
2116
+ Add(eventName: "SetupMove", identifier: any, func: (ply: Player, mv: CMoveData, cmd: CUserCmd) => void): void;
2117
+ /**
2118
+ * Allows you to add extra positions to the player's [PVS (Potential Visibility Set)](https://developer.valvesoftware.com/wiki/PVS "PVS - Valve Developer Community"). This is the place to call [Global.AddOriginToPVS](https://wiki.facepunch.com/gmod/Global.AddOriginToPVS).
2119
+ * @realm server
2120
+ * @source https://wiki.facepunch.com/gmod/GM:SetupPlayerVisibility
2121
+ */
2122
+ Add(eventName: "SetupPlayerVisibility", identifier: any, func: (ply: Player, viewEntity: Entity) => void): void;
2123
+ /**
2124
+ * Allows you to use render.Fog* functions to manipulate skybox fog.
2125
+ * This will not be called for maps with no 3D skybox, or when the 3d skybox is disabled. (`r_3dsky 0`)
2126
+ *
2127
+ * @realm client
2128
+ * @source https://wiki.facepunch.com/gmod/GM:SetupSkyboxFog
2129
+ */
2130
+ Add(eventName: "SetupSkyboxFog", identifier: any, func: (scale: number) => boolean): void;
2131
+ /**
2132
+ * Allows you to use render.Fog* functions to manipulate world fog.
2133
+ * @realm client
2134
+ * @source https://wiki.facepunch.com/gmod/GM:SetupWorldFog
2135
+ */
2136
+ Add(eventName: "SetupWorldFog", identifier: any, func: () => boolean): void;
2137
+ /**
2138
+ * Called to decide whether a pair of entities should collide with each other. This is only called if [Entity:SetCustomCollisionCheck](https://wiki.facepunch.com/gmod/Entity:SetCustomCollisionCheck) was used on one or both entities.
2139
+ *
2140
+ * Where applicable, consider using [constraint.NoCollide](https://wiki.facepunch.com/gmod/constraint.NoCollide) or a [logic_collision_pair](https://developer.valvesoftware.com/wiki/Logic_collision_pair) entity instead - they are considerably easier to use and may be more appropriate in some situations.
2141
+ *
2142
+ * **WARNING**: This hook **must** return the same value consistently for the same pair of entities.
2143
+ * If an entity changed in such a way that its collision rules change, you **must** call [Entity:CollisionRulesChanged](https://wiki.facepunch.com/gmod/Entity:CollisionRulesChanged) on that entity immediately - **not in this hook and not in physics callbacks.**
2144
+ * As long as you religiously follow the rules set by the examples this hook will work reliably without breaking, even a small mistake might break physics.
2145
+ *
2146
+ *
2147
+ * This hook can cause all physics to break under certain conditions.
2148
+ *
2149
+ * @realm shared
2150
+ * @source https://wiki.facepunch.com/gmod/GM:ShouldCollide
2151
+ */
2152
+ Add(eventName: "ShouldCollide", identifier: any, func: (ent1: Entity, ent2: Entity) => boolean): void;
2153
+ /**
2154
+ * Called to determine if the [Global.LocalPlayer](https://wiki.facepunch.com/gmod/Global.LocalPlayer) should be drawn.
2155
+ *
2156
+ * If you're using this hook to draw a player for a [GM:CalcView](https://wiki.facepunch.com/gmod/GM:CalcView) hook, then you may want to consider using the `drawviewer` variable you can use in your [Structures/CamData](https://wiki.facepunch.com/gmod/Structures/CamData) table instead.
2157
+ *
2158
+ * **NOTE**: This hook has an internal cache that is reset at the start of every frame. This will prevent this hook from running in certain cases. This cache is reset in [cam.Start](https://wiki.facepunch.com/gmod/cam.Start) and in a future update in [render.RenderView](https://wiki.facepunch.com/gmod/render.RenderView) when rendering extra views.
2159
+ *
2160
+ *
2161
+ * @realm client
2162
+ * @source https://wiki.facepunch.com/gmod/GM:ShouldDrawLocalPlayer
2163
+ */
2164
+ Add(eventName: "ShouldDrawLocalPlayer", identifier: any, func: (ply: Player) => boolean): void;
2165
+ /**
2166
+ * Called when a player executes `gm_showhelp` console command. (Default bind is F1)
2167
+ *
2168
+ * @realm shared
2169
+ * @source https://wiki.facepunch.com/gmod/GM:ShowHelp
2170
+ */
2171
+ Add(eventName: "ShowHelp", identifier: any, func: (ply: Player) => void): void;
2172
+ /**
2173
+ * Called when a player executes `gm_showspare1` console command ( Default bind is F3 ).
2174
+ * @realm shared
2175
+ * @source https://wiki.facepunch.com/gmod/GM:ShowSpare1
2176
+ */
2177
+ Add(eventName: "ShowSpare1", identifier: any, func: (ply: Player) => void): void;
2178
+ /**
2179
+ * Called when a player executes `gm_showspare2` console command ( Default bind is F4 ).
2180
+ * @realm shared
2181
+ * @source https://wiki.facepunch.com/gmod/GM:ShowSpare2
2182
+ */
2183
+ Add(eventName: "ShowSpare2", identifier: any, func: (ply: Player) => void): void;
2184
+ /**
2185
+ * Called when a player executes `gm_showteam` console command. ( Default bind is F2 )
2186
+ * @realm shared
2187
+ * @source https://wiki.facepunch.com/gmod/GM:ShowTeam
2188
+ */
2189
+ Add(eventName: "ShowTeam", identifier: any, func: (ply: Player) => void): void;
2190
+ /**
2191
+ * Called whenever the Lua environment is about to be shut down, for example on map change, or when the server is going to shut down.
2192
+ *
2193
+ * @realm shared
2194
+ * @source https://wiki.facepunch.com/gmod/GM:ShutDown
2195
+ */
2196
+ Add(eventName: "ShutDown", identifier: any, func: () => void): void;
2197
+ /**
2198
+ * Called when spawn icon is generated.
2199
+ * @realm client
2200
+ * @source https://wiki.facepunch.com/gmod/GM:SpawniconGenerated
2201
+ */
2202
+ Add(eventName: "SpawniconGenerated", identifier: any, func: (lastmodel: string, imagename: string, modelsleft: number) => void): void;
2203
+ /**
2204
+ * Called when the Spawnmenu is Created.
2205
+ * @realm client
2206
+ * @source https://wiki.facepunch.com/gmod/GM:SpawnMenuCreated
2207
+ */
2208
+ Add(eventName: "SpawnMenuCreated", identifier: any, func: () => void): void;
2209
+ /**
2210
+ * Runs when the user tries to open the chat box.
2211
+ *
2212
+ * **WARNING**: Returning `true` won't stop the chatbox from taking VGUI focus. [chat.Close](https://wiki.facepunch.com/gmod/chat.Close) may be of use to mitigate that, or usage of [GM:PlayerBindPress](https://wiki.facepunch.com/gmod/GM:PlayerBindPress).
2213
+ *
2214
+ *
2215
+ * @realm client
2216
+ * @source https://wiki.facepunch.com/gmod/GM:StartChat
2217
+ */
2218
+ Add(eventName: "StartChat", identifier: any, func: (isTeamChat: boolean) => boolean): void;
2219
+ /**
2220
+ * Allows you to change the players inputs before they are processed by the server. This function is also called for bots, making it the best solution to control them.
2221
+ *
2222
+ * This is basically a shared version of [GM:CreateMove](https://wiki.facepunch.com/gmod/GM:CreateMove).
2223
+ *
2224
+ *
2225
+ * **NOTE**: This hook is predicted, but not by usual means, it is called when a [CUserCmd](https://wiki.facepunch.com/gmod/CUserCmd) is generated on the client, and on the server when it is received, so it is necessary for this hook to be called clientside even on singleplayer
2226
+ *
2227
+ *
2228
+ * @realm shared
2229
+ * @source https://wiki.facepunch.com/gmod/GM:StartCommand
2230
+ */
2231
+ Add(eventName: "StartCommand", identifier: any, func: (ply: Player, ucmd: CUserCmd) => void): void;
2232
+ /**
2233
+ * Called right before an entity starts driving. Overriding this hook will cause it to not call [drive.Start](https://wiki.facepunch.com/gmod/drive.Start) and the player will not begin driving the entity.
2234
+ * @realm shared
2235
+ * @source https://wiki.facepunch.com/gmod/GM:StartEntityDriving
2236
+ */
2237
+ Add(eventName: "StartEntityDriving", identifier: any, func: (ent: Entity, ply: Player) => void): void;
2238
+ /**
2239
+ * Called when you start a new game via the menu.
2240
+ * @realm menu
2241
+ * @source https://wiki.facepunch.com/gmod/GM:StartGame
2242
+ */
2243
+ Add(eventName: "StartGame", identifier: any, func: () => void): void;
2244
+ /**
2245
+ * Called every rendered frame on client, except when the game is paused.
2246
+ *
2247
+ * Called every game tick on the server. This will be the same as [GM:Tick](https://wiki.facepunch.com/gmod/GM:Tick) on the server when there is no lag, but will only be called once every processed server frame during lag.
2248
+ * [Global.CurTime](https://wiki.facepunch.com/gmod/Global.CurTime) is guaranteed to be different with each call to this hook on the server.
2249
+ *
2250
+ * See [GM:Tick](https://wiki.facepunch.com/gmod/GM:Tick) for a hook that runs every tick on both the client and server.
2251
+ *
2252
+ * **NOTE**: On server, this hook **WILL NOT** run if the server is empty, unless you set the [ConVar](https://wiki.facepunch.com/gmod/ConVar) `sv_hibernate_think` to `1`.
2253
+ *
2254
+ *
2255
+ * @realm shared and menu
2256
+ * @source https://wiki.facepunch.com/gmod/GM:Think
2257
+ */
2258
+ Add(eventName: "Think", identifier: any, func: () => void): void;
2259
+ /**
2260
+ * Called every game tick. [engine.TickCount](https://wiki.facepunch.com/gmod/engine.TickCount) is guaranteed to be different between each call.
2261
+ *
2262
+ * Server side, this is similar to [GM:Think](https://wiki.facepunch.com/gmod/GM:Think) (See that page for details).
2263
+ *
2264
+ * The default tickrate is `66.6666` (15 millisecond intervals). It can be changed via the `-tickrate` [command line option](https://wiki.facepunch.com/gmod/Command_Line_Parameters).
2265
+ * See [engine.TickInterval](https://wiki.facepunch.com/gmod/engine.TickInterval) for a function to retrieve this data at runtime.
2266
+ *
2267
+ * **NOTE**: This hook **WILL NOT** run if the server is empty, unless you set the [ConVar](https://wiki.facepunch.com/gmod/ConVar) `sv_hibernate_think` to 1
2268
+ *
2269
+ * @realm shared
2270
+ * @source https://wiki.facepunch.com/gmod/GM:Tick
2271
+ */
2272
+ Add(eventName: "Tick", identifier: any, func: () => void): void;
2273
+ /**
2274
+ * **NOTE**: Isn't called when CalcMainActivity returns a valid override sequence id
2275
+ *
2276
+ * Allows you to translate player activities.
2277
+ *
2278
+ * @realm shared
2279
+ * @source https://wiki.facepunch.com/gmod/GM:TranslateActivity
2280
+ */
2281
+ Add(eventName: "TranslateActivity", identifier: any, func: (ply: Player, act: number) => number): void;
2282
+ /**
2283
+ * Animation updates (pose params etc) should be done here.
2284
+ * @realm shared
2285
+ * @source https://wiki.facepunch.com/gmod/GM:UpdateAnimation
2286
+ */
2287
+ Add(eventName: "UpdateAnimation", identifier: any, func: (ply: Player, velocity: Vector, maxSeqGroundSpeed: number) => void): void;
2288
+ /**
2289
+ * Called when a variable is edited on an Entity (called by Edit Properties... menu). See [Editable Entities](https://wiki.facepunch.com/gmod/Editable_Entities) for more information.
2290
+ *
2291
+ * **WARNING**: This hook is called to change a variable and not after a variable was changed
2292
+ *
2293
+ *
2294
+ * @realm server
2295
+ * @source https://wiki.facepunch.com/gmod/GM:VariableEdited
2296
+ */
2297
+ Add(eventName: "VariableEdited", identifier: any, func: (ent: Entity, ply: Player, key: string, val: string, editor: table) => void): void;
2298
+ /**
2299
+ * Called when you are driving a vehicle. This hook works just like [GM:Move](https://wiki.facepunch.com/gmod/GM:Move).
2300
+ *
2301
+ * This hook is called before [GM:Move](https://wiki.facepunch.com/gmod/GM:Move) and will be called when [GM:PlayerTick](https://wiki.facepunch.com/gmod/GM:PlayerTick) is not.
2302
+ *
2303
+ * @realm shared
2304
+ * @source https://wiki.facepunch.com/gmod/GM:VehicleMove
2305
+ */
2306
+ Add(eventName: "VehicleMove", identifier: any, func: (ply: Player, veh: Vehicle, mv: CMoveData) => void): void;
2307
+ /**
2308
+ * Called when user clicks on a VGUI panel.
2309
+ * @realm client
2310
+ * @source https://wiki.facepunch.com/gmod/GM:VGUIMousePressAllowed
2311
+ */
2312
+ Add(eventName: "VGUIMousePressAllowed", identifier: any, func: (button: number) => boolean): void;
2313
+ /**
2314
+ * Called when a mouse button is pressed on a VGUI element or menu.
2315
+ * @realm client and menu
2316
+ * @source https://wiki.facepunch.com/gmod/GM:VGUIMousePressed
2317
+ */
2318
+ Add(eventName: "VGUIMousePressed", identifier: any, func: (pnl: Panel, mouseCode: number) => void): void;
2319
+ /**
2320
+ * Called as a weapon entity is picked up by a player. (Including [Player:Give](https://wiki.facepunch.com/gmod/Player:Give))
2321
+ *
2322
+ * Contrary to the name of the hook, it is **not called** when the player switches their active weapon to another.
2323
+ *
2324
+ * See also [GM:PlayerDroppedWeapon](https://wiki.facepunch.com/gmod/GM:PlayerDroppedWeapon) and [GM:PlayerCanPickupWeapon](https://wiki.facepunch.com/gmod/GM:PlayerCanPickupWeapon).
2325
+ *
2326
+ * **NOTE**: At the time when this hook is called [Entity:GetOwner](https://wiki.facepunch.com/gmod/Entity:GetOwner) will return `NULL`. The owner is set on the next frame.
2327
+ *
2328
+ * **NOTE**: This will not be called when picking up a weapon you already have as the weapon will be removed and [WEAPON:EquipAmmo](https://wiki.facepunch.com/gmod/WEAPON:EquipAmmo) will be called instead.
2329
+ *
2330
+ *
2331
+ * @realm server
2332
+ * @source https://wiki.facepunch.com/gmod/GM:WeaponEquip
2333
+ */
2334
+ Add(eventName: "WeaponEquip", identifier: any, func: (weapon: Weapon, owner: Player) => void): void;
2335
+ /**
2336
+ * Called when an addon from the Steam workshop finishes downloading. Used by default to update details on the workshop downloading panel.
2337
+ * @realm menu
2338
+ * @source https://wiki.facepunch.com/gmod/GM:WorkshopDownloadedFile
2339
+ */
2340
+ Add(eventName: "WorkshopDownloadedFile", identifier: any, func: (id: number, title: string) => void): void;
2341
+ /**
2342
+ * Called when an addon from the Steam workshop begins downloading. Used by default to place details on the workshop downloading panel.
2343
+ * @realm menu
2344
+ * @source https://wiki.facepunch.com/gmod/GM:WorkshopDownloadFile
2345
+ */
2346
+ Add(eventName: "WorkshopDownloadFile", identifier: any, func: (id: number, imageID: number, title: string, size: number) => void): void;
2347
+ /**
2348
+ * Called while an addon from the Steam workshop is downloading. Used by default to update details on the fancy workshop download panel.
2349
+ * @realm menu
2350
+ * @source https://wiki.facepunch.com/gmod/GM:WorkshopDownloadProgress
2351
+ */
2352
+ Add(eventName: "WorkshopDownloadProgress", identifier: any, func: (id: number, imageID: number, title: string, downloaded: number, expected: number) => void): void;
2353
+ /**
2354
+ * Called after [GM:WorkshopStart](https://wiki.facepunch.com/gmod/GM:WorkshopStart).
2355
+ * @realm menu
2356
+ * @source https://wiki.facepunch.com/gmod/GM:WorkshopDownloadTotals
2357
+ */
2358
+ Add(eventName: "WorkshopDownloadTotals", identifier: any, func: (remain: number, total: number) => void): void;
2359
+ /**
2360
+ * Called when downloading content from Steam workshop ends. Used by default to hide fancy workshop downloading panel.
2361
+ * @realm menu
2362
+ * @source https://wiki.facepunch.com/gmod/GM:WorkshopEnd
2363
+ */
2364
+ Add(eventName: "WorkshopEnd", identifier: any, func: () => void): void;
2365
+ /**
2366
+ * Called while an addon from the Steam workshop is extracting. Used by default to update details on the fancy workshop download panel.
2367
+ * @realm menu
2368
+ * @source https://wiki.facepunch.com/gmod/GM:WorkshopExtractProgress
2369
+ */
2370
+ Add(eventName: "WorkshopExtractProgress", identifier: any, func: (id: number, ImageID: number, title: string, percent: number) => void): void;
2371
+ /**
2372
+ * Called when downloading content from Steam workshop begins. Used by default to show fancy workshop downloading panel.
2373
+ *
2374
+ * The order of Workshop hooks is this:
2375
+ * * WorkshopStart
2376
+ * * WorkshopDownloadTotals
2377
+ * * * These are called for each new item:
2378
+ * * WorkshopDownloadFile
2379
+ * * WorkshopDownloadProgress - This is called until the file is finished
2380
+ * * WorkshopDownloadedFile
2381
+ * * WorkshopEnd (this ones called once)
2382
+ *
2383
+ * @realm menu
2384
+ * @source https://wiki.facepunch.com/gmod/GM:WorkshopStart
2385
+ */
2386
+ Add(eventName: "WorkshopStart", identifier: any, func: () => void): void;
2387
+ /**
2388
+ * Called when UGC subscription status changes.
2389
+ * @realm menu
2390
+ * @source https://wiki.facepunch.com/gmod/GM:WorkshopSubscriptionsChanged
2391
+ */
2392
+ Add(eventName: "WorkshopSubscriptionsChanged", identifier: any, func: () => void): void;
2393
+ /**
2394
+ * Called when a Workshop Message is received?. Currently, it seems like the message will be **#ugc.mounting** every time.
2395
+ * When does this exactly get called?. If an addon is subscribed, unsubscribed, error occurs or on any event?
2396
+ *
2397
+ * @realm menu
2398
+ * @source https://wiki.facepunch.com/gmod/GM:WorkshopSubscriptionsMessage
2399
+ */
2400
+ Add(eventName: "WorkshopSubscriptionsMessage", identifier: any, func: (message: string) => void): void;
2401
+ /**
2402
+ * **INTERNAL**: This is used internally - although you're able to use it you probably shouldn't.
2403
+ *
2404
+ * Called by the engine when the game initially fetches subscriptions to be displayed on the bottom of the main menu screen.
2405
+ *
2406
+ * @realm menu
2407
+ * @source https://wiki.facepunch.com/gmod/GM:WorkshopSubscriptionsProgress
2408
+ */
2409
+ Add(eventName: "WorkshopSubscriptionsProgress", identifier: any, func: (num: number, max: number) => void): void;
2410
+ /** Any other hook, including gamemode-defined ones. */
2411
+ Add(eventName: string, identifier: any, func: function): void;
2412
+ }