@tlua/gmod 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (278) hide show
  1. package/README.md +28 -0
  2. package/__metadata.json +4 -0
  3. package/_globals.d.tlua +178 -0
  4. package/_gmod-std.d.tlua +35 -0
  5. package/achievementicon.d.tlua +12 -0
  6. package/achievements.d.tlua +162 -0
  7. package/ai.d.tlua +65 -0
  8. package/ai_schedule.d.tlua +17 -0
  9. package/ai_task.d.tlua +17 -0
  10. package/angle.d.tlua +197 -0
  11. package/avatarimage.d.tlua +10 -0
  12. package/awesomium.d.tlua +14 -0
  13. package/baseclass.d.tlua +42 -0
  14. package/bf_read.d.tlua +110 -0
  15. package/bit.d.tlua +121 -0
  16. package/button.d.tlua +13 -0
  17. package/cam.d.tlua +220 -0
  18. package/ceffectdata.d.tlua +337 -0
  19. package/chat.d.tlua +62 -0
  20. package/checkbutton.d.tlua +14 -0
  21. package/cleanup.d.tlua +88 -0
  22. package/cluaemitter.d.tlua +119 -0
  23. package/clualocomotion.d.tlua +383 -0
  24. package/cluaparticle.d.tlua +426 -0
  25. package/cmovedata.d.tlua +476 -0
  26. package/cnavarea.d.tlua +845 -0
  27. package/cnavladder.d.tlua +209 -0
  28. package/cnewparticleeffect.d.tlua +259 -0
  29. package/color.d.tlua +339 -0
  30. package/concommand.d.tlua +69 -0
  31. package/constraint.d.tlua +311 -0
  32. package/construct.d.tlua +26 -0
  33. package/contentheader.d.tlua +32 -0
  34. package/contenticon.d.tlua +86 -0
  35. package/contentsidebar.d.tlua +45 -0
  36. package/contentsidebartoolbox.d.tlua +13 -0
  37. package/contextbase.d.tlua +37 -0
  38. package/controlpanel.d.tlua +140 -0
  39. package/controlpresets.d.tlua +118 -0
  40. package/convar.d.tlua +162 -0
  41. package/cookie.d.tlua +60 -0
  42. package/coroutine.d.tlua +90 -0
  43. package/crecipientfilter.d.tlua +152 -0
  44. package/csent.d.tlua +10 -0
  45. package/csoundpatch.d.tlua +150 -0
  46. package/ctakedamageinfo.d.tlua +366 -0
  47. package/ctrllistbox.d.tlua +12 -0
  48. package/ctrlnumpad.d.tlua +73 -0
  49. package/cusercmd.d.tlua +320 -0
  50. package/custom_classes.d.tlua +65 -0
  51. package/custom_entity_fields.d.tlua +96 -0
  52. package/cvars.d.tlua +80 -0
  53. package/dadjustablemodelpanel.d.tlua +81 -0
  54. package/dalphabar.d.tlua +27 -0
  55. package/dbinder.d.tlua +37 -0
  56. package/dbubblecontainer.d.tlua +18 -0
  57. package/dbutton.d.tlua +88 -0
  58. package/dcategoryheader.d.tlua +13 -0
  59. package/dcategorylist.d.tlua +11 -0
  60. package/dcheckbox.d.tlua +46 -0
  61. package/dcheckboxlabel.d.tlua +90 -0
  62. package/dcollapsiblecategory.d.tlua +240 -0
  63. package/dcolorbutton.d.tlua +73 -0
  64. package/dcolorcombo.d.tlua +54 -0
  65. package/dcolorcube.d.tlua +137 -0
  66. package/dcolormixer.d.tlua +303 -0
  67. package/dcolorpalette.d.tlua +294 -0
  68. package/dcolumnsheet.d.tlua +49 -0
  69. package/dcombobox.d.tlua +161 -0
  70. package/ddragbase.d.tlua +151 -0
  71. package/ddrawer.d.tlua +72 -0
  72. package/debug.d.tlua +236 -0
  73. package/debugoverlay.d.tlua +193 -0
  74. package/dentityproperties.d.tlua +63 -0
  75. package/derma.d.tlua +119 -0
  76. package/dexpandbutton.d.tlua +30 -0
  77. package/dfilebrowser.d.tlua +228 -0
  78. package/dform.d.tlua +176 -0
  79. package/dframe.d.tlua +261 -0
  80. package/dgrid.d.tlua +113 -0
  81. package/dhorizontaldivider.d.tlua +196 -0
  82. package/dhorizontalscroller.d.tlua +104 -0
  83. package/dhscrollbar.d.tlua +109 -0
  84. package/dhtml.d.tlua +91 -0
  85. package/dhtmlcontrols.d.tlua +62 -0
  86. package/diconbrowser.d.tlua +113 -0
  87. package/diconlayout.d.tlua +190 -0
  88. package/dimage.d.tlua +221 -0
  89. package/dimagebutton.d.tlua +103 -0
  90. package/dkillicon.d.tlua +9 -0
  91. package/dlabel.d.tlua +385 -0
  92. package/dlabeleditable.d.tlua +51 -0
  93. package/dlabelurl.d.tlua +100 -0
  94. package/dlistbox.d.tlua +82 -0
  95. package/dlistboxitem.d.tlua +42 -0
  96. package/dlistlayout.d.tlua +14 -0
  97. package/dlistview.d.tlua +360 -0
  98. package/dlistview_column.d.tlua +135 -0
  99. package/dlistview_columnplain.d.tlua +11 -0
  100. package/dlistview_draggerbar.d.tlua +11 -0
  101. package/dlistview_line.d.tlua +140 -0
  102. package/dlistviewheaderlabel.d.tlua +11 -0
  103. package/dlistviewlabel.d.tlua +11 -0
  104. package/dlistviewline.d.tlua +11 -0
  105. package/dmenu.d.tlua +266 -0
  106. package/dmenubar.d.tlua +42 -0
  107. package/dmenuoption.d.tlua +135 -0
  108. package/dmenuoptioncvar.d.tlua +64 -0
  109. package/dmodelpanel.d.tlua +207 -0
  110. package/dmodelselect.d.tlua +20 -0
  111. package/dmodelselectmulti.d.tlua +19 -0
  112. package/dnotify.d.tlua +93 -0
  113. package/dnumberscratch.d.tlua +284 -0
  114. package/dnumberwang.d.tlua +147 -0
  115. package/dnumpad.d.tlua +11 -0
  116. package/dnumslider.d.tlua +182 -0
  117. package/dpanel.d.tlua +152 -0
  118. package/dpanellist.d.tlua +109 -0
  119. package/dpaneloverlay.d.tlua +65 -0
  120. package/dpanelselect.d.tlua +13 -0
  121. package/dpanpanel.d.tlua +64 -0
  122. package/dprogress.d.tlua +27 -0
  123. package/dproperties.d.tlua +52 -0
  124. package/dproperty_boolean.d.tlua +12 -0
  125. package/dproperty_combo.d.tlua +31 -0
  126. package/dproperty_entity.d.tlua +12 -0
  127. package/dproperty_float.d.tlua +12 -0
  128. package/dproperty_generic.d.tlua +50 -0
  129. package/dproperty_int.d.tlua +12 -0
  130. package/dproperty_vectorcolor.d.tlua +14 -0
  131. package/dpropertysheet.d.tlua +167 -0
  132. package/dragndrop.d.tlua +123 -0
  133. package/draw.d.tlua +162 -0
  134. package/drgbpicker.d.tlua +49 -0
  135. package/drive.d.tlua +159 -0
  136. package/dscrollbargrip.d.tlua +13 -0
  137. package/dscrollpanel.d.tlua +110 -0
  138. package/dshape.d.tlua +72 -0
  139. package/dsizetocontents.d.tlua +46 -0
  140. package/dslider.d.tlua +302 -0
  141. package/dsprite.d.tlua +84 -0
  142. package/dtab.d.tlua +81 -0
  143. package/dtextentry.d.tlua +442 -0
  144. package/dtilelayout.d.tlua +218 -0
  145. package/dtooltip.d.tlua +76 -0
  146. package/dtree.d.tlua +185 -0
  147. package/dtree_node.d.tlua +793 -0
  148. package/dtree_node_button.d.tlua +13 -0
  149. package/duplicator.d.tlua +338 -0
  150. package/dverticaldivider.d.tlua +223 -0
  151. package/dvscrollbar.d.tlua +109 -0
  152. package/editablepanel.d.tlua +10 -0
  153. package/effect.d.tlua +121 -0
  154. package/effects.d.tlua +77 -0
  155. package/engine.d.tlua +248 -0
  156. package/entity.d.tlua +8295 -0
  157. package/ents.d.tlua +267 -0
  158. package/enums.d.tlua +7082 -0
  159. package/file.d.tlua +419 -0
  160. package/file_class.d.tlua +7 -0
  161. package/fingerposer.d.tlua +12 -0
  162. package/fingervar.d.tlua +13 -0
  163. package/frame.d.tlua +11 -0
  164. package/frame_blend.d.tlua +105 -0
  165. package/game.d.tlua +482 -0
  166. package/gameevent.d.tlua +968 -0
  167. package/gamemode.d.tlua +48 -0
  168. package/global.d.tlua +3156 -0
  169. package/gm.d.tlua +3218 -0
  170. package/gmod.d.tlua +20 -0
  171. package/gmsave.d.tlua +53 -0
  172. package/gui.d.tlua +232 -0
  173. package/gwen.d.tlua +55 -0
  174. package/halo.d.tlua +42 -0
  175. package/hammer.d.tlua +17 -0
  176. package/hook.d.tlua +64 -0
  177. package/html.d.tlua +22 -0
  178. package/http.d.tlua +72 -0
  179. package/iconeditor.d.tlua +130 -0
  180. package/igmodaudiochannel.d.tlua +419 -0
  181. package/imagecheckbox.d.tlua +48 -0
  182. package/imaterial.d.tlua +288 -0
  183. package/imesh.d.tlua +70 -0
  184. package/index.d.tlua +277 -0
  185. package/input.d.tlua +252 -0
  186. package/invalidateinternalentitycache.d.tlua +13 -0
  187. package/irestore.d.tlua +94 -0
  188. package/isave.d.tlua +94 -0
  189. package/itexture.d.tlua +108 -0
  190. package/ivideowriter.d.tlua +53 -0
  191. package/jit.d.tlua +243 -0
  192. package/killicon.d.tlua +84 -0
  193. package/label.d.tlua +20 -0
  194. package/language.d.tlua +26 -0
  195. package/list.d.tlua +112 -0
  196. package/makeballoon.d.tlua +15 -0
  197. package/markup.d.tlua +38 -0
  198. package/markupobject.d.tlua +53 -0
  199. package/material.d.tlua +9 -0
  200. package/math.d.tlua +899 -0
  201. package/matproxy.d.tlua +60 -0
  202. package/matselect.d.tlua +106 -0
  203. package/menu.d.tlua +20 -0
  204. package/menubar.d.tlua +39 -0
  205. package/mesh.d.tlua +183 -0
  206. package/modelimage.d.tlua +12 -0
  207. package/motionsensor.d.tlua +115 -0
  208. package/navmesh.d.tlua +274 -0
  209. package/net.d.tlua +639 -0
  210. package/nextbot.d.tlua +380 -0
  211. package/notification.d.tlua +35 -0
  212. package/npc.d.tlua +1787 -0
  213. package/numpad.d.tlua +89 -0
  214. package/os.d.tlua +56 -0
  215. package/package.d.tlua +15 -0
  216. package/package.json +18 -0
  217. package/panel.d.tlua +3650 -0
  218. package/panellist.d.tlua +13 -0
  219. package/pathfollower.d.tlua +301 -0
  220. package/permissions.d.tlua +77 -0
  221. package/physcollide.d.tlua +40 -0
  222. package/physenv.d.tlua +136 -0
  223. package/physobj.d.tlua +799 -0
  224. package/pixelvis_handle_t.d.tlua +9 -0
  225. package/player.d.tlua +3320 -0
  226. package/player_manager.d.tlua +147 -0
  227. package/preseteditor.d.tlua +13 -0
  228. package/presets.d.tlua +79 -0
  229. package/projectedtexture.d.tlua +553 -0
  230. package/properties.d.tlua +65 -0
  231. package/propselect.d.tlua +50 -0
  232. package/radiobutton.d.tlua +13 -0
  233. package/render.d.tlua +1700 -0
  234. package/resource.d.tlua +73 -0
  235. package/richtext.d.tlua +17 -0
  236. package/sandbox.d.tlua +576 -0
  237. package/saverestore.d.tlua +148 -0
  238. package/schedule.d.tlua +69 -0
  239. package/scripted_ents.d.tlua +124 -0
  240. package/search.d.tlua +26 -0
  241. package/serverlist.d.tlua +85 -0
  242. package/slidebar.d.tlua +12 -0
  243. package/slider.d.tlua +11 -0
  244. package/sound.d.tlua +140 -0
  245. package/spawnicon.d.tlua +95 -0
  246. package/spawnmenu.d.tlua +286 -0
  247. package/spawnmenucontentpanel.d.tlua +52 -0
  248. package/sql.d.tlua +154 -0
  249. package/stack.d.tlua +57 -0
  250. package/steamworks.d.tlua +208 -0
  251. package/string.d.tlua +535 -0
  252. package/structures.d.tlua +4442 -0
  253. package/surface.d.tlua +463 -0
  254. package/surfaceinfo.d.tlua +70 -0
  255. package/system.d.tlua +134 -0
  256. package/table.d.tlua +533 -0
  257. package/task.d.tlua +92 -0
  258. package/team.d.tlua +195 -0
  259. package/textentry.d.tlua +12 -0
  260. package/tgaimage.d.tlua +11 -0
  261. package/timer.d.tlua +198 -0
  262. package/tool.d.tlua +466 -0
  263. package/ugcpublishwindow.d.tlua +83 -0
  264. package/umsg.d.tlua +147 -0
  265. package/undo.d.tlua +122 -0
  266. package/urllabel.d.tlua +13 -0
  267. package/usermessage.d.tlua +48 -0
  268. package/utf8.d.tlua +89 -0
  269. package/util.d.tlua +1087 -0
  270. package/vector.d.tlua +413 -0
  271. package/vehicle.d.tlua +472 -0
  272. package/vgui.d.tlua +201 -0
  273. package/video.d.tlua +17 -0
  274. package/vmatrix.d.tlua +392 -0
  275. package/weapon.d.tlua +913 -0
  276. package/weapons.d.tlua +90 -0
  277. package/widgets.d.tlua +29 -0
  278. package/workshopfilebase.d.tlua +68 -0
package/player.d.tlua ADDED
@@ -0,0 +1,3320 @@
1
+ // AUTO-GENERATED tlua declarations. Do not edit by hand.
2
+
3
+ /**
4
+ * Represents a player class.
5
+ *
6
+ * The player class hooks have one special field:
7
+ * * [Player](https://wiki.facepunch.com/gmod/Player) **Player** - The player for which a hook is called.
8
+ *
9
+ * **NOTE**: These hooks are used in [player_manager](https://wiki.facepunch.com/gmod/player_manager) this can't be [hooked](https://wiki.facepunch.com/gmod/hook.Add)
10
+ *
11
+ *
12
+ *
13
+ * @source https://wiki.facepunch.com/gmod/PLAYER_Hooks
14
+ */
15
+ interface PLAYER {}
16
+
17
+ /**
18
+ * This is a list of all methods only available for players. It is also possible to call [Entity](https://wiki.facepunch.com/gmod/Entity) functions on the Player.
19
+ * @source https://wiki.facepunch.com/gmod/Player
20
+ */
21
+ interface Player extends Entity {}
22
+
23
+ /**
24
+ * The player library is used to get the Lua objects that represent players in-game.
25
+ * @source https://wiki.facepunch.com/gmod/player(library)
26
+ */
27
+ declare player: PlayerLib;
28
+
29
+ interface PLAYER {
30
+ /**
31
+ * Called when the player's class was changed from this class.
32
+ * @realm shared
33
+ * @source https://wiki.facepunch.com/gmod/PLAYER:ClassChanged
34
+ */
35
+ ClassChanged(self: PLAYER): void;
36
+ }
37
+
38
+ interface PLAYER {
39
+ /**
40
+ * Called when the player dies
41
+ * @realm server
42
+ * @source https://wiki.facepunch.com/gmod/PLAYER:Death
43
+ */
44
+ Death(self: PLAYER): void;
45
+ }
46
+
47
+ interface PLAYER {
48
+ /**
49
+ * Called from [GM:FinishMove](https://wiki.facepunch.com/gmod/GM:FinishMove).
50
+ *
51
+ * **WARNING**: This hook will not work if the current gamemode overrides [GM:FinishMove](https://wiki.facepunch.com/gmod/GM:FinishMove) and does not call this hook.
52
+ *
53
+ *
54
+ * **NOTE**: This hook is run after the [drive.FinishMove](https://wiki.facepunch.com/gmod/drive.FinishMove) has been called.
55
+ *
56
+ *
57
+ * @realm shared
58
+ * @source https://wiki.facepunch.com/gmod/PLAYER:FinishMove
59
+ */
60
+ FinishMove(self: PLAYER, mv: CMoveData): boolean;
61
+ }
62
+
63
+ interface PLAYER {
64
+ /**
65
+ * Called on player spawn to determine which hand model to use
66
+ * @realm server
67
+ * @source https://wiki.facepunch.com/gmod/PLAYER:GetHandsModel
68
+ */
69
+ GetHandsModel(self: PLAYER): table;
70
+ }
71
+
72
+ interface PLAYER {
73
+ /**
74
+ * Called when the class object is created
75
+ * @realm shared
76
+ * @source https://wiki.facepunch.com/gmod/PLAYER:Init
77
+ */
78
+ Init(self: PLAYER): void;
79
+ }
80
+
81
+ interface PLAYER {
82
+ /**
83
+ * Called on spawn to give the player their default loadout
84
+ * @realm server
85
+ * @source https://wiki.facepunch.com/gmod/PLAYER:Loadout
86
+ */
87
+ Loadout(self: PLAYER): void;
88
+ }
89
+
90
+ interface PLAYER {
91
+ /**
92
+ * Called from [GM:Move](https://wiki.facepunch.com/gmod/GM:Move).
93
+ *
94
+ * **WARNING**: This hook will not work if the current gamemode overrides [GM:Move](https://wiki.facepunch.com/gmod/GM:Move) and does not call this hook.
95
+ *
96
+ *
97
+ * **NOTE**: This hook is run after the [drive.Move](https://wiki.facepunch.com/gmod/drive.Move) has been called.
98
+ *
99
+ *
100
+ * @realm shared
101
+ * @source https://wiki.facepunch.com/gmod/PLAYER:Move
102
+ */
103
+ Move(self: PLAYER, mv: CMoveData): boolean;
104
+ }
105
+
106
+ interface PLAYER {
107
+ /**
108
+ * Called after the viewmodel has been drawn
109
+ * @realm client
110
+ * @source https://wiki.facepunch.com/gmod/PLAYER:PostDrawViewModel
111
+ */
112
+ PostDrawViewModel(self: PLAYER, viewmodel: Entity, weapon: Entity): void;
113
+ }
114
+
115
+ interface PLAYER {
116
+ /**
117
+ * Called before the viewmodel is drawn
118
+ * @realm client
119
+ * @source https://wiki.facepunch.com/gmod/PLAYER:PreDrawViewModel
120
+ */
121
+ PreDrawViewModel(self: PLAYER, viewmodel: Entity, weapon: Entity): void;
122
+ }
123
+
124
+ interface PLAYER {
125
+ /**
126
+ * Called when we need to set player model from the class.
127
+ *
128
+ * **NOTE**: This will only be called if you have not overridden [GM:PlayerSetModel](https://wiki.facepunch.com/gmod/GM:PlayerSetModel) or call this function from it or anywhere else using [player_manager.RunClass](https://wiki.facepunch.com/gmod/player_manager.RunClass)
129
+ *
130
+ *
131
+ * @realm server
132
+ * @source https://wiki.facepunch.com/gmod/PLAYER:SetModel
133
+ */
134
+ SetModel(self: PLAYER): void;
135
+ }
136
+
137
+ interface PLAYER {
138
+ /**
139
+ * Setup the network table accessors.
140
+ * @realm shared
141
+ * @source https://wiki.facepunch.com/gmod/PLAYER:SetupDataTables
142
+ */
143
+ SetupDataTables(self: PLAYER): void;
144
+ }
145
+
146
+ interface PLAYER {
147
+ /**
148
+ * Called when the player spawns
149
+ * @realm server
150
+ * @source https://wiki.facepunch.com/gmod/PLAYER:Spawn
151
+ */
152
+ Spawn(self: PLAYER): void;
153
+ }
154
+
155
+ interface PLAYER {
156
+ /**
157
+ * Called from [GM:CreateMove](https://wiki.facepunch.com/gmod/GM:CreateMove).
158
+ *
159
+ * **WARNING**: This hook will not work if the current gamemode overrides [GM:SetupMove](https://wiki.facepunch.com/gmod/GM:SetupMove) and does not call this hook.
160
+ *
161
+ *
162
+ * **NOTE**: This hook is run after the [drive.StartMove](https://wiki.facepunch.com/gmod/drive.StartMove) has been called.
163
+ *
164
+ *
165
+ * @realm shared
166
+ * @source https://wiki.facepunch.com/gmod/PLAYER:StartMove
167
+ */
168
+ StartMove(self: PLAYER, mv: CMoveData, cmd: CUserCmd): boolean;
169
+ }
170
+
171
+ interface PLAYER {
172
+ /**
173
+ * Called when the player changes their weapon to another one causing their viewmodel model to change
174
+ * @realm client
175
+ * @source https://wiki.facepunch.com/gmod/PLAYER:ViewModelChanged
176
+ */
177
+ ViewModelChanged(self: PLAYER, viewmodel: Entity, old: string, _new: string): void;
178
+ }
179
+
180
+ interface Player {
181
+ /**
182
+ * Returns the player's AccountID part of their full SteamID.
183
+ *
184
+ * Since this does not include other vital parts of the SteamID such as "Account Type" and "Account Instance", it should be avoided, as AccountIDs are finite, and can theoretically be the same for multiple valid accounts.
185
+ *
186
+ * See [Player:SteamID](https://wiki.facepunch.com/gmod/Player:SteamID) for the text representation of the full SteamID.
187
+ * See [Player:SteamID64](https://wiki.facepunch.com/gmod/Player:SteamID64) for a 64bit representation of the full SteamID.
188
+ *
189
+ * **NOTE**: In a `-multirun` environment, this will return `-1` for all "copies" of a player because they are not authenticated with Steam.
190
+ *
191
+ * For bots this will return values starting with `0` for the first bot, `1` for the second bot and so on.
192
+ *
193
+ *
194
+ * @realm shared
195
+ * @source https://wiki.facepunch.com/gmod/Player:AccountID
196
+ */
197
+ AccountID(self: Player): number;
198
+ }
199
+
200
+ interface Player {
201
+ /**
202
+ * **NOTE**: This function is only available in Sandbox and its derivatives.
203
+ * Adds an entity to the player's clean up list. This uses [cleanup.Add](https://wiki.facepunch.com/gmod/cleanup.Add) internally.
204
+ * @realm server
205
+ * @source https://wiki.facepunch.com/gmod/Player:AddCleanup
206
+ */
207
+ AddCleanup(self: Player, type: string, ent: Entity): void;
208
+ }
209
+
210
+ interface Player {
211
+ /**
212
+ * **NOTE**: This function is only available in Sandbox and its derivatives.
213
+ * Adds an entity to the player's list of entities of the same type. See [Player:GetCount](https://wiki.facepunch.com/gmod/Player:GetCount) to get the current count of entities of an entity type added with this function.
214
+ * @realm shared
215
+ * @source https://wiki.facepunch.com/gmod/Player:AddCount
216
+ */
217
+ AddCount(self: Player, str: string, ent: Entity): void;
218
+ }
219
+
220
+ interface Player {
221
+ /**
222
+ * Adds the provided amount to the player's death count.
223
+ * @realm server
224
+ * @source https://wiki.facepunch.com/gmod/Player:AddDeaths
225
+ */
226
+ AddDeaths(self: Player, count: number): void;
227
+ }
228
+
229
+ interface Player {
230
+ /**
231
+ * Adds the provided amount to the player's frag/kill count.
232
+ * @realm server
233
+ * @source https://wiki.facepunch.com/gmod/Player:AddFrags
234
+ */
235
+ AddFrags(self: Player, count: number): void;
236
+ }
237
+
238
+ interface Player {
239
+ /**
240
+ * Adds an entity to the player's list of frozen objects.
241
+ * @realm server
242
+ * @source https://wiki.facepunch.com/gmod/Player:AddFrozenPhysicsObject
243
+ */
244
+ AddFrozenPhysicsObject(self: Player, ent: Entity, physobj: PhysObj): void;
245
+ }
246
+
247
+ interface Player {
248
+ /**
249
+ * Sets up the voting system for the player.
250
+ * This is a really barebone system. By calling this a vote gets started, when the player presses 0-9 the callback function gets called along with the key the player pressed. Use the draw callback to draw the vote panel.
251
+ *
252
+ * @realm client
253
+ * @source https://wiki.facepunch.com/gmod/Player:AddPlayerOption
254
+ */
255
+ AddPlayerOption(self: Player, name: string, timeout: number, vote_callback: (voteNum: number) => boolean, draw_callback: function): void;
256
+ }
257
+
258
+ interface Player {
259
+ /**
260
+ * Plays a sequence directly from a sequence number, similar to [Player:AnimRestartGesture](https://wiki.facepunch.com/gmod/Player:AnimRestartGesture). This function has the advantage to play sequences that haven't been bound to an existing [Enums/ACT](https://wiki.facepunch.com/gmod/Enums/ACT)
261
+ * **WARNING**: This is not automatically networked. This function has to be called on the client to be seen by said client.
262
+ *
263
+ *
264
+ * @realm shared
265
+ * @source https://wiki.facepunch.com/gmod/Player:AddVCDSequenceToGestureSlot
266
+ */
267
+ AddVCDSequenceToGestureSlot(self: Player, slot: number, sequenceId: number, cycle: number, autokill?: boolean): void;
268
+ }
269
+
270
+ interface Player {
271
+ /**
272
+ * Sets if the player can toggle their flashlight. Function exists on both the server and client but has no effect when ran on the client.
273
+ *
274
+ * This is a Lua method that internally uses [GM:PlayerSwitchFlashlight](https://wiki.facepunch.com/gmod/GM:PlayerSwitchFlashlight). If current gamemode overwrites that hook and doesn't respect [Player:CanUseFlashlight](https://wiki.facepunch.com/gmod/Player:CanUseFlashlight), this function will not have any effect.
275
+ *
276
+ * @realm shared
277
+ * @source https://wiki.facepunch.com/gmod/Player:AllowFlashlight
278
+ */
279
+ AllowFlashlight(self: Player, canFlashlight: boolean): void;
280
+ }
281
+
282
+ interface Player {
283
+ /**
284
+ * Lets the player spray their decal without delay
285
+ * @realm server
286
+ * @source https://wiki.facepunch.com/gmod/Player:AllowImmediateDecalPainting
287
+ */
288
+ AllowImmediateDecalPainting(self: Player, allow: boolean): void;
289
+ }
290
+
291
+ interface Player {
292
+ /**
293
+ * Resets player gesture in selected slot.
294
+ * @realm shared
295
+ * @source https://wiki.facepunch.com/gmod/Player:AnimResetGestureSlot
296
+ */
297
+ AnimResetGestureSlot(self: Player, slot: number): void;
298
+ }
299
+
300
+ interface Player {
301
+ /**
302
+ * Restart a gesture on a player, within a gesture slot.
303
+ *
304
+ * **WARNING**: This is not automatically networked. This function has to be called on the client to be seen by said client.
305
+ *
306
+ *
307
+ * @realm shared
308
+ * @source https://wiki.facepunch.com/gmod/Player:AnimRestartGesture
309
+ */
310
+ AnimRestartGesture(self: Player, slot: number, activity: number, autokill?: boolean): void;
311
+ }
312
+
313
+ interface Player {
314
+ /**
315
+ * Restarts the main animation on the player, has the same effect as calling [Entity:SetCycle](https://wiki.facepunch.com/gmod/Entity:SetCycle)( 0 ).
316
+ * @realm shared
317
+ * @source https://wiki.facepunch.com/gmod/Player:AnimRestartMainSequence
318
+ */
319
+ AnimRestartMainSequence(self: Player): void;
320
+ }
321
+
322
+ interface Player {
323
+ /**
324
+ * Sets the sequence of the animation playing in the given gesture slot.
325
+ * @realm shared
326
+ * @source https://wiki.facepunch.com/gmod/Player:AnimSetGestureSequence
327
+ */
328
+ AnimSetGestureSequence(self: Player, slot: number, sequenceID: number): void;
329
+ }
330
+
331
+ interface Player {
332
+ /**
333
+ * Sets the weight of the animation playing in the given gesture slot.
334
+ * @realm shared
335
+ * @source https://wiki.facepunch.com/gmod/Player:AnimSetGestureWeight
336
+ */
337
+ AnimSetGestureWeight(self: Player, slot: number, weight: number): void;
338
+ }
339
+
340
+ interface Player {
341
+ /**
342
+ * Returns the player's armor.
343
+ * @realm shared
344
+ * @source https://wiki.facepunch.com/gmod/Player:Armor
345
+ */
346
+ Armor(self: Player): number;
347
+ }
348
+
349
+ interface Player {
350
+ /**
351
+ * Bans the player from the server for a certain amount of minutes.
352
+ * @realm server
353
+ * @source https://wiki.facepunch.com/gmod/Player:Ban
354
+ */
355
+ Ban(self: Player, minutes: number, kick?: boolean): void;
356
+ }
357
+
358
+ interface Player {
359
+ /**
360
+ * Returns true if the player's flashlight hasn't been disabled by [Player:AllowFlashlight](https://wiki.facepunch.com/gmod/Player:AllowFlashlight).
361
+ *
362
+ * **NOTE**: This is not synchronized between clients and server automatically!
363
+ *
364
+ *
365
+ * @realm shared
366
+ * @source https://wiki.facepunch.com/gmod/Player:CanUseFlashlight
367
+ */
368
+ CanUseFlashlight(self: Player): boolean;
369
+ }
370
+
371
+ interface Player {
372
+ /**
373
+ * Prints a string to the chatbox of the client.
374
+ *
375
+ * **WARNING**: Just like the [usermessage](https://wiki.facepunch.com/gmod/usermessage), this function is affected by the 255 byte limit!
376
+ *
377
+ *
378
+ * @realm shared
379
+ * @source https://wiki.facepunch.com/gmod/Player:ChatPrint
380
+ */
381
+ ChatPrint(self: Player, message: string): void;
382
+ }
383
+
384
+ interface Player {
385
+ /**
386
+ * Checks if the limit of an entity type added by [Player:AddCount](https://wiki.facepunch.com/gmod/Player:AddCount) is hit or not. If it's hit, it will call the [GM:PlayerCheckLimit](https://wiki.facepunch.com/gmod/GM:PlayerCheckLimit) hook, and call [Player:LimitHit](https://wiki.facepunch.com/gmod/Player:LimitHit) if the hook doesn't return `false`.
387
+ *
388
+ * This will always return `true` in singleplayer, as singleplayer does not have limits.
389
+ *
390
+ * **NOTE**: This function is only available in Sandbox and its derivatives.
391
+ *
392
+ *
393
+ * @realm shared
394
+ * @source https://wiki.facepunch.com/gmod/Player:CheckLimit
395
+ */
396
+ CheckLimit(self: Player, str: string): boolean;
397
+ }
398
+
399
+ interface Player {
400
+ /**
401
+ * Runs the concommand on the player. This does not work on bots. If used clientside, always runs the command on the local player.
402
+ *
403
+ * If you wish to directly modify the movement input of bots, use [GM:StartCommand](https://wiki.facepunch.com/gmod/GM:StartCommand) instead.
404
+ *
405
+ * **NOTE**: Some commands/convars are blocked from being run/changed using this function, usually to prevent harm/annoyance to clients. For a list of blocked commands, see [Blocked ConCommands](https://wiki.facepunch.com/gmod/Blocked_ConCommands).
406
+ *
407
+ *
408
+ * @realm shared
409
+ * @source https://wiki.facepunch.com/gmod/Player:ConCommand
410
+ */
411
+ ConCommand(self: Player, command: string): void;
412
+ }
413
+
414
+ interface Player {
415
+ /**
416
+ * Creates the player's death ragdoll entity and deletes the old one.
417
+ *
418
+ * This is normally used when a player dies, to create their death ragdoll.
419
+ *
420
+ * The ragdoll will be created with the player's properties such as [Position](https://wiki.facepunch.com/gmod/Entity:GetPos), [Angles](https://wiki.facepunch.com/gmod/Entity:GetAngles), [PlayerColor](https://wiki.facepunch.com/gmod/Player:GetPlayerColor), [Velocity](https://wiki.facepunch.com/gmod/Entity:GetVelocity) and [Model](https://wiki.facepunch.com/gmod/Entity:GetModel).
421
+ *
422
+ * You can retrieve the entity this creates with [Player:GetRagdollEntity](https://wiki.facepunch.com/gmod/Player:GetRagdollEntity).
423
+ *
424
+ * @realm server
425
+ * @source https://wiki.facepunch.com/gmod/Player:CreateRagdoll
426
+ */
427
+ CreateRagdoll(self: Player): void;
428
+ }
429
+
430
+ interface Player {
431
+ /**
432
+ * Disables the default player's crosshair. Can be reenabled with [Player:CrosshairEnable](https://wiki.facepunch.com/gmod/Player:CrosshairEnable). This will affect [WEAPON:DoDrawCrosshair](https://wiki.facepunch.com/gmod/WEAPON:DoDrawCrosshair).
433
+ * @realm server
434
+ * @source https://wiki.facepunch.com/gmod/Player:CrosshairDisable
435
+ */
436
+ CrosshairDisable(self: Player): void;
437
+ }
438
+
439
+ interface Player {
440
+ /**
441
+ * Enables the player's crosshair, if it was previously disabled via [Player:CrosshairDisable](https://wiki.facepunch.com/gmod/Player:CrosshairDisable).
442
+ * @realm server
443
+ * @source https://wiki.facepunch.com/gmod/Player:CrosshairEnable
444
+ */
445
+ CrosshairEnable(self: Player): void;
446
+ }
447
+
448
+ interface Player {
449
+ /**
450
+ * Returns whether the player is crouching or not ([FL_DUCKING](https://wiki.facepunch.com/gmod/Enums/FL) flag).
451
+ * @realm shared
452
+ * @source https://wiki.facepunch.com/gmod/Player:Crouching
453
+ */
454
+ Crouching(self: Player): boolean;
455
+ }
456
+
457
+ interface Player {
458
+ /**
459
+ * Returns the player's death count
460
+ * @realm shared
461
+ * @source https://wiki.facepunch.com/gmod/Player:Deaths
462
+ */
463
+ Deaths(self: Player): number;
464
+ }
465
+
466
+ interface Player {
467
+ /**
468
+ * Prints the players' name and position to the console.
469
+ * @realm shared
470
+ * @source https://wiki.facepunch.com/gmod/Player:DebugInfo
471
+ */
472
+ DebugInfo(self: Player): void;
473
+ }
474
+
475
+ interface Player {
476
+ /**
477
+ * Detonates all tripmines belonging to the player.
478
+ * @realm server
479
+ * @source https://wiki.facepunch.com/gmod/Player:DetonateTripmines
480
+ */
481
+ DetonateTripmines(self: Player): void;
482
+ }
483
+
484
+ interface Player {
485
+ /**
486
+ * Disables world clicking for given player. See [Panel:SetWorldClicker](https://wiki.facepunch.com/gmod/Panel:SetWorldClicker) and [Player:IsWorldClickingDisabled](https://wiki.facepunch.com/gmod/Player:IsWorldClickingDisabled).
487
+ * @realm server
488
+ * @source https://wiki.facepunch.com/gmod/Player:DisableWorldClicking
489
+ */
490
+ DisableWorldClicking(self: Player, disable: boolean): void;
491
+ }
492
+
493
+ interface Player {
494
+ /**
495
+ * Sends a third person animation event to the player.
496
+ *
497
+ * Calls [GM:DoAnimationEvent](https://wiki.facepunch.com/gmod/GM:DoAnimationEvent) with [PLAYERANIMEVENT_CUSTOM_GESTURE](https://wiki.facepunch.com/gmod/Enums/PLAYERANIMEVENT) as the event, data as the given data.
498
+ *
499
+ * @realm shared
500
+ * @source https://wiki.facepunch.com/gmod/Player:DoAnimationEvent
501
+ */
502
+ DoAnimationEvent(self: Player, data: number): void;
503
+ }
504
+
505
+ interface Player {
506
+ /**
507
+ * Starts the player's attack animation. The attack animation is determined by the weapon's HoldType.
508
+ *
509
+ * Similar to other animation event functions, calls [GM:DoAnimationEvent](https://wiki.facepunch.com/gmod/GM:DoAnimationEvent) with [PLAYERANIMEVENT_ATTACK_PRIMARY](https://wiki.facepunch.com/gmod/Enums/PLAYERANIMEVENT) as the event and no extra data.
510
+ *
511
+ * @realm shared
512
+ * @source https://wiki.facepunch.com/gmod/Player:DoAttackEvent
513
+ */
514
+ DoAttackEvent(self: Player): void;
515
+ }
516
+
517
+ interface Player {
518
+ /**
519
+ * Sends a specified third person animation event to the player.
520
+ *
521
+ * Calls [GM:DoAnimationEvent](https://wiki.facepunch.com/gmod/GM:DoAnimationEvent) with specified arguments.
522
+ *
523
+ * @realm shared
524
+ * @source https://wiki.facepunch.com/gmod/Player:DoCustomAnimEvent
525
+ */
526
+ DoCustomAnimEvent(self: Player, event: number, data: number): void;
527
+ }
528
+
529
+ interface Player {
530
+ /**
531
+ * Sends a third person reload animation event to the player.
532
+ *
533
+ * Similar to other animation event functions, calls [GM:DoAnimationEvent](https://wiki.facepunch.com/gmod/GM:DoAnimationEvent) with [PLAYERANIMEVENT_RELOAD](https://wiki.facepunch.com/gmod/Enums/PLAYERANIMEVENT) as the event and no extra data.
534
+ *
535
+ * @realm shared
536
+ * @source https://wiki.facepunch.com/gmod/Player:DoReloadEvent
537
+ */
538
+ DoReloadEvent(self: Player): void;
539
+ }
540
+
541
+ interface Player {
542
+ /**
543
+ * Sends a third person secondary fire animation event to the player.
544
+ *
545
+ * Similar to other animation event functions, calls [GM:DoAnimationEvent](https://wiki.facepunch.com/gmod/GM:DoAnimationEvent) with [PLAYERANIMEVENT_ATTACK_SECONDARY](https://wiki.facepunch.com/gmod/Enums/PLAYERANIMEVENT) as the event and no extra data.
546
+ *
547
+ * @realm shared
548
+ * @source https://wiki.facepunch.com/gmod/Player:DoSecondaryAttack
549
+ */
550
+ DoSecondaryAttack(self: Player): void;
551
+ }
552
+
553
+ interface Player {
554
+ /**
555
+ * Show/Hide the player's weapon's viewmodel.
556
+ * @realm shared
557
+ * @source https://wiki.facepunch.com/gmod/Player:DrawViewModel
558
+ */
559
+ DrawViewModel(self: Player, draw: boolean, vm?: number): void;
560
+ }
561
+
562
+ interface Player {
563
+ /**
564
+ * Show/Hide the player's weapon's worldmodel.
565
+ * @realm server
566
+ * @source https://wiki.facepunch.com/gmod/Player:DrawWorldModel
567
+ */
568
+ DrawWorldModel(self: Player, draw: boolean): void;
569
+ }
570
+
571
+ interface Player {
572
+ /**
573
+ * Drops the players' weapon of a specific class.
574
+ * @realm server
575
+ * @source https://wiki.facepunch.com/gmod/Player:DropNamedWeapon
576
+ */
577
+ DropNamedWeapon(self: Player, _class: string, target?: Vector, velocity?: Vector): void;
578
+ }
579
+
580
+ interface Player {
581
+ /**
582
+ * Drops any object the player is currently holding with either Gravity Gun, Physics Gun or `+use` (E key)
583
+ *
584
+ * See also [Entity:ForcePlayerDrop](https://wiki.facepunch.com/gmod/Entity:ForcePlayerDrop).
585
+ *
586
+ * @realm server
587
+ * @source https://wiki.facepunch.com/gmod/Player:DropObject
588
+ */
589
+ DropObject(self: Player, entity?: Entity): void;
590
+ }
591
+
592
+ interface Player {
593
+ /**
594
+ * Forces the player to drop the specified weapon
595
+ * @realm server
596
+ * @source https://wiki.facepunch.com/gmod/Player:DropWeapon
597
+ */
598
+ DropWeapon(self: Player, weapon?: Weapon, target?: Vector, velocity?: Vector): void;
599
+ }
600
+
601
+ interface Player {
602
+ /**
603
+ * Force puts the player into a specified vehicle.
604
+ * This **does not** bypass [GM:CanPlayerEnterVehicle](https://wiki.facepunch.com/gmod/GM:CanPlayerEnterVehicle).
605
+ *
606
+ * @realm server
607
+ * @source https://wiki.facepunch.com/gmod/Player:EnterVehicle
608
+ */
609
+ EnterVehicle(self: Player, vehicle: Vehicle): void;
610
+ }
611
+
612
+ interface Player {
613
+ /**
614
+ * Equips the player with the HEV suit.
615
+ *
616
+ * Allows the player to zoom, walk slowly, sprint, pickup armor batteries, use the health and armor stations and also shows the HUD.
617
+ * The player also emits a flatline sound on death, which can be overridden with [GM:PlayerDeathSound](https://wiki.facepunch.com/gmod/GM:PlayerDeathSound).
618
+ *
619
+ * The player is automatically equipped with the suit on spawn, if you wish to stop that, use [Player:RemoveSuit](https://wiki.facepunch.com/gmod/Player:RemoveSuit).
620
+ *
621
+ * @realm server
622
+ * @source https://wiki.facepunch.com/gmod/Player:EquipSuit
623
+ */
624
+ EquipSuit(self: Player): void;
625
+ }
626
+
627
+ interface Player {
628
+ /**
629
+ * Forces the player off the current ladder if they are on one.
630
+ * @realm server
631
+ * @source https://wiki.facepunch.com/gmod/Player:ExitLadder
632
+ */
633
+ ExitLadder(self: Player): void;
634
+ }
635
+
636
+ interface Player {
637
+ /**
638
+ * Forces the player to exit the vehicle if they're in one.
639
+ *
640
+ * This function will bypass [GM:CanExitVehicle](https://wiki.facepunch.com/gmod/GM:CanExitVehicle). See also [GM:PlayerLeaveVehicle](https://wiki.facepunch.com/gmod/GM:PlayerLeaveVehicle)
641
+ *
642
+ * @realm server
643
+ * @source https://wiki.facepunch.com/gmod/Player:ExitVehicle
644
+ */
645
+ ExitVehicle(self: Player): void;
646
+ }
647
+
648
+ interface Player {
649
+ /**
650
+ * Enables/Disables the player's flashlight.
651
+ *
652
+ * [Player:CanUseFlashlight](https://wiki.facepunch.com/gmod/Player:CanUseFlashlight) must be true in order for the player's flashlight to be changed.
653
+ * [GM:PlayerSwitchFlashlight](https://wiki.facepunch.com/gmod/GM:PlayerSwitchFlashlight) can block this function.
654
+ *
655
+ * **NOTE**: Added in [2025.11.12](https://gmod.facepunch.com/changelist/4026), the `gmod_flashlight` attachment is used as a source for the player's flashlight. In thirdperson, the playermodel and weapon worldmodel are checked; in firstperson, the viewmodel is checked. If the attachment isn't found, default engine functionality is used.
656
+ *
657
+ * The light sprite attached to the playermodel when the flashlight is on will also follow the playermodel's `gmod_flashlight` attachment if it exists.
658
+ *
659
+ *
660
+ *
661
+ * @realm server
662
+ * @source https://wiki.facepunch.com/gmod/Player:Flashlight
663
+ */
664
+ Flashlight(self: Player, isOn: boolean): void;
665
+ }
666
+
667
+ interface Player {
668
+ /**
669
+ * Returns true if the player's flashlight is on.
670
+ * @realm shared
671
+ * @source https://wiki.facepunch.com/gmod/Player:FlashlightIsOn
672
+ */
673
+ FlashlightIsOn(self: Player): boolean;
674
+ }
675
+
676
+ interface Player {
677
+ /**
678
+ * Returns the amount of frags a player has.
679
+ *
680
+ * **NOTE**: The value will change depending on the player's kill or suicide: +1 for a kill, -1 for a suicide.
681
+ *
682
+ *
683
+ * @realm shared
684
+ * @source https://wiki.facepunch.com/gmod/Player:Frags
685
+ */
686
+ Frags(self: Player): number;
687
+ }
688
+
689
+ interface Player {
690
+ /**
691
+ * Freeze the player. Frozen players cannot move, look around, or attack. Key bindings are still called. Similar to [Player:Lock](https://wiki.facepunch.com/gmod/Player:Lock) but the player can still take damage.
692
+ *
693
+ * Manages the [FL_FROZEN](https://wiki.facepunch.com/gmod/Enums/FL#FL_FROZEN) flag on the player.
694
+ *
695
+ *
696
+ * @realm server
697
+ * @source https://wiki.facepunch.com/gmod/Player:Freeze
698
+ */
699
+ Freeze(self: Player, frozen?: boolean): void;
700
+ }
701
+
702
+ interface Player {
703
+ /**
704
+ * Returns the player's active weapon.
705
+ *
706
+ * If used on a [Global.LocalPlayer](https://wiki.facepunch.com/gmod/Global.LocalPlayer)() and the player is spectating another player with `OBS_MODE_IN_EYE`, the weapon returned will be of the spectated player.
707
+ *
708
+ * @realm shared
709
+ * @source https://wiki.facepunch.com/gmod/Player:GetActiveWeapon
710
+ */
711
+ GetActiveWeapon(self: Player): Weapon;
712
+ }
713
+
714
+ interface Player {
715
+ /**
716
+ * Returns the player's current activity.
717
+ * @realm server
718
+ * @source https://wiki.facepunch.com/gmod/Player:GetActivity
719
+ */
720
+ GetActivity(self: Player): number;
721
+ }
722
+
723
+ interface Player {
724
+ /**
725
+ * Returns the direction that the player is aiming.
726
+ * @realm shared
727
+ * @source https://wiki.facepunch.com/gmod/Player:GetAimVector
728
+ */
729
+ GetAimVector(self: Player): Vector;
730
+ }
731
+
732
+ interface Player {
733
+ /**
734
+ * Returns true if the players' model is allowed to rotate around the pitch and roll axis.
735
+ * @realm shared
736
+ * @source https://wiki.facepunch.com/gmod/Player:GetAllowFullRotation
737
+ */
738
+ GetAllowFullRotation(self: Player): boolean;
739
+ }
740
+
741
+ interface Player {
742
+ /**
743
+ * Returns whether the player is allowed to use their weapons in a vehicle or not.
744
+ * @realm shared
745
+ * @source https://wiki.facepunch.com/gmod/Player:GetAllowWeaponsInVehicle
746
+ */
747
+ GetAllowWeaponsInVehicle(self: Player): boolean;
748
+ }
749
+
750
+ interface Player {
751
+ /**
752
+ * Returns a table of all ammo the player has.
753
+ * @realm shared
754
+ * @source https://wiki.facepunch.com/gmod/Player:GetAmmo
755
+ */
756
+ GetAmmo(self: Player): table;
757
+ }
758
+
759
+ interface Player {
760
+ /**
761
+ * Gets the amount of ammo the player has.
762
+ * @realm shared
763
+ * @source https://wiki.facepunch.com/gmod/Player:GetAmmoCount
764
+ */
765
+ GetAmmoCount(self: Player, ammotype: any): number;
766
+ }
767
+
768
+ interface Player {
769
+ /**
770
+ * Gets if the player will be pushed out of nocollided players.
771
+ * @realm shared
772
+ * @source https://wiki.facepunch.com/gmod/Player:GetAvoidPlayers
773
+ */
774
+ GetAvoidPlayers(self: Player): boolean;
775
+ }
776
+
777
+ interface Player {
778
+ /**
779
+ * Returns true if the player is able to walk using the (default) alt key.
780
+ * @realm shared
781
+ * @source https://wiki.facepunch.com/gmod/Player:GetCanWalk
782
+ */
783
+ GetCanWalk(self: Player): boolean;
784
+ }
785
+
786
+ interface Player {
787
+ /**
788
+ * Determines whenever the player is allowed to use the zoom functionality.
789
+ * @realm shared
790
+ * @source https://wiki.facepunch.com/gmod/Player:GetCanZoom
791
+ */
792
+ GetCanZoom(self: Player): boolean;
793
+ }
794
+
795
+ interface Player {
796
+ /**
797
+ * Returns the player's class id.
798
+ * @realm shared
799
+ * @source https://wiki.facepunch.com/gmod/Player:GetClassID
800
+ */
801
+ GetClassID(self: Player): number;
802
+ }
803
+
804
+ interface Player {
805
+ /**
806
+ * **NOTE**: This function is only available in Sandbox and its derivatives.
807
+ * Gets the total amount of entities of an entity type added by [Player:AddCount](https://wiki.facepunch.com/gmod/Player:AddCount).
808
+ *
809
+ * Default types:
810
+ * ```
811
+ * balloons
812
+ * buttons
813
+ * cameras
814
+ * dynamite
815
+ * effects
816
+ * emitters
817
+ * hoverballs
818
+ * lamps
819
+ * lights
820
+ * npcs
821
+ * props
822
+ * ragdolls
823
+ * sents
824
+ * thrusters
825
+ * vehicles
826
+ * wheels
827
+ * ```
828
+ * @realm shared
829
+ * @source https://wiki.facepunch.com/gmod/Player:GetCount
830
+ */
831
+ GetCount(self: Player, type: string, minus?: number): number;
832
+ }
833
+
834
+ interface Player {
835
+ /**
836
+ * Returns the crouched walk speed multiplier.
837
+ *
838
+ * See also [Player:GetWalkSpeed](https://wiki.facepunch.com/gmod/Player:GetWalkSpeed) and [Player:SetCrouchedWalkSpeed](https://wiki.facepunch.com/gmod/Player:SetCrouchedWalkSpeed).
839
+ *
840
+ * @realm shared
841
+ * @source https://wiki.facepunch.com/gmod/Player:GetCrouchedWalkSpeed
842
+ */
843
+ GetCrouchedWalkSpeed(self: Player): number;
844
+ }
845
+
846
+ interface Player {
847
+ /**
848
+ * Returns the last command which was sent by the specified player. This can only be called on the player which [Global.GetPredictionPlayer](https://wiki.facepunch.com/gmod/Global.GetPredictionPlayer)() returns.
849
+ *
850
+ * **NOTE**: When called clientside in singleplayer during [WEAPON:Think](https://wiki.facepunch.com/gmod/WEAPON:Think), it will return nothing as the hook is not technically predicted in that instance. See the note on the page.
851
+ *
852
+ *
853
+ * This will fail in [GM:StartCommand](https://wiki.facepunch.com/gmod/GM:StartCommand).
854
+ *
855
+ * @realm shared
856
+ * @source https://wiki.facepunch.com/gmod/Player:GetCurrentCommand
857
+ */
858
+ GetCurrentCommand(self: Player): CUserCmd;
859
+ }
860
+
861
+ interface Player {
862
+ /**
863
+ * Gets the current applied view offset, which transitions between the player's standing and ducked view offset depending on their duck state.
864
+ *
865
+ * Do not confuse with [Player:GetViewOffset](https://wiki.facepunch.com/gmod/Player:GetViewOffset) and [Player:GetViewOffsetDucked](https://wiki.facepunch.com/gmod/Player:GetViewOffsetDucked), which always return the standing or ducked offset respectively.
866
+ *
867
+ * @realm shared
868
+ * @source https://wiki.facepunch.com/gmod/Player:GetCurrentViewOffset
869
+ */
870
+ GetCurrentViewOffset(self: Player): Vector;
871
+ }
872
+
873
+ interface Player {
874
+ /**
875
+ * Gets the entity the player is currently driving via the [drive](https://wiki.facepunch.com/gmod/drive) library.
876
+ * @realm shared
877
+ * @source https://wiki.facepunch.com/gmod/Player:GetDrivingEntity
878
+ */
879
+ GetDrivingEntity(self: Player): Entity;
880
+ }
881
+
882
+ interface Player {
883
+ /**
884
+ * Returns driving mode of the player. See [Entity Driving](https://wiki.facepunch.com/gmod/Entity_Driving).
885
+ * @realm shared
886
+ * @source https://wiki.facepunch.com/gmod/Player:GetDrivingMode
887
+ */
888
+ GetDrivingMode(self: Player): number;
889
+ }
890
+
891
+ interface Player {
892
+ /**
893
+ * Returns a player's duck speed (in seconds)
894
+ * @realm shared
895
+ * @source https://wiki.facepunch.com/gmod/Player:GetDuckSpeed
896
+ */
897
+ GetDuckSpeed(self: Player): number;
898
+ }
899
+
900
+ interface Player {
901
+ /**
902
+ * Returns the entity the player is currently using, like func_tank mounted turrets or +use prop pickups.
903
+ * @realm shared
904
+ * @source https://wiki.facepunch.com/gmod/Player:GetEntityInUse
905
+ */
906
+ GetEntityInUse(self: Player): Entity;
907
+ }
908
+
909
+ interface Player {
910
+ /**
911
+ * Returns a table with information of what the player is looking at.
912
+ *
913
+ * The results of this function are **cached** clientside every frame.
914
+ *
915
+ * Uses [util.GetPlayerTrace](https://wiki.facepunch.com/gmod/util.GetPlayerTrace) internally and is therefore bound by its limits.
916
+ *
917
+ * See also [Player:GetEyeTraceNoCursor](https://wiki.facepunch.com/gmod/Player:GetEyeTraceNoCursor).
918
+ *
919
+ * @realm shared
920
+ * @source https://wiki.facepunch.com/gmod/Player:GetEyeTrace
921
+ */
922
+ GetEyeTrace(self: Player): TraceResult;
923
+ }
924
+
925
+ interface Player {
926
+ /**
927
+ * Returns the trace according to the players view direction, ignoring their mouse (holding C and moving the mouse in Sandbox).
928
+ *
929
+ * The results of this function are **cached** clientside every frame.
930
+ *
931
+ * Uses [util.GetPlayerTrace](https://wiki.facepunch.com/gmod/util.GetPlayerTrace) internally and is therefore bound by its limits.
932
+ *
933
+ * See also [Player:GetEyeTrace](https://wiki.facepunch.com/gmod/Player:GetEyeTrace).
934
+ *
935
+ * @realm shared
936
+ * @source https://wiki.facepunch.com/gmod/Player:GetEyeTraceNoCursor
937
+ */
938
+ GetEyeTraceNoCursor(self: Player): TraceResult;
939
+ }
940
+
941
+ interface Player {
942
+ /**
943
+ * Returns the FOV of the player.
944
+ * @realm shared
945
+ * @source https://wiki.facepunch.com/gmod/Player:GetFOV
946
+ */
947
+ GetFOV(self: Player): number;
948
+ }
949
+
950
+ interface Player {
951
+ /**
952
+ * Returns the color of a player's flashlight.
953
+ *
954
+ * @realm client
955
+ * @source https://wiki.facepunch.com/gmod/Player:GetFlashlightColor
956
+ */
957
+ GetFlashlightColor(self: Player): Color;
958
+ }
959
+
960
+ interface Player {
961
+ /**
962
+ * Returns the steam "relationship" towards the player.
963
+ * @realm client
964
+ * @source https://wiki.facepunch.com/gmod/Player:GetFriendStatus
965
+ */
966
+ GetFriendStatus(self: Player): string;
967
+ }
968
+
969
+ interface Player {
970
+ /**
971
+ * Gets the hands entity of a player
972
+ * @realm shared
973
+ * @source https://wiki.facepunch.com/gmod/Player:GetHands
974
+ */
975
+ GetHands(self: Player): Entity;
976
+ }
977
+
978
+ interface Player {
979
+ /**
980
+ * Returns the widget the player is hovering with their mouse.
981
+ * @realm shared
982
+ * @source https://wiki.facepunch.com/gmod/Player:GetHoveredWidget
983
+ */
984
+ GetHoveredWidget(self: Player): Entity;
985
+ }
986
+
987
+ interface Player {
988
+ /**
989
+ * Retrieves the minimum and maximum [Vectors](https://wiki.facepunch.com/gmod/Vector) of the [Axis-Aligned Bounding Box (AABB)](https://en.wikipedia.org/wiki/Minimum_bounding_box) used for the [Player's](https://wiki.facepunch.com/gmod/Player) physics and movement [Hull Traces](https://wiki.facepunch.com/gmod/util.TraceHull).
990
+ *
991
+ * See also: [Player:SetHull](https://wiki.facepunch.com/gmod/Player:SetHull), [Player:SetHullDuck](https://wiki.facepunch.com/gmod/Player:SetHullDuck), [Player:GetHullDuck](https://wiki.facepunch.com/gmod/Player:GetHullDuck)
992
+ *
993
+ * @realm shared
994
+ * @source https://wiki.facepunch.com/gmod/Player:GetHull
995
+ */
996
+ GetHull(self: Player): (Vector, Vector);
997
+ }
998
+
999
+ interface Player {
1000
+ /**
1001
+ * Retrieves the minimum and maximum [Vectors](https://wiki.facepunch.com/gmod/Vector) of the [Axis-Aligned Bounding Box (AABB)](https://en.wikipedia.org/wiki/Minimum_bounding_box) used for the [Player's](https://wiki.facepunch.com/gmod/Player) physics and movement [Hull Traces](https://wiki.facepunch.com/gmod/util.TraceHull) while they are crouching (or "Ducking").
1002
+ *
1003
+ * See also: [Player:SetHullDuck](https://wiki.facepunch.com/gmod/Player:SetHullDuck), [Player:GetHull](https://wiki.facepunch.com/gmod/Player:GetHull), [Player:SetHull](https://wiki.facepunch.com/gmod/Player:SetHull)
1004
+ *
1005
+ * @realm shared
1006
+ * @source https://wiki.facepunch.com/gmod/Player:GetHullDuck
1007
+ */
1008
+ GetHullDuck(self: Player): (Vector, Vector);
1009
+ }
1010
+
1011
+ interface Player {
1012
+ /**
1013
+ * Retrieves the value of a client-side [ConVar](https://wiki.facepunch.com/gmod/ConVar). The [ConVar](https://wiki.facepunch.com/gmod/ConVar) must have a [FCVAR_USERINFO](https://wiki.facepunch.com/gmod/Enums/FCVAR) flag for this to work.
1014
+ *
1015
+ * On client this function will return value of the local player, regardless of which player the function was called on!
1016
+ *
1017
+ * See [Player:GetInfoNum](https://wiki.facepunch.com/gmod/Player:GetInfoNum) for the same function that automatically converts the string to a number.
1018
+ *
1019
+ * @realm shared
1020
+ * @source https://wiki.facepunch.com/gmod/Player:GetInfo
1021
+ */
1022
+ GetInfo(self: Player, cVarName: string): string;
1023
+ }
1024
+
1025
+ interface Player {
1026
+ /**
1027
+ * Retrieves the numeric value of a client-side convar, returns nil if value is not convertible to a number. The [ConVar](https://wiki.facepunch.com/gmod/ConVar) must have a [FCVAR_USERINFO](https://wiki.facepunch.com/gmod/Enums/FCVAR) flag for this to work.
1028
+ * @realm shared
1029
+ * @source https://wiki.facepunch.com/gmod/Player:GetInfoNum
1030
+ */
1031
+ GetInfoNum(self: Player, cVarName: string, _default: number): number;
1032
+ }
1033
+
1034
+ interface Player {
1035
+ /**
1036
+ * Returns the jump power of the player
1037
+ * @realm shared
1038
+ * @source https://wiki.facepunch.com/gmod/Player:GetJumpPower
1039
+ */
1040
+ GetJumpPower(self: Player): number;
1041
+ }
1042
+
1043
+ interface Player {
1044
+ /**
1045
+ * Returns the player's ladder climbing speed.
1046
+ *
1047
+ * See [Player:GetWalkSpeed](https://wiki.facepunch.com/gmod/Player:GetWalkSpeed) for normal walking speed, [Player:GetRunSpeed](https://wiki.facepunch.com/gmod/Player:GetRunSpeed) for sprinting speed and [Player:GetSlowWalkSpeed](https://wiki.facepunch.com/gmod/Player:GetSlowWalkSpeed) for slow walking speed.
1048
+ *
1049
+ * @realm shared
1050
+ * @source https://wiki.facepunch.com/gmod/Player:GetLadderClimbSpeed
1051
+ */
1052
+ GetLadderClimbSpeed(self: Player): number;
1053
+ }
1054
+
1055
+ interface Player {
1056
+ /**
1057
+ * Returns the timescale multiplier of the player movement.
1058
+ * @realm shared
1059
+ * @source https://wiki.facepunch.com/gmod/Player:GetLaggedMovementValue
1060
+ */
1061
+ GetLaggedMovementValue(self: Player): number;
1062
+ }
1063
+
1064
+ interface Player {
1065
+ /**
1066
+ * Returns the maximum amount of armor the player should have. Default value is 100.
1067
+ *
1068
+ * @realm shared
1069
+ * @source https://wiki.facepunch.com/gmod/Player:GetMaxArmor
1070
+ */
1071
+ GetMaxArmor(self: Player): number;
1072
+ }
1073
+
1074
+ interface Player {
1075
+ /**
1076
+ * Returns the player's maximum movement speed.
1077
+ *
1078
+ * See also [Player:SetMaxSpeed](https://wiki.facepunch.com/gmod/Player:SetMaxSpeed), [Player:GetWalkSpeed](https://wiki.facepunch.com/gmod/Player:GetWalkSpeed) and [Player:GetRunSpeed](https://wiki.facepunch.com/gmod/Player:GetRunSpeed).
1079
+ *
1080
+ * @realm shared
1081
+ * @source https://wiki.facepunch.com/gmod/Player:GetMaxSpeed
1082
+ */
1083
+ GetMaxSpeed(self: Player): number;
1084
+ }
1085
+
1086
+ interface Player {
1087
+ /**
1088
+ * Returns whenever the player is set not to collide with their teammates.
1089
+ * @realm shared
1090
+ * @source https://wiki.facepunch.com/gmod/Player:GetNoCollideWithTeammates
1091
+ */
1092
+ GetNoCollideWithTeammates(self: Player): boolean;
1093
+ }
1094
+
1095
+ interface Player {
1096
+ /**
1097
+ * Returns the the observer mode of the player
1098
+ * @realm shared
1099
+ * @source https://wiki.facepunch.com/gmod/Player:GetObserverMode
1100
+ */
1101
+ GetObserverMode(self: Player): number;
1102
+ }
1103
+
1104
+ interface Player {
1105
+ /**
1106
+ * Returns the entity the player is currently observing.
1107
+ *
1108
+ * Set using [Player:SpectateEntity](https://wiki.facepunch.com/gmod/Player:SpectateEntity).
1109
+ *
1110
+ * @realm shared
1111
+ * @source https://wiki.facepunch.com/gmod/Player:GetObserverTarget
1112
+ */
1113
+ GetObserverTarget(self: Player): Entity;
1114
+ }
1115
+
1116
+ interface Player {
1117
+ /**
1118
+ * Returns a **P**ersistent **Data** key-value pair from the SQL database. (`sv.db` when called on server, `cl.db` when called on client)
1119
+ *
1120
+ * Internally uses the [sql](https://wiki.facepunch.com/gmod/sql) library. See [util.GetPData](https://wiki.facepunch.com/gmod/util.GetPData) for cases when the player is not currently on the server.
1121
+ *
1122
+ * **NOTE**: This function internally uses [Player:SteamID64](https://wiki.facepunch.com/gmod/Player:SteamID64), it previously utilized [Player:UniqueID](https://wiki.facepunch.com/gmod/Player:UniqueID) which can cause collisions (two or more players sharing the same PData entry). [Player:SetPData](https://wiki.facepunch.com/gmod/Player:SetPData) now replaces all instances of [Player:UniqueID](https://wiki.facepunch.com/gmod/Player:UniqueID) with [Player:SteamID64](https://wiki.facepunch.com/gmod/Player:SteamID64) when running [Player:SetPData](https://wiki.facepunch.com/gmod/Player:SetPData)
1123
+ *
1124
+ *
1125
+ * **NOTE**: PData is not networked from servers to clients!
1126
+ *
1127
+ *
1128
+ * @realm shared
1129
+ * @source https://wiki.facepunch.com/gmod/Player:GetPData
1130
+ */
1131
+ GetPData(self: Player, key: string, _default?: any): string;
1132
+ }
1133
+
1134
+ interface Player {
1135
+ /**
1136
+ * Returns a player's character model color.
1137
+ *
1138
+ * The part of the model that is colored is determined by the model's materials, and is therefore different for each model.
1139
+ *
1140
+ * See [Player:GetWeaponColor](https://wiki.facepunch.com/gmod/Player:GetWeaponColor) for the accompanying function for the weapon color.
1141
+ *
1142
+ * **NOTE**: Override this function clientside on any Entity (including a player) with a supported model set (such as default player models) and returned color will apply to the model. This is done via the `PlayerColor` [matproxy](https://wiki.facepunch.com/gmod/matproxy).
1143
+ *
1144
+ *
1145
+ * @realm shared
1146
+ * @source https://wiki.facepunch.com/gmod/Player:GetPlayerColor
1147
+ */
1148
+ GetPlayerColor(self: Player): Vector;
1149
+ }
1150
+
1151
+ interface Player {
1152
+ /**
1153
+ * Returns a table containing player information.
1154
+ * @realm shared
1155
+ * @source https://wiki.facepunch.com/gmod/Player:GetPlayerInfo
1156
+ */
1157
+ GetPlayerInfo(self: Player): table;
1158
+ }
1159
+
1160
+ interface Player {
1161
+ /**
1162
+ * Returns the widget entity the player is using.
1163
+ *
1164
+ * Having a pressed widget stops the player from firing their weapon to allow input to be passed onto the widget.
1165
+ *
1166
+ * @realm shared
1167
+ * @source https://wiki.facepunch.com/gmod/Player:GetPressedWidget
1168
+ */
1169
+ GetPressedWidget(self: Player): Entity;
1170
+ }
1171
+
1172
+ interface Player {
1173
+ /**
1174
+ * Returns the weapon the player previously had equipped.
1175
+ * @realm shared
1176
+ * @source https://wiki.facepunch.com/gmod/Player:GetPreviousWeapon
1177
+ */
1178
+ GetPreviousWeapon(self: Player): Entity;
1179
+ }
1180
+
1181
+ interface Player {
1182
+ /**
1183
+ * Returns players screen punch effect angle. See [Player:ViewPunch](https://wiki.facepunch.com/gmod/Player:ViewPunch) and [Player:SetViewPunchAngles](https://wiki.facepunch.com/gmod/Player:SetViewPunchAngles)
1184
+ *
1185
+ *
1186
+ * @realm shared
1187
+ * @source https://wiki.facepunch.com/gmod/Player:GetPunchAngle
1188
+ * @deprecated You should use Player:GetViewPunchAngles instead.
1189
+ */
1190
+ GetPunchAngle(self: Player): Angle;
1191
+ }
1192
+
1193
+ interface Player {
1194
+ /**
1195
+ * Returns players death ragdoll. The ragdoll is created by [Player:CreateRagdoll](https://wiki.facepunch.com/gmod/Player:CreateRagdoll).
1196
+ * **NOTE**: Calling [Entity:GetPos](https://wiki.facepunch.com/gmod/Entity:GetPos) server-side with this function then will return the position where [Player:CreateRagdoll](https://wiki.facepunch.com/gmod/Player:CreateRagdoll) was used, as it is a hl2mp_ragdoll which is a serverside point entity that creates a clientside ragdoll for everyone (opposed to prop_ragdoll that is serverside and networks).
1197
+ *
1198
+ *
1199
+ * @realm shared
1200
+ * @source https://wiki.facepunch.com/gmod/Player:GetRagdollEntity
1201
+ */
1202
+ GetRagdollEntity(self: Player): Entity;
1203
+ }
1204
+
1205
+ interface Player {
1206
+ /**
1207
+ * Returns the player's sprint speed.
1208
+ *
1209
+ * See also [Player:SetRunSpeed](https://wiki.facepunch.com/gmod/Player:SetRunSpeed), [Player:GetWalkSpeed](https://wiki.facepunch.com/gmod/Player:GetWalkSpeed) and [Player:GetMaxSpeed](https://wiki.facepunch.com/gmod/Player:GetMaxSpeed).
1210
+ *
1211
+ * @realm shared
1212
+ * @source https://wiki.facepunch.com/gmod/Player:GetRunSpeed
1213
+ */
1214
+ GetRunSpeed(self: Player): number;
1215
+ }
1216
+
1217
+ interface Player {
1218
+ /**
1219
+ * Returns the position of a Player's view
1220
+ *
1221
+ * **NOTE**: This is the same as calling [Entity:EyePos](https://wiki.facepunch.com/gmod/Entity:EyePos) on the player.
1222
+ *
1223
+ *
1224
+ * @realm shared
1225
+ * @source https://wiki.facepunch.com/gmod/Player:GetShootPos
1226
+ */
1227
+ GetShootPos(self: Player): Vector;
1228
+ }
1229
+
1230
+ interface Player {
1231
+ /**
1232
+ * Returns the player's slow walking speed, which is activated via +WALK keybind.
1233
+ *
1234
+ * See [Player:GetWalkSpeed](https://wiki.facepunch.com/gmod/Player:GetWalkSpeed) for normal walking speed, [Player:GetRunSpeed](https://wiki.facepunch.com/gmod/Player:GetRunSpeed) for sprinting speed and [Player:GetLadderClimbSpeed](https://wiki.facepunch.com/gmod/Player:GetLadderClimbSpeed) for ladder climb speed.
1235
+ *
1236
+ * @realm shared
1237
+ * @source https://wiki.facepunch.com/gmod/Player:GetSlowWalkSpeed
1238
+ */
1239
+ GetSlowWalkSpeed(self: Player): number;
1240
+ }
1241
+
1242
+ interface Player {
1243
+ /**
1244
+ * Returns the maximum height player can step onto.
1245
+ * @realm shared
1246
+ * @source https://wiki.facepunch.com/gmod/Player:GetStepSize
1247
+ */
1248
+ GetStepSize(self: Player): number;
1249
+ }
1250
+
1251
+ interface Player {
1252
+ /**
1253
+ * Returns the player's HEV suit power.
1254
+ *
1255
+ * This will only work for the local player when used clientside.
1256
+ *
1257
+ * @realm shared
1258
+ * @source https://wiki.facepunch.com/gmod/Player:GetSuitPower
1259
+ */
1260
+ GetSuitPower(self: Player): number;
1261
+ }
1262
+
1263
+ interface Player {
1264
+ /**
1265
+ * Returns the number of seconds that the player has been timing out for. You can check if a player is timing out with [Player:IsTimingOut](https://wiki.facepunch.com/gmod/Player:IsTimingOut).
1266
+ *
1267
+ * **NOTE**: This function is relatively useless because it is tied to the value of the `sv_timeout` ConVar, which is irrelevant to the description above. [This is not considered as a bug](https://discord.com/channels/565105920414318602/567617926991970306/748970396224585738).
1268
+ *
1269
+ * @realm server
1270
+ * @source https://wiki.facepunch.com/gmod/Player:GetTimeoutSeconds
1271
+ */
1272
+ GetTimeoutSeconds(self: Player): number;
1273
+ }
1274
+
1275
+ interface Player {
1276
+ /**
1277
+ * Returns [TOOL](https://wiki.facepunch.com/gmod/Structures/TOOL) table of players current tool, or of the one specified.
1278
+ * @realm shared
1279
+ * @source https://wiki.facepunch.com/gmod/Player:GetTool
1280
+ */
1281
+ GetTool(self: Player, mode?: string): table;
1282
+ }
1283
+
1284
+ interface Player {
1285
+ /**
1286
+ * Returns a player's unduck speed (in seconds)
1287
+ * @realm shared
1288
+ * @source https://wiki.facepunch.com/gmod/Player:GetUnDuckSpeed
1289
+ */
1290
+ GetUnDuckSpeed(self: Player): number;
1291
+ }
1292
+
1293
+ interface Player {
1294
+ /**
1295
+ * Returns the entity the player would use if they would press their `+use` keybind.
1296
+ * **NOTE**: Because entity physics objects usually do not exist on the client, the client's use entity will resolve to whatever the crosshair is placed on within a little less than 72 units of the player's eye position. This differs from the entity returned by the server, which has fully physical use checking. See [util.TraceHull](https://wiki.facepunch.com/gmod/util.TraceHull).
1297
+ *
1298
+ * Issue tracker: [5027](https://github.com/Facepunch/garrysmod-issues/issues/5027)
1299
+ *
1300
+ *
1301
+ * @realm shared
1302
+ * @source https://wiki.facepunch.com/gmod/Player:GetUseEntity
1303
+ */
1304
+ GetUseEntity(self: Player): Entity;
1305
+ }
1306
+
1307
+ interface Player {
1308
+ /**
1309
+ * Returns the player's user group. By default, player user groups are loaded from `garrysmod/settings/users.txt`.
1310
+ * @realm shared
1311
+ * @source https://wiki.facepunch.com/gmod/Player:GetUserGroup
1312
+ */
1313
+ GetUserGroup(self: Player): string;
1314
+ }
1315
+
1316
+ interface Player {
1317
+ /**
1318
+ * Returns the vehicle the player is driving.
1319
+ * @realm shared
1320
+ * @source https://wiki.facepunch.com/gmod/Player:GetVehicle
1321
+ */
1322
+ GetVehicle(self: Player): Vehicle;
1323
+ }
1324
+
1325
+ interface Player {
1326
+ /**
1327
+ * Returns the entity the player is using to see from (such as the player itself, the camera, or another entity).
1328
+ *
1329
+ * **NOTE**: This function will return a [NULL Entity] until [Player:SetViewEntity](https://wiki.facepunch.com/gmod/Player:SetViewEntity) has been used.
1330
+ *
1331
+ * It will also not return the currently spectated entity. See [Player:GetObserverTarget](https://wiki.facepunch.com/gmod/Player:GetObserverTarget).
1332
+ *
1333
+ *
1334
+ * @realm shared
1335
+ * @source https://wiki.facepunch.com/gmod/Player:GetViewEntity
1336
+ */
1337
+ GetViewEntity(self: Player): Entity;
1338
+ }
1339
+
1340
+ interface Player {
1341
+ /**
1342
+ * Returns the player's view model entity by the index.
1343
+ * Each player has 3 view models by default, but only the first one is used.
1344
+ *
1345
+ * To use the other viewmodels in your SWEP, see [Entity:SetWeaponModel](https://wiki.facepunch.com/gmod/Entity:SetWeaponModel).
1346
+ *
1347
+ * **NOTE**: In the Client [realm](https://wiki.facepunch.com/gmod/States), other players' viewmodels are not available unless they are being spectated.
1348
+ *
1349
+ *
1350
+ * @realm shared
1351
+ * @source https://wiki.facepunch.com/gmod/Player:GetViewModel
1352
+ */
1353
+ GetViewModel(self: Player, index?: number): Entity;
1354
+ }
1355
+
1356
+ interface Player {
1357
+ /**
1358
+ * Returns the view offset of the player, which equals the difference between the player's actual position and their view when standing.
1359
+ *
1360
+ * See also [Player:GetViewOffsetDucked](https://wiki.facepunch.com/gmod/Player:GetViewOffsetDucked).
1361
+ *
1362
+ * @realm shared
1363
+ * @source https://wiki.facepunch.com/gmod/Player:GetViewOffset
1364
+ */
1365
+ GetViewOffset(self: Player): Vector;
1366
+ }
1367
+
1368
+ interface Player {
1369
+ /**
1370
+ * Returns the ducked view offset of the player, which equals the difference between the player's actual position and their view when ducked.
1371
+ *
1372
+ * See also [Player:GetViewOffset](https://wiki.facepunch.com/gmod/Player:GetViewOffset).
1373
+ *
1374
+ * @realm shared
1375
+ * @source https://wiki.facepunch.com/gmod/Player:GetViewOffsetDucked
1376
+ */
1377
+ GetViewOffsetDucked(self: Player): Vector;
1378
+ }
1379
+
1380
+ interface Player {
1381
+ /**
1382
+ * Returns players screen punch effect angle.
1383
+ * @realm shared
1384
+ * @source https://wiki.facepunch.com/gmod/Player:GetViewPunchAngles
1385
+ */
1386
+ GetViewPunchAngles(self: Player): Angle;
1387
+ }
1388
+
1389
+ interface Player {
1390
+ /**
1391
+ * Returns client's view punch velocity. See [Player:ViewPunch](https://wiki.facepunch.com/gmod/Player:ViewPunch) and [Player:SetViewPunchVelocity](https://wiki.facepunch.com/gmod/Player:SetViewPunchVelocity)
1392
+ * @realm shared
1393
+ * @source https://wiki.facepunch.com/gmod/Player:GetViewPunchVelocity
1394
+ */
1395
+ GetViewPunchVelocity(self: Player): Angle;
1396
+ }
1397
+
1398
+ interface Player {
1399
+ /**
1400
+ * Returns the current voice volume scale for given player on client.
1401
+ * @realm client
1402
+ * @source https://wiki.facepunch.com/gmod/Player:GetVoiceVolumeScale
1403
+ */
1404
+ GetVoiceVolumeScale(self: Player): number;
1405
+ }
1406
+
1407
+ interface Player {
1408
+ /**
1409
+ * Returns the player's normal walking speed. Not sprinting, not slow walking. (+walk)
1410
+ *
1411
+ * See also [Player:SetWalkSpeed](https://wiki.facepunch.com/gmod/Player:SetWalkSpeed), [Player:GetMaxSpeed](https://wiki.facepunch.com/gmod/Player:GetMaxSpeed) and [Player:GetRunSpeed](https://wiki.facepunch.com/gmod/Player:GetRunSpeed).
1412
+ *
1413
+ * @realm shared
1414
+ * @source https://wiki.facepunch.com/gmod/Player:GetWalkSpeed
1415
+ */
1416
+ GetWalkSpeed(self: Player): number;
1417
+ }
1418
+
1419
+ interface Player {
1420
+ /**
1421
+ * Returns the weapon for the specified class
1422
+ * @realm shared
1423
+ * @source https://wiki.facepunch.com/gmod/Player:GetWeapon
1424
+ */
1425
+ GetWeapon(self: Player, className: string): Weapon;
1426
+ }
1427
+
1428
+ interface Player {
1429
+ /**
1430
+ * Returns a player's weapon color.
1431
+ *
1432
+ * The part of the model that is colored is determined by the model itself, and is different for each model.
1433
+ *
1434
+ * See [Player:GetPlayerColor](https://wiki.facepunch.com/gmod/Player:GetPlayerColor) for the accompanying function for the player character model color.
1435
+ *
1436
+ * @realm shared
1437
+ * @source https://wiki.facepunch.com/gmod/Player:GetWeaponColor
1438
+ */
1439
+ GetWeaponColor(self: Player): Vector;
1440
+ }
1441
+
1442
+ interface Player {
1443
+ /**
1444
+ * Returns a table of the player's weapons.
1445
+ * **NOTE**: This function returns a sequential table. Prefer to loop it with [Global.ipairs](https://wiki.facepunch.com/gmod/Global.ipairs) instead of the [Global.pairs](https://wiki.facepunch.com/gmod/Global.pairs) function.
1446
+ *
1447
+ *
1448
+ * @realm shared
1449
+ * @source https://wiki.facepunch.com/gmod/Player:GetWeapons
1450
+ */
1451
+ GetWeapons(self: Player): table;
1452
+ }
1453
+
1454
+ interface Player {
1455
+ /**
1456
+ * Gives the player a weapon.
1457
+ *
1458
+ * This function will call [GM:PlayerCanPickupWeapon](https://wiki.facepunch.com/gmod/GM:PlayerCanPickupWeapon). If that hook returns false, this function will do nothing.
1459
+ *
1460
+ * **NOTE**: While this function is meant for weapons/pickupables only, it is **not** restricted to weapons. Any entity can be spawned using this function, including NPCs and SENTs.
1461
+ *
1462
+ *
1463
+ * @realm server
1464
+ * @source https://wiki.facepunch.com/gmod/Player:Give
1465
+ */
1466
+ Give(self: Player, weaponClassName: string, bNoAmmo?: boolean): Weapon;
1467
+ }
1468
+
1469
+ interface Player {
1470
+ /**
1471
+ * Gives ammo to a player
1472
+ * @realm server
1473
+ * @source https://wiki.facepunch.com/gmod/Player:GiveAmmo
1474
+ */
1475
+ GiveAmmo(self: Player, amount: number, type: string | number, hidePopup?: boolean): number;
1476
+ }
1477
+
1478
+ interface Player {
1479
+ /**
1480
+ * Disables god mode on the player. Removes the [FL_GODMODE](https://wiki.facepunch.com/gmod/Enums/FL#FL_GODMODE) flag from the player.
1481
+ * @realm server
1482
+ * @source https://wiki.facepunch.com/gmod/Player:GodDisable
1483
+ */
1484
+ GodDisable(self: Player): void;
1485
+ }
1486
+
1487
+ interface Player {
1488
+ /**
1489
+ * Enables god mode on the player. Adds the [FL_GODMODE](https://wiki.facepunch.com/gmod/Enums/FL#FL_GODMODE) flag to the player.
1490
+ * @realm server
1491
+ * @source https://wiki.facepunch.com/gmod/Player:GodEnable
1492
+ */
1493
+ GodEnable(self: Player): void;
1494
+ }
1495
+
1496
+ interface Player {
1497
+ /**
1498
+ * Returns whether the player has god mode or not, contolled by [Player:GodEnable](https://wiki.facepunch.com/gmod/Player:GodEnable) and [Player:GodDisable](https://wiki.facepunch.com/gmod/Player:GodDisable).
1499
+ *
1500
+ * @realm shared
1501
+ * @source https://wiki.facepunch.com/gmod/Player:HasGodMode
1502
+ */
1503
+ HasGodMode(self: Player): boolean;
1504
+ }
1505
+
1506
+ interface Player {
1507
+ /**
1508
+ * Returns if the player has the specified weapon
1509
+ * @realm shared
1510
+ * @source https://wiki.facepunch.com/gmod/Player:HasWeapon
1511
+ */
1512
+ HasWeapon(self: Player, className: string): boolean;
1513
+ }
1514
+
1515
+ interface Player {
1516
+ /**
1517
+ * Returns the player's IP address and connection port in ip:port form
1518
+ * **NOTE**: Returns `Error!` for bots.
1519
+ *
1520
+ * @realm server
1521
+ * @source https://wiki.facepunch.com/gmod/Player:IPAddress
1522
+ */
1523
+ IPAddress(self: Player): string;
1524
+ }
1525
+
1526
+ interface Player {
1527
+ /**
1528
+ * Returns if the player is in a vehicle
1529
+ * @realm shared
1530
+ * @source https://wiki.facepunch.com/gmod/Player:InVehicle
1531
+ */
1532
+ InVehicle(self: Player): boolean;
1533
+ }
1534
+
1535
+ interface Player {
1536
+ /**
1537
+ * Returns whether the player is an admin or not. It will also return `true` if the player is [Player:IsSuperAdmin](https://wiki.facepunch.com/gmod/Player:IsSuperAdmin) by default.
1538
+ *
1539
+ * Internally this is determined by [Player:IsUserGroup](https://wiki.facepunch.com/gmod/Player:IsUserGroup).
1540
+ *
1541
+ * @realm shared
1542
+ * @source https://wiki.facepunch.com/gmod/Player:IsAdmin
1543
+ */
1544
+ IsAdmin(self: Player): boolean;
1545
+ }
1546
+
1547
+ interface Player {
1548
+ /**
1549
+ * Returns if the player is an bot or not
1550
+ * @realm shared
1551
+ * @source https://wiki.facepunch.com/gmod/Player:IsBot
1552
+ */
1553
+ IsBot(self: Player): boolean;
1554
+ }
1555
+
1556
+ interface Player {
1557
+ /**
1558
+ * Returns true from the point when the player is sending client info but not fully in the game until they disconnect.
1559
+ * @realm server
1560
+ * @source https://wiki.facepunch.com/gmod/Player:IsConnected
1561
+ */
1562
+ IsConnected(self: Player): boolean;
1563
+ }
1564
+
1565
+ interface Player {
1566
+ /**
1567
+ * Used to find out if a player is currently 'driving' an entity (by which we mean 'right click > drive' ).
1568
+ * @realm shared
1569
+ * @source https://wiki.facepunch.com/gmod/Player:IsDrivingEntity
1570
+ */
1571
+ IsDrivingEntity(self: Player): boolean;
1572
+ }
1573
+
1574
+ interface Player {
1575
+ /**
1576
+ * Returns whether the players movement is currently frozen, controlled by [Player:Freeze](https://wiki.facepunch.com/gmod/Player:Freeze).
1577
+ * @realm shared
1578
+ * @source https://wiki.facepunch.com/gmod/Player:IsFrozen
1579
+ */
1580
+ IsFrozen(self: Player): boolean;
1581
+ }
1582
+
1583
+ interface Player {
1584
+ /**
1585
+ * Returns whether the player identity was confirmed by the Steam network.
1586
+ *
1587
+ * See also [GM:NetworkIDValidated](https://wiki.facepunch.com/gmod/GM:NetworkIDValidated).
1588
+ *
1589
+ * @realm server
1590
+ * @source https://wiki.facepunch.com/gmod/Player:IsFullyAuthenticated
1591
+ */
1592
+ IsFullyAuthenticated(self: Player): boolean;
1593
+ }
1594
+
1595
+ interface Player {
1596
+ /**
1597
+ * Returns if a player is the host of the current session.
1598
+ * @realm shared
1599
+ * @source https://wiki.facepunch.com/gmod/Player:IsListenServerHost
1600
+ */
1601
+ IsListenServerHost(self: Player): boolean;
1602
+ }
1603
+
1604
+ interface Player {
1605
+ /**
1606
+ * Returns whether or not the player is voice muted locally.
1607
+ * @realm client
1608
+ * @source https://wiki.facepunch.com/gmod/Player:IsMuted
1609
+ */
1610
+ IsMuted(self: Player): boolean;
1611
+ }
1612
+
1613
+ interface Player {
1614
+ /**
1615
+ * Returns true if the player is playing a taunt.
1616
+ * @realm shared
1617
+ * @source https://wiki.facepunch.com/gmod/Player:IsPlayingTaunt
1618
+ */
1619
+ IsPlayingTaunt(self: Player): boolean;
1620
+ }
1621
+
1622
+ interface Player {
1623
+ /**
1624
+ * Returns whenever the player is heard by the local player clientside, or if the player is speaking serverside.
1625
+ * @realm shared
1626
+ * @source https://wiki.facepunch.com/gmod/Player:IsSpeaking
1627
+ */
1628
+ IsSpeaking(self: Player): boolean;
1629
+ }
1630
+
1631
+ interface Player {
1632
+ /**
1633
+ * Returns whether the player is currently sprinting or not, specifically if they are holding their sprint key and are allowed to sprint.
1634
+ *
1635
+ * This will not check if the player is currently sprinting into a wall. (i.e. holding their sprint key but not moving)
1636
+ * @realm shared
1637
+ * @source https://wiki.facepunch.com/gmod/Player:IsSprinting
1638
+ */
1639
+ IsSprinting(self: Player): boolean;
1640
+ }
1641
+
1642
+ interface Player {
1643
+ /**
1644
+ * Returns whenever the player is equipped with the suit item.
1645
+ *
1646
+ * This will only work for the local player when used clientside.
1647
+ *
1648
+ * @realm shared
1649
+ * @source https://wiki.facepunch.com/gmod/Player:IsSuitEquipped
1650
+ */
1651
+ IsSuitEquipped(self: Player): boolean;
1652
+ }
1653
+
1654
+ interface Player {
1655
+ /**
1656
+ * Returns whether the player is a super admin.
1657
+ *
1658
+ * Internally this is determined by [Player:IsUserGroup](https://wiki.facepunch.com/gmod/Player:IsUserGroup). See also [Player:IsAdmin](https://wiki.facepunch.com/gmod/Player:IsAdmin).
1659
+ *
1660
+ * @realm shared
1661
+ * @source https://wiki.facepunch.com/gmod/Player:IsSuperAdmin
1662
+ */
1663
+ IsSuperAdmin(self: Player): boolean;
1664
+ }
1665
+
1666
+ interface Player {
1667
+ /**
1668
+ * Returns `true` if the player is timing out (i.e. is losing connection), `false` otherwise.
1669
+ *
1670
+ * A player is considered timing out when more than 4 seconds has elapsed since a network packet was received from given player.
1671
+ * @realm server
1672
+ * @source https://wiki.facepunch.com/gmod/Player:IsTimingOut
1673
+ */
1674
+ IsTimingOut(self: Player): boolean;
1675
+ }
1676
+
1677
+ interface Player {
1678
+ /**
1679
+ * Returns whether the player is typing in their chat.
1680
+ *
1681
+ * This may not work properly if the server uses a custom chatbox.
1682
+ *
1683
+ * @realm shared
1684
+ * @source https://wiki.facepunch.com/gmod/Player:IsTyping
1685
+ */
1686
+ IsTyping(self: Player): boolean;
1687
+ }
1688
+
1689
+ interface Player {
1690
+ /**
1691
+ * Returns whether the player is in specified group or not. See [Player:GetUserGroup](https://wiki.facepunch.com/gmod/Player:GetUserGroup) for a way to get player's user group.
1692
+ * @realm shared
1693
+ * @source https://wiki.facepunch.com/gmod/Player:IsUserGroup
1694
+ */
1695
+ IsUserGroup(self: Player, groupName: string): boolean;
1696
+ }
1697
+
1698
+ interface Player {
1699
+ /**
1700
+ * Returns if the player can be heard by the local player.
1701
+ * @realm client
1702
+ * @source https://wiki.facepunch.com/gmod/Player:IsVoiceAudible
1703
+ */
1704
+ IsVoiceAudible(self: Player): boolean;
1705
+ }
1706
+
1707
+ interface Player {
1708
+ /**
1709
+ * Returns if the player currently walking. (`+walk` keybind)
1710
+ * @realm shared
1711
+ * @source https://wiki.facepunch.com/gmod/Player:IsWalking
1712
+ */
1713
+ IsWalking(self: Player): boolean;
1714
+ }
1715
+
1716
+ interface Player {
1717
+ /**
1718
+ * Returns whether the player is using the world clicking feature, see [Panel:SetWorldClicker](https://wiki.facepunch.com/gmod/Panel:SetWorldClicker)
1719
+ *
1720
+ * @realm shared
1721
+ * @source https://wiki.facepunch.com/gmod/Player:IsWorldClicking
1722
+ */
1723
+ IsWorldClicking(self: Player): boolean;
1724
+ }
1725
+
1726
+ interface Player {
1727
+ /**
1728
+ * Returns whether the world clicking is disabled for given player or not. See [Player:DisableWorldClicking](https://wiki.facepunch.com/gmod/Player:DisableWorldClicking).
1729
+ *
1730
+ * @realm shared
1731
+ * @source https://wiki.facepunch.com/gmod/Player:IsWorldClickingDisabled
1732
+ */
1733
+ IsWorldClickingDisabled(self: Player): boolean;
1734
+ }
1735
+
1736
+ interface Player {
1737
+ /**
1738
+ * Returns whether a key is down. This is not networked to other players, meaning only the local client can see the keys they are pressing.
1739
+ * @realm shared
1740
+ * @source https://wiki.facepunch.com/gmod/Player:KeyDown
1741
+ */
1742
+ KeyDown(self: Player, key: number): boolean;
1743
+ }
1744
+
1745
+ interface Player {
1746
+ /**
1747
+ * Gets whether a key was down one tick ago.
1748
+ * @realm shared
1749
+ * @source https://wiki.facepunch.com/gmod/Player:KeyDownLast
1750
+ */
1751
+ KeyDownLast(self: Player, key: number): boolean;
1752
+ }
1753
+
1754
+ interface Player {
1755
+ /**
1756
+ * Gets whether a key was just pressed this tick.
1757
+ * @realm shared
1758
+ * @source https://wiki.facepunch.com/gmod/Player:KeyPressed
1759
+ */
1760
+ KeyPressed(self: Player, key: number): boolean;
1761
+ }
1762
+
1763
+ interface Player {
1764
+ /**
1765
+ * Gets whether a key was just released this tick.
1766
+ * @realm shared
1767
+ * @source https://wiki.facepunch.com/gmod/Player:KeyReleased
1768
+ */
1769
+ KeyReleased(self: Player, key: number): boolean;
1770
+ }
1771
+
1772
+ interface Player {
1773
+ /**
1774
+ * Kicks the player from the server.
1775
+ * **NOTE**: This can not be run before the player has fully joined in. Use [game.KickID](https://wiki.facepunch.com/gmod/game.KickID) for that.
1776
+ *
1777
+ *
1778
+ * @realm server
1779
+ * @source https://wiki.facepunch.com/gmod/Player:Kick
1780
+ */
1781
+ Kick(self: Player, reason?: string): void;
1782
+ }
1783
+
1784
+ interface Player {
1785
+ /**
1786
+ * Kills a player and calls [GM:PlayerDeath](https://wiki.facepunch.com/gmod/GM:PlayerDeath).
1787
+ * @realm server
1788
+ * @source https://wiki.facepunch.com/gmod/Player:Kill
1789
+ */
1790
+ Kill(self: Player): void;
1791
+ }
1792
+
1793
+ interface Player {
1794
+ /**
1795
+ * Kills a player without notifying the rest of the server.
1796
+ *
1797
+ * This will call [GM:PlayerSilentDeath](https://wiki.facepunch.com/gmod/GM:PlayerSilentDeath) instead of [GM:PlayerDeath](https://wiki.facepunch.com/gmod/GM:PlayerDeath).
1798
+ *
1799
+ * @realm server
1800
+ * @source https://wiki.facepunch.com/gmod/Player:KillSilent
1801
+ */
1802
+ KillSilent(self: Player): void;
1803
+ }
1804
+
1805
+ interface Player {
1806
+ /**
1807
+ * This allows the server to mitigate the lag of the player by moving back all the entities that can be lag compensated to the time the player attacked with his weapon.
1808
+ *
1809
+ * This technique is most commonly used on things that hit other entities instantaneously, such as traces.
1810
+ *
1811
+ * **NOTE**: [Entity:FireBullets](https://wiki.facepunch.com/gmod/Entity:FireBullets) calls this function internally.
1812
+ *
1813
+ *
1814
+ * Lag compensation only works for players and entities that have been enabled with [Entity:SetLagCompensated](https://wiki.facepunch.com/gmod/Entity:SetLagCompensated)
1815
+ *
1816
+ * Despite being defined shared, it can only be used server-side in a [Predicted Hook](https://wiki.facepunch.com/gmod/~search?q=%3Cpredicted%3EYes).
1817
+ *
1818
+ * **WARNING**: This function NEEDS to be disabled after you're done with it or it will break the movement of the entities affected!
1819
+ *
1820
+ *
1821
+ * Lag compensation does not support pose parameters.
1822
+ *
1823
+ * @realm shared
1824
+ * @source https://wiki.facepunch.com/gmod/Player:LagCompensation
1825
+ */
1826
+ LagCompensation(self: Player, lagCompensation: boolean): void;
1827
+ }
1828
+
1829
+ interface Player {
1830
+ /**
1831
+ * Returns the hitgroup where the player was last hit.
1832
+ * @realm server
1833
+ * @source https://wiki.facepunch.com/gmod/Player:LastHitGroup
1834
+ */
1835
+ LastHitGroup(self: Player): number;
1836
+ }
1837
+
1838
+ interface Player {
1839
+ /**
1840
+ * Shows "limit hit" notification in sandbox.
1841
+ * **NOTE**: This function is only available in Sandbox and its derivatives.
1842
+ *
1843
+ *
1844
+ * @realm server
1845
+ * @source https://wiki.facepunch.com/gmod/Player:LimitHit
1846
+ */
1847
+ LimitHit(self: Player, type: string): void;
1848
+ }
1849
+
1850
+ interface Player {
1851
+ /**
1852
+ * Returns the direction a player is looking as a entity/local-oriented angle.
1853
+ *
1854
+ * Unlike [Entity:EyeAngles](https://wiki.facepunch.com/gmod/Entity:EyeAngles), this function does not include angles of the Player's [Entity:GetParent](https://wiki.facepunch.com/gmod/Entity:GetParent).
1855
+ *
1856
+ * Does not work correctly clientside for non local players when in a vehicle. (validate: when parented in general?)
1857
+ *
1858
+ * @realm shared
1859
+ * @source https://wiki.facepunch.com/gmod/Player:LocalEyeAngles
1860
+ */
1861
+ LocalEyeAngles(self: Player): Angle;
1862
+ }
1863
+
1864
+ interface Player {
1865
+ /**
1866
+ * Stops a player from using any inputs, such as moving, turning, or attacking. Key binds are still called. Similar to [Player:Freeze](https://wiki.facepunch.com/gmod/Player:Freeze) but the player takes no damage.
1867
+ *
1868
+ * Adds the [FL_FROZEN](https://wiki.facepunch.com/gmod/Enums/FL) and [FL_GODMODE](https://wiki.facepunch.com/gmod/Enums/FL) flags to the player.
1869
+ *
1870
+ *
1871
+ * @realm server
1872
+ * @source https://wiki.facepunch.com/gmod/Player:Lock
1873
+ */
1874
+ Lock(self: Player): void;
1875
+ }
1876
+
1877
+ interface Player {
1878
+ /**
1879
+ * Returns the position of a Kinect bone.
1880
+ * @realm shared
1881
+ * @source https://wiki.facepunch.com/gmod/Player:MotionSensorPos
1882
+ */
1883
+ MotionSensorPos(self: Player, bone: number): Vector;
1884
+ }
1885
+
1886
+ interface Player {
1887
+ /**
1888
+ * Returns the player's nick name. Identical to [Player:Nick](https://wiki.facepunch.com/gmod/Player:Nick) and [Player:GetName](https://wiki.facepunch.com/gmod/Player:GetName).
1889
+ * @realm shared
1890
+ * @source https://wiki.facepunch.com/gmod/Player:Name
1891
+ * @deprecated Use Player:Nick.
1892
+ */
1893
+ Name(self: Player): string;
1894
+ }
1895
+
1896
+ interface Player {
1897
+ /**
1898
+ * Returns the player's nick name also known as display name, as it appears in Steam.
1899
+ * @realm shared
1900
+ * @source https://wiki.facepunch.com/gmod/Player:Nick
1901
+ */
1902
+ Nick(self: Player): string;
1903
+ }
1904
+
1905
+ interface Player {
1906
+ /**
1907
+ * Returns the 64-bit SteamID aka CommunityID of the Steam Account that owns the Garry's Mod license this player is using. This is useful for detecting players using Steam Family Sharing.
1908
+ *
1909
+ * If player is not using Steam Family Sharing, this will return the player's actual SteamID64().
1910
+ *
1911
+ * **NOTE**: This data will only be available after the player has fully authenticated with Steam. See [Player:IsFullyAuthenticated](https://wiki.facepunch.com/gmod/Player:IsFullyAuthenticated).
1912
+ *
1913
+ *
1914
+ * @realm server
1915
+ * @source https://wiki.facepunch.com/gmod/Player:OwnerSteamID64
1916
+ */
1917
+ OwnerSteamID64(self: Player): string;
1918
+ }
1919
+
1920
+ interface Player {
1921
+ /**
1922
+ * Returns the percentage of packets lost by the client. It is not networked so it only returns 0 when run clientside.
1923
+ * @realm shared
1924
+ * @source https://wiki.facepunch.com/gmod/Player:PacketLoss
1925
+ */
1926
+ PacketLoss(self: Player): number;
1927
+ }
1928
+
1929
+ interface Player {
1930
+ /**
1931
+ * Unfreezes the props player is looking at. This is essentially the same as pressing reload with the physics gun, including double press for unfreeze all.
1932
+ *
1933
+ * For freezing props, use [PhysObj:EnableMotion](https://wiki.facepunch.com/gmod/PhysObj:EnableMotion).
1934
+ * @realm shared
1935
+ * @source https://wiki.facepunch.com/gmod/Player:PhysgunUnfreeze
1936
+ */
1937
+ PhysgunUnfreeze(self: Player): number;
1938
+ }
1939
+
1940
+ interface Player {
1941
+ /**
1942
+ * This makes the player hold (same as pressing E on a small prop) given entity.
1943
+ *
1944
+ * Not to be confused with picking up items like ammo or health kits.
1945
+ *
1946
+ * This picks up the passed entity regardless of its mass or distance from the player.
1947
+ *
1948
+ * @realm server
1949
+ * @source https://wiki.facepunch.com/gmod/Player:PickupObject
1950
+ */
1951
+ PickupObject(self: Player, entity: Entity): void;
1952
+ }
1953
+
1954
+ interface Player {
1955
+ /**
1956
+ * Forces the player to pickup an existing weapon entity. The player will not pick up the weapon if they already own a weapon of given type, or if the player could not normally have this weapon in their inventory.
1957
+ *
1958
+ * This function **will** bypass [GM:PlayerCanPickupWeapon](https://wiki.facepunch.com/gmod/GM:PlayerCanPickupWeapon).
1959
+ *
1960
+ * @realm server
1961
+ * @source https://wiki.facepunch.com/gmod/Player:PickupWeapon
1962
+ */
1963
+ PickupWeapon(self: Player, wep: Weapon, ammoOnly?: boolean): boolean;
1964
+ }
1965
+
1966
+ interface Player {
1967
+ /**
1968
+ * Returns the player's ping to server.
1969
+ * @realm shared
1970
+ * @source https://wiki.facepunch.com/gmod/Player:Ping
1971
+ */
1972
+ Ping(self: Player): number;
1973
+ }
1974
+
1975
+ interface Player {
1976
+ /**
1977
+ * Plays the correct step sound according to what the player is staying on.
1978
+ * @realm server
1979
+ * @source https://wiki.facepunch.com/gmod/Player:PlayStepSound
1980
+ */
1981
+ PlayStepSound(self: Player, volume?: number): void;
1982
+ }
1983
+
1984
+ interface Player {
1985
+ /**
1986
+ * Displays a message either in their chat, console, or center of the screen. See also [Global.PrintMessage](https://wiki.facepunch.com/gmod/Global.PrintMessage).
1987
+ *
1988
+ * **NOTE**: When called serverside, this uses the archaic user message system (the [umsg](https://wiki.facepunch.com/gmod/umsg)) and hence is limited to ≈250 characters.
1989
+ *
1990
+ * `HUD_PRINTCENTER` will not work when this is called clientside.
1991
+ *
1992
+ *
1993
+ * @realm shared
1994
+ * @source https://wiki.facepunch.com/gmod/Player:PrintMessage
1995
+ */
1996
+ PrintMessage(self: Player, type: number, message: string): void;
1997
+ }
1998
+
1999
+ interface Player {
2000
+ /**
2001
+ * Removes all ammo from a certain player
2002
+ * @realm server
2003
+ * @source https://wiki.facepunch.com/gmod/Player:RemoveAllAmmo
2004
+ */
2005
+ RemoveAllAmmo(self: Player): void;
2006
+ }
2007
+
2008
+ interface Player {
2009
+ /**
2010
+ * Removes all weapons and ammo from the player.
2011
+ * @realm server
2012
+ * @source https://wiki.facepunch.com/gmod/Player:RemoveAllItems
2013
+ */
2014
+ RemoveAllItems(self: Player): void;
2015
+ }
2016
+
2017
+ interface Player {
2018
+ /**
2019
+ * Removes the amount of the specified ammo from the player.
2020
+ * @realm shared
2021
+ * @source https://wiki.facepunch.com/gmod/Player:RemoveAmmo
2022
+ */
2023
+ RemoveAmmo(self: Player, ammoCount: number, ammoName: string | number): void;
2024
+ }
2025
+
2026
+ interface Player {
2027
+ /**
2028
+ * Removes a **P**ersistent **Data** key-value pair from the SQL database. (`sv.db` when called on server, `cl.db` when called on client)
2029
+ *
2030
+ * Internally uses the [sql](https://wiki.facepunch.com/gmod/sql) library. See [util.RemovePData](https://wiki.facepunch.com/gmod/util.RemovePData) for cases when the player is not currently on the server.
2031
+ *
2032
+ * **NOTE**: This function internally uses [Player:SteamID64](https://wiki.facepunch.com/gmod/Player:SteamID64), it previously utilized [Player:UniqueID](https://wiki.facepunch.com/gmod/Player:UniqueID) which can cause collisions (two or more players sharing the same PData entry). [Player:SetPData](https://wiki.facepunch.com/gmod/Player:SetPData) now replaces all instances of [Player:UniqueID](https://wiki.facepunch.com/gmod/Player:UniqueID) with [Player:SteamID64](https://wiki.facepunch.com/gmod/Player:SteamID64) when running [Player:SetPData](https://wiki.facepunch.com/gmod/Player:SetPData)
2033
+ *
2034
+ * **NOTE**: PData is not networked from servers to clients!
2035
+ *
2036
+ *
2037
+ * @realm shared
2038
+ * @source https://wiki.facepunch.com/gmod/Player:RemovePData
2039
+ */
2040
+ RemovePData(self: Player, key: string): boolean;
2041
+ }
2042
+
2043
+ interface Player {
2044
+ /**
2045
+ * Strips the player's suit item.
2046
+ * @realm server
2047
+ * @source https://wiki.facepunch.com/gmod/Player:RemoveSuit
2048
+ */
2049
+ RemoveSuit(self: Player): void;
2050
+ }
2051
+
2052
+ interface Player {
2053
+ /**
2054
+ * Resets both normal and duck hulls to their default values.
2055
+ * @realm shared
2056
+ * @source https://wiki.facepunch.com/gmod/Player:ResetHull
2057
+ */
2058
+ ResetHull(self: Player): void;
2059
+ }
2060
+
2061
+ interface Player {
2062
+ /**
2063
+ * Forces the player to say whatever the first argument is. Works on bots too.
2064
+ *
2065
+ * **NOTE**: This function ignores the default chat message cooldown
2066
+ *
2067
+ * **WARNING**: The argument can only contain 126 characters. [Source SDK 2013](https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/sp/src/game/server/client.cpp#L84-L86)
2068
+ *
2069
+ *
2070
+ * @realm server
2071
+ * @source https://wiki.facepunch.com/gmod/Player:Say
2072
+ */
2073
+ Say(self: Player, text: string, teamOnly?: boolean): void;
2074
+ }
2075
+
2076
+ interface Player {
2077
+ /**
2078
+ * Fades the screen
2079
+ * @realm shared
2080
+ * @source https://wiki.facepunch.com/gmod/Player:ScreenFade
2081
+ */
2082
+ ScreenFade(self: Player, flags: number, color?: Color, fadeTime?: number, fadeHold?: number): void;
2083
+ }
2084
+
2085
+ interface Player {
2086
+ /**
2087
+ * Sets the active weapon of the player by its class name.
2088
+ *
2089
+ * **WARNING**: This will switch the weapon out of prediction, causing delay on the client and [WEAPON:Deploy](https://wiki.facepunch.com/gmod/WEAPON:Deploy) and [WEAPON:Holster](https://wiki.facepunch.com/gmod/WEAPON:Holster) to be called out of prediction. Try using [CUserCmd:SelectWeapon](https://wiki.facepunch.com/gmod/CUserCmd:SelectWeapon) or [input.SelectWeapon](https://wiki.facepunch.com/gmod/input.SelectWeapon), instead.
2090
+ *
2091
+ *
2092
+ * **NOTE**: This will trigger the weapon switch event and associated animations. To switch weapons silently, use [Player:SetActiveWeapon](https://wiki.facepunch.com/gmod/Player:SetActiveWeapon).
2093
+ *
2094
+ *
2095
+ * @realm server
2096
+ * @source https://wiki.facepunch.com/gmod/Player:SelectWeapon
2097
+ */
2098
+ SelectWeapon(self: Player, className: string): void;
2099
+ }
2100
+
2101
+ interface Player {
2102
+ /**
2103
+ * Sends a hint to a player.
2104
+ *
2105
+ * **NOTE**: This function is only available in Sandbox and its derivatives. Since this adds `#Hint_` to the beginning of each message, you should only use it with default hint messages, or those cached with [language.Add](https://wiki.facepunch.com/gmod/language.Add). For hints with custom text, look at [notification.AddLegacy](https://wiki.facepunch.com/gmod/notification.AddLegacy).
2106
+ *
2107
+ *
2108
+ * @realm server
2109
+ * @source https://wiki.facepunch.com/gmod/Player:SendHint
2110
+ */
2111
+ SendHint(self: Player, name: string, delay: number): void;
2112
+ }
2113
+
2114
+ interface Player {
2115
+ /**
2116
+ * Executes a simple Lua string on the player.
2117
+ * **NOTE**: If you need to use this function more than once consider using [net](https://wiki.facepunch.com/gmod/net) library. Send net message and make the entire code you want to execute in [net.Receive](https://wiki.facepunch.com/gmod/net.Receive) on client.
2118
+ *
2119
+ *
2120
+ * @realm server
2121
+ * @source https://wiki.facepunch.com/gmod/Player:SendLua
2122
+ */
2123
+ SendLua(self: Player, script: string): void;
2124
+ }
2125
+
2126
+ interface Player {
2127
+ /**
2128
+ * Sets the player's active weapon. You should use [CUserCmd:SelectWeapon](https://wiki.facepunch.com/gmod/CUserCmd:SelectWeapon) or [Player:SelectWeapon](https://wiki.facepunch.com/gmod/Player:SelectWeapon), instead in most cases.
2129
+ *
2130
+ * This function will not trigger the weapon switch events or associated equip animations. It will bypass
2131
+ * [GM:PlayerSwitchWeapon](https://wiki.facepunch.com/gmod/GM:PlayerSwitchWeapon) and the currently active weapon's [WEAPON:Holster](https://wiki.facepunch.com/gmod/WEAPON:Holster) return value.
2132
+ *
2133
+ * @realm server
2134
+ * @source https://wiki.facepunch.com/gmod/Player:SetActiveWeapon
2135
+ */
2136
+ SetActiveWeapon(self: Player, weapon: Weapon): void;
2137
+ }
2138
+
2139
+ interface Player {
2140
+ /**
2141
+ * Sets the player's activity.
2142
+ * @realm server
2143
+ * @source https://wiki.facepunch.com/gmod/Player:SetActivity
2144
+ */
2145
+ SetActivity(self: Player, act: number): void;
2146
+ }
2147
+
2148
+ interface Player {
2149
+ /**
2150
+ * Set if the players' model is allowed to rotate around the pitch and roll axis.
2151
+ * @realm shared
2152
+ * @source https://wiki.facepunch.com/gmod/Player:SetAllowFullRotation
2153
+ */
2154
+ SetAllowFullRotation(self: Player, Allowed: boolean): void;
2155
+ }
2156
+
2157
+ interface Player {
2158
+ /**
2159
+ * Allows player to use their weapons in a vehicle. You need to call this before entering a vehicle.
2160
+ *
2161
+ * Shooting in a vehicle fires two bullets.
2162
+ *
2163
+ * @realm server
2164
+ * @source https://wiki.facepunch.com/gmod/Player:SetAllowWeaponsInVehicle
2165
+ */
2166
+ SetAllowWeaponsInVehicle(self: Player, allow: boolean): void;
2167
+ }
2168
+
2169
+ interface Player {
2170
+ /**
2171
+ * Sets the amount of the specified ammo for the player.
2172
+ * @realm shared
2173
+ * @source https://wiki.facepunch.com/gmod/Player:SetAmmo
2174
+ */
2175
+ SetAmmo(self: Player, ammoCount: number, ammoType: any): void;
2176
+ }
2177
+
2178
+ interface Player {
2179
+ /**
2180
+ * Sets the player armor value.
2181
+ *
2182
+ * See [GM:HandlePlayerArmorReduction](https://wiki.facepunch.com/gmod/GM:HandlePlayerArmorReduction) for a hook that allows manipulating what armor does.
2183
+ *
2184
+ * @realm server
2185
+ * @source https://wiki.facepunch.com/gmod/Player:SetArmor
2186
+ */
2187
+ SetArmor(self: Player, amount: number): void;
2188
+ }
2189
+
2190
+ interface Player {
2191
+ /**
2192
+ * Pushes the player away from other players whenever the player inside another players' bounding box.
2193
+ *
2194
+ * This avoidance is performed clientside by altering movement sent to server.
2195
+ *
2196
+ * This applies to players within a single team. ([Player:Team](https://wiki.facepunch.com/gmod/Player:Team))
2197
+ * @realm shared
2198
+ * @source https://wiki.facepunch.com/gmod/Player:SetAvoidPlayers
2199
+ */
2200
+ SetAvoidPlayers(self: Player, avoidPlayers: boolean): void;
2201
+ }
2202
+
2203
+ interface Player {
2204
+ /**
2205
+ * Set if the player should be allowed to walk using the (default) alt key. (`+walk` keybind)
2206
+ * @realm shared
2207
+ * @source https://wiki.facepunch.com/gmod/Player:SetCanWalk
2208
+ */
2209
+ SetCanWalk(self: Player, canWalk: boolean): void;
2210
+ }
2211
+
2212
+ interface Player {
2213
+ /**
2214
+ * Sets whether the player can use the HL2 suit zoom (`+zoom` bind) or not.
2215
+ * @realm shared
2216
+ * @source https://wiki.facepunch.com/gmod/Player:SetCanZoom
2217
+ */
2218
+ SetCanZoom(self: Player, canZoom: boolean): void;
2219
+ }
2220
+
2221
+ interface Player {
2222
+ /**
2223
+ * **INTERNAL**: Use [player_manager.SetPlayerClass](https://wiki.facepunch.com/gmod/player_manager.SetPlayerClass) instead.
2224
+ *
2225
+ *
2226
+ * Sets the player's class id.
2227
+ * @realm shared
2228
+ * @source https://wiki.facepunch.com/gmod/Player:SetClassID
2229
+ */
2230
+ SetClassID(self: Player, classID: number): void;
2231
+ }
2232
+
2233
+ interface Player {
2234
+ /**
2235
+ * Sets the crouched walk speed multiplier.
2236
+ *
2237
+ * Has no effect for values above 1.
2238
+ *
2239
+ * See also [Player:SetWalkSpeed](https://wiki.facepunch.com/gmod/Player:SetWalkSpeed) and [Player:GetCrouchedWalkSpeed](https://wiki.facepunch.com/gmod/Player:GetCrouchedWalkSpeed).
2240
+ *
2241
+ * @realm shared
2242
+ * @source https://wiki.facepunch.com/gmod/Player:SetCrouchedWalkSpeed
2243
+ */
2244
+ SetCrouchedWalkSpeed(self: Player, speed: number): void;
2245
+ }
2246
+
2247
+ interface Player {
2248
+ /**
2249
+ * Sets the **actual** view offset which equals the difference between the players actual position and their view when standing.
2250
+ *
2251
+ * Do not confuse with [Player:SetViewOffset](https://wiki.facepunch.com/gmod/Player:SetViewOffset) and [Player:SetViewOffsetDucked](https://wiki.facepunch.com/gmod/Player:SetViewOffsetDucked)
2252
+ *
2253
+ * @realm shared
2254
+ * @source https://wiki.facepunch.com/gmod/Player:SetCurrentViewOffset
2255
+ */
2256
+ SetCurrentViewOffset(self: Player, viewOffset: Vector): void;
2257
+ }
2258
+
2259
+ interface Player {
2260
+ /**
2261
+ * Activates a given DSP (Digital Signal Processor) effect on all sounds that
2262
+ * the player hears. Equivalent to setting the `dsp_player` convar on the player.
2263
+ * @realm shared
2264
+ * @source https://wiki.facepunch.com/gmod/Player:SetDSP
2265
+ */
2266
+ SetDSP(self: Player, dspEffectId: number, fastReset?: boolean): void;
2267
+ }
2268
+
2269
+
2270
+ interface Player {
2271
+ /**
2272
+ * Sets a player's death count
2273
+ * @realm server
2274
+ * @source https://wiki.facepunch.com/gmod/Player:SetDeaths
2275
+ */
2276
+ SetDeaths(self: Player, deathCount: number): void;
2277
+ }
2278
+
2279
+ interface Player {
2280
+ /**
2281
+ * **INTERNAL**: This is used internally - although you're able to use it you probably shouldn't.
2282
+ *
2283
+ * Sets the driving entity and driving mode.
2284
+ *
2285
+ * Use [drive.PlayerStartDriving](https://wiki.facepunch.com/gmod/drive.PlayerStartDriving) instead, see [Entity Driving](https://wiki.facepunch.com/gmod/Entity_Driving).
2286
+ *
2287
+ * @realm shared
2288
+ * @source https://wiki.facepunch.com/gmod/Player:SetDrivingEntity
2289
+ */
2290
+ SetDrivingEntity(self: Player, drivingEntity?: Entity, drivingMode?: number): void;
2291
+ }
2292
+
2293
+ interface Player {
2294
+ /**
2295
+ * Sets how quickly a player ducks.
2296
+ *
2297
+ * This will not work for values >= 1.
2298
+ *
2299
+ * @realm shared
2300
+ * @source https://wiki.facepunch.com/gmod/Player:SetDuckSpeed
2301
+ */
2302
+ SetDuckSpeed(self: Player, duckSpeed: number): void;
2303
+ }
2304
+
2305
+ interface Player {
2306
+ /**
2307
+ * Sets the local angle of the player's view (may rotate body too if angular difference is large)
2308
+ *
2309
+ * **NOTE**: This function works differently when the player is in a vehicle. In that case passing `Angle(0, 90, 0)` will have the player look forward (out the windshield) and `Angle(0, 0, 0)` will have them look to the right.
2310
+ *
2311
+ *
2312
+ * @realm shared
2313
+ * @source https://wiki.facepunch.com/gmod/Player:SetEyeAngles
2314
+ */
2315
+ SetEyeAngles(self: Player, angle: Angle): void;
2316
+ }
2317
+
2318
+ interface Player {
2319
+ /**
2320
+ * Set a player's FOV (Field Of View) over a certain amount of time.
2321
+ *
2322
+ * This is meant to be called on the server or shared (for prediction), it will have no effect if called clientside only. You may want to use [GM:CalcView](https://wiki.facepunch.com/gmod/GM:CalcView) for that instead.
2323
+ * @realm shared
2324
+ * @source https://wiki.facepunch.com/gmod/Player:SetFOV
2325
+ */
2326
+ SetFOV(self: Player, fov: number, time?: number, requester?: Entity): void;
2327
+ }
2328
+
2329
+ interface Player {
2330
+ /**
2331
+ * Sets the color of a player's flashlight.
2332
+ * Can be used on other players.
2333
+ *
2334
+ * @realm client
2335
+ * @source https://wiki.facepunch.com/gmod/Player:SetFlashlightColor
2336
+ */
2337
+ SetFlashlightColor(self: Player, color?: Color): void;
2338
+ }
2339
+
2340
+ interface Player {
2341
+ /**
2342
+ * Sets a player's frags (kills)
2343
+ * @realm server
2344
+ * @source https://wiki.facepunch.com/gmod/Player:SetFrags
2345
+ */
2346
+ SetFrags(self: Player, fragCount: number): void;
2347
+ }
2348
+
2349
+ interface Player {
2350
+ /**
2351
+ * Sets the hands entity of a player.
2352
+ *
2353
+ * The hands entity is an entity introduced in Garry's Mod 13 and it's used to show the player's hands attached to the viewmodel.
2354
+ * This is similar to the approach used in L4D and CS:GO, for more information on how to implement this system in your gamemode visit [Using Viewmodel Hands](https://wiki.facepunch.com/gmod/Using_Viewmodel_Hands).
2355
+ *
2356
+ * @realm shared
2357
+ * @source https://wiki.facepunch.com/gmod/Player:SetHands
2358
+ */
2359
+ SetHands(self: Player, hands: Entity): void;
2360
+ }
2361
+
2362
+ interface Player {
2363
+ /**
2364
+ * Sets the widget that is currently hovered by the player's mouse.
2365
+ * @realm shared
2366
+ * @source https://wiki.facepunch.com/gmod/Player:SetHoveredWidget
2367
+ */
2368
+ SetHoveredWidget(self: Player, widget?: Entity): void;
2369
+ }
2370
+
2371
+ interface Player {
2372
+ /**
2373
+ * Sets the size of the [Player's](https://wiki.facepunch.com/gmod/Player) [Axis-Aligned Bounding Box (AABB)](https://en.wikipedia.org/wiki/Minimum_bounding_box) used for physics and movement [Hull Traces](https://wiki.facepunch.com/gmod/util.TraceHull).
2374
+ *
2375
+ * See also: [Player:GetHull](https://wiki.facepunch.com/gmod/Player:GetHull), [Player:SetHullDuck](https://wiki.facepunch.com/gmod/Player:SetHullDuck), [Player:GetHullDuck](https://wiki.facepunch.com/gmod/Player:GetHullDuck)
2376
+ *
2377
+ * **NOTE**: This value is **not** replicated automatically to clients and must be manually called in both the Server and Client [Realms](https://wiki.facepunch.com/gmod/States).
2378
+ *
2379
+ *
2380
+ * @realm shared
2381
+ * @source https://wiki.facepunch.com/gmod/Player:SetHull
2382
+ */
2383
+ SetHull(self: Player, mins: Vector, maxs: Vector): void;
2384
+ }
2385
+
2386
+ interface Player {
2387
+ /**
2388
+ * Sets the size of the [Player's](https://wiki.facepunch.com/gmod/Player) [Axis-Aligned Bounding Box (AABB)](https://en.wikipedia.org/wiki/Minimum_bounding_box) used for physics and movement [Hull Traces](https://wiki.facepunch.com/gmod/util.TraceHull) while they are crouching (or "Ducking").
2389
+ *
2390
+ * See also: [Player:GetHullDuck](https://wiki.facepunch.com/gmod/Player:GetHullDuck), [Player:GetHull](https://wiki.facepunch.com/gmod/Player:GetHull), [Player:SetHull](https://wiki.facepunch.com/gmod/Player:SetHull)
2391
+ *
2392
+ * **NOTE**: This value is **not** replicated automatically to clients and must be manually called in both the Server and Client [Realms](https://wiki.facepunch.com/gmod/States).
2393
+ *
2394
+ *
2395
+ * @realm shared
2396
+ * @source https://wiki.facepunch.com/gmod/Player:SetHullDuck
2397
+ */
2398
+ SetHullDuck(self: Player, mins: Vector, maxs: Vector): void;
2399
+ }
2400
+
2401
+ interface Player {
2402
+ /**
2403
+ * Sets the jump power, eg. the velocity that will be applied to the player when they jump.
2404
+ * @realm shared
2405
+ * @source https://wiki.facepunch.com/gmod/Player:SetJumpPower
2406
+ */
2407
+ SetJumpPower(self: Player, jumpPower: number): void;
2408
+ }
2409
+
2410
+ interface Player {
2411
+ /**
2412
+ * Sets the player's ladder climbing speed.
2413
+ *
2414
+ * See [Player:SetWalkSpeed](https://wiki.facepunch.com/gmod/Player:SetWalkSpeed) for normal walking speed, [Player:SetRunSpeed](https://wiki.facepunch.com/gmod/Player:SetRunSpeed) for sprinting speed and [Player:SetSlowWalkSpeed](https://wiki.facepunch.com/gmod/Player:SetSlowWalkSpeed) for slow walking speed.
2415
+ *
2416
+ * @realm shared
2417
+ * @source https://wiki.facepunch.com/gmod/Player:SetLadderClimbSpeed
2418
+ */
2419
+ SetLadderClimbSpeed(self: Player, speed: number): void;
2420
+ }
2421
+
2422
+ interface Player {
2423
+ /**
2424
+ * Slows down the player movement simulation by the timescale, this is used internally in the HL2 weapon stripping sequence.
2425
+ *
2426
+ * It achieves such behavior by multiplying the [Global.FrameTime](https://wiki.facepunch.com/gmod/Global.FrameTime) by the specified timescale at the start of the movement simulation and then restoring it afterwards.
2427
+ *
2428
+ * **NOTE**: This is reset to 1 on spawn.
2429
+ *
2430
+ * There is no weapon counterpart to this, you'll have to hardcode the multiplier in the weapon or call [Weapon:SetNextPrimaryFire](https://wiki.facepunch.com/gmod/Weapon:SetNextPrimaryFire) / [Weapon:SetNextSecondaryFire](https://wiki.facepunch.com/gmod/Weapon:SetNextSecondaryFire) manually.
2431
+ *
2432
+ *
2433
+ * @realm server
2434
+ * @source https://wiki.facepunch.com/gmod/Player:SetLaggedMovementValue
2435
+ */
2436
+ SetLaggedMovementValue(self: Player, timescale: number): void;
2437
+ }
2438
+
2439
+ interface Player {
2440
+ /**
2441
+ * Sets the hitgroup where the player was last hit.
2442
+ * @realm server
2443
+ * @source https://wiki.facepunch.com/gmod/Player:SetLastHitGroup
2444
+ */
2445
+ SetLastHitGroup(self: Player, hitgroup: number): void;
2446
+ }
2447
+
2448
+ interface Player {
2449
+ /**
2450
+ * Sets the maximum amount of armor the player should have. This affects default built-in armor pickups, but not [Player:SetArmor](https://wiki.facepunch.com/gmod/Player:SetArmor).
2451
+ *
2452
+ * @realm server
2453
+ * @source https://wiki.facepunch.com/gmod/Player:SetMaxArmor
2454
+ */
2455
+ SetMaxArmor(self: Player, maxarmor: number): void;
2456
+ }
2457
+
2458
+ interface Player {
2459
+ /**
2460
+ * Sets the maximum speed which the player can move at.
2461
+ *
2462
+ * **NOTE**: This is called automatically by the engine. If you wish to limit player speed without setting their run/sprint speeds, see [CMoveData:SetMaxClientSpeed](https://wiki.facepunch.com/gmod/CMoveData:SetMaxClientSpeed).
2463
+ *
2464
+ *
2465
+ * @realm shared
2466
+ * @source https://wiki.facepunch.com/gmod/Player:SetMaxSpeed
2467
+ */
2468
+ SetMaxSpeed(self: Player, walkSpeed: number): void;
2469
+ }
2470
+
2471
+ interface Player {
2472
+ /**
2473
+ * Sets if the player should be voicechat muted locally.
2474
+ * @realm client
2475
+ * @source https://wiki.facepunch.com/gmod/Player:SetMuted
2476
+ */
2477
+ SetMuted(self: Player, mute: boolean): void;
2478
+ }
2479
+
2480
+ interface Player {
2481
+ /**
2482
+ * Sets whenever the player should not collide with their teammates, based on their [Player:Team](https://wiki.facepunch.com/gmod/Player:Team).
2483
+ *
2484
+ * **NOTE**: This will only work for teams with ID 1 to 4 due to internal Engine limitations.
2485
+ *
2486
+ * **NOTE**: This causes traces with [COLLISION_GROUP_PLAYER](https://wiki.facepunch.com/gmod/Enums/COLLISION_GROUP) to pass through players.
2487
+ *
2488
+ *
2489
+ * @realm shared
2490
+ * @source https://wiki.facepunch.com/gmod/Player:SetNoCollideWithTeammates
2491
+ */
2492
+ SetNoCollideWithTeammates(self: Player, shouldNotCollide: boolean): void;
2493
+ }
2494
+
2495
+ interface Player {
2496
+ /**
2497
+ * Sets the players visibility towards NPCs.
2498
+ *
2499
+ * Internally this toggles the [FL_NOTARGET](https://wiki.facepunch.com/gmod/Enums/FL) flag, which you can manually test for using [Entity:IsFlagSet](https://wiki.facepunch.com/gmod/Entity:IsFlagSet)
2500
+ *
2501
+ * @realm server
2502
+ * @source https://wiki.facepunch.com/gmod/Player:SetNoTarget
2503
+ */
2504
+ SetNoTarget(self: Player, visibility: boolean): void;
2505
+ }
2506
+
2507
+ interface Player {
2508
+ /**
2509
+ * Sets the players observer mode. You must start the spectating first with [Player:Spectate](https://wiki.facepunch.com/gmod/Player:Spectate).
2510
+ * @realm shared
2511
+ * @source https://wiki.facepunch.com/gmod/Player:SetObserverMode
2512
+ */
2513
+ SetObserverMode(self: Player, mode: number): void;
2514
+ }
2515
+
2516
+ interface Player {
2517
+ /**
2518
+ * Writes a **P**ersistent **Data** key-value pair to the SQL database. (`sv.db` when called on server, `cl.db` when called on client)
2519
+ *
2520
+ * Internally uses the [sql](https://wiki.facepunch.com/gmod/sql) library. See [util.SetPData](https://wiki.facepunch.com/gmod/util.SetPData) for cases when the player is not currently on the server.
2521
+ *
2522
+ * **NOTE**: This function internally uses [Player:SteamID64](https://wiki.facepunch.com/gmod/Player:SteamID64), it previously utilized [Player:UniqueID](https://wiki.facepunch.com/gmod/Player:UniqueID) which could have caused collisions (two or more players sharing the same PData entry). [Player:SetPData](https://wiki.facepunch.com/gmod/Player:SetPData) now replaces all instances of [Player:UniqueID](https://wiki.facepunch.com/gmod/Player:UniqueID) with [Player:SteamID64](https://wiki.facepunch.com/gmod/Player:SteamID64) when running [Player:SetPData](https://wiki.facepunch.com/gmod/Player:SetPData)
2523
+ *
2524
+ *
2525
+ * **NOTE**: PData is not networked from servers to clients!
2526
+ *
2527
+ *
2528
+ * @realm shared
2529
+ * @source https://wiki.facepunch.com/gmod/Player:SetPData
2530
+ */
2531
+ SetPData(self: Player, key: string, value: any): boolean;
2532
+ }
2533
+
2534
+ interface Player {
2535
+ /**
2536
+ * Sets the player model's color. The part of the model that is colored is determined by the model itself, and is different for each model.
2537
+ * @realm shared
2538
+ * @source https://wiki.facepunch.com/gmod/Player:SetPlayerColor
2539
+ */
2540
+ SetPlayerColor(self: Player, Color: Vector): void;
2541
+ }
2542
+
2543
+ interface Player {
2544
+ /**
2545
+ * Sets the widget that is currently in use by the player's mouse.
2546
+ *
2547
+ * Having a pressed widget stops the player from firing their weapon to allow input to be passed onto the widget.
2548
+ *
2549
+ * @realm shared
2550
+ * @source https://wiki.facepunch.com/gmod/Player:SetPressedWidget
2551
+ */
2552
+ SetPressedWidget(self: Player, pressedWidget?: Entity): void;
2553
+ }
2554
+
2555
+ interface Player {
2556
+ /**
2557
+ * Sets the player's sprint speed.
2558
+ *
2559
+ * See also [Player:GetRunSpeed](https://wiki.facepunch.com/gmod/Player:GetRunSpeed), [Player:SetWalkSpeed](https://wiki.facepunch.com/gmod/Player:SetWalkSpeed) and [Player:SetMaxSpeed](https://wiki.facepunch.com/gmod/Player:SetMaxSpeed).
2560
+ * **NOTE**: player_default class run speed is: `400`
2561
+ *
2562
+ *
2563
+ * @realm shared
2564
+ * @source https://wiki.facepunch.com/gmod/Player:SetRunSpeed
2565
+ */
2566
+ SetRunSpeed(self: Player, runSpeed: number): void;
2567
+ }
2568
+
2569
+ interface Player {
2570
+ /**
2571
+ * Sets the player's slow walking speed, which is activated via +WALK keybind.
2572
+ *
2573
+ * See [Player:SetWalkSpeed](https://wiki.facepunch.com/gmod/Player:SetWalkSpeed) for normal walking speed, [Player:SetRunSpeed](https://wiki.facepunch.com/gmod/Player:SetRunSpeed) for sprinting speed and [Player:SetLadderClimbSpeed](https://wiki.facepunch.com/gmod/Player:SetLadderClimbSpeed) for ladder climb speed.
2574
+ *
2575
+ * @realm shared
2576
+ * @source https://wiki.facepunch.com/gmod/Player:SetSlowWalkSpeed
2577
+ */
2578
+ SetSlowWalkSpeed(self: Player, speed: number): void;
2579
+ }
2580
+
2581
+ interface Player {
2582
+ /**
2583
+ * Sets the maximum height a player can step onto without jumping.
2584
+ * @realm shared
2585
+ * @source https://wiki.facepunch.com/gmod/Player:SetStepSize
2586
+ */
2587
+ SetStepSize(self: Player, stepHeight: number): void;
2588
+ }
2589
+
2590
+ interface Player {
2591
+ /**
2592
+ * Sets the player's HEV suit power.
2593
+ *
2594
+ * This will only work for the local player when used clientside.
2595
+ *
2596
+ * @realm shared
2597
+ * @source https://wiki.facepunch.com/gmod/Player:SetSuitPower
2598
+ */
2599
+ SetSuitPower(self: Player, power: number): void;
2600
+ }
2601
+
2602
+ interface Player {
2603
+ /**
2604
+ * Sets whenever to suppress the pickup notification for the player.
2605
+ * @realm shared
2606
+ * @source https://wiki.facepunch.com/gmod/Player:SetSuppressPickupNotices
2607
+ */
2608
+ SetSuppressPickupNotices(self: Player, doSuppress: boolean): void;
2609
+ }
2610
+
2611
+ interface Player {
2612
+ /**
2613
+ * Sets the player to the chosen team. The value is networked to clients at reduced bit count (16 bits) as as a signed value, so the real range is [-32768, 32767].
2614
+ *
2615
+ * Can be retrieved via [Player:Team](https://wiki.facepunch.com/gmod/Player:Team)
2616
+ *
2617
+ * @realm server
2618
+ * @source https://wiki.facepunch.com/gmod/Player:SetTeam
2619
+ */
2620
+ SetTeam(self: Player, team: number): void;
2621
+ }
2622
+
2623
+ interface Player {
2624
+ /**
2625
+ * Sets how quickly a player un-ducks
2626
+ * @realm shared
2627
+ * @source https://wiki.facepunch.com/gmod/Player:SetUnDuckSpeed
2628
+ */
2629
+ SetUnDuckSpeed(self: Player, UnDuckSpeed: number): void;
2630
+ }
2631
+
2632
+ interface Player {
2633
+ /**
2634
+ * Sets the usergroup of the player.
2635
+ * @realm server
2636
+ * @source https://wiki.facepunch.com/gmod/Player:SetUserGroup
2637
+ */
2638
+ SetUserGroup(self: Player, groupName: string): void;
2639
+ }
2640
+
2641
+ interface Player {
2642
+ /**
2643
+ * Attaches the players view to the position and angles of the specified entity.
2644
+ * @realm server
2645
+ * @source https://wiki.facepunch.com/gmod/Player:SetViewEntity
2646
+ */
2647
+ SetViewEntity(self: Player, viewEntity: Entity): void;
2648
+ }
2649
+
2650
+ interface Player {
2651
+ /**
2652
+ * Sets the **desired** view offset which equals the difference between the players actual position and their view when standing.
2653
+ *
2654
+ * If you want to set **actual** view offset, use [Player:SetCurrentViewOffset](https://wiki.facepunch.com/gmod/Player:SetCurrentViewOffset)
2655
+ *
2656
+ * See also [Player:SetViewOffsetDucked](https://wiki.facepunch.com/gmod/Player:SetViewOffsetDucked) for **desired** view offset when crouching.
2657
+ *
2658
+ * @realm shared
2659
+ * @source https://wiki.facepunch.com/gmod/Player:SetViewOffset
2660
+ */
2661
+ SetViewOffset(self: Player, viewOffset: Vector): void;
2662
+ }
2663
+
2664
+ interface Player {
2665
+ /**
2666
+ * Sets the **desired** view offset which equals the difference between the players actual position and their view when crouching.
2667
+ *
2668
+ * If you want to set **actual** view offset, use [Player:SetCurrentViewOffset](https://wiki.facepunch.com/gmod/Player:SetCurrentViewOffset)
2669
+ *
2670
+ * See also [Player:SetViewOffset](https://wiki.facepunch.com/gmod/Player:SetViewOffset) for **desired** view offset when standing.
2671
+ *
2672
+ * @realm shared
2673
+ * @source https://wiki.facepunch.com/gmod/Player:SetViewOffsetDucked
2674
+ */
2675
+ SetViewOffsetDucked(self: Player, viewOffset: Vector): void;
2676
+ }
2677
+
2678
+ interface Player {
2679
+ /**
2680
+ * Sets client's view punch angle, but not the velocity. See [Player:ViewPunch](https://wiki.facepunch.com/gmod/Player:ViewPunch)
2681
+ * @realm shared
2682
+ * @source https://wiki.facepunch.com/gmod/Player:SetViewPunchAngles
2683
+ */
2684
+ SetViewPunchAngles(self: Player, punchAngle: Angle): void;
2685
+ }
2686
+
2687
+ interface Player {
2688
+ /**
2689
+ * Sets client's view punch velocity. See [Player:ViewPunch](https://wiki.facepunch.com/gmod/Player:ViewPunch) and [Player:SetViewPunchAngles](https://wiki.facepunch.com/gmod/Player:SetViewPunchAngles)
2690
+ * @realm shared
2691
+ * @source https://wiki.facepunch.com/gmod/Player:SetViewPunchVelocity
2692
+ */
2693
+ SetViewPunchVelocity(self: Player, punchVel: Angle): void;
2694
+ }
2695
+
2696
+ interface Player {
2697
+ /**
2698
+ * Sets the voice volume scale for given player on client. This value will persist from server to server, but will be reset when the game is shut down.
2699
+ *
2700
+ * **NOTE**: This doesn't work on bots, their scale will always be `1`. Does not work with multiruns.
2701
+ *
2702
+ *
2703
+ * @realm client
2704
+ * @source https://wiki.facepunch.com/gmod/Player:SetVoiceVolumeScale
2705
+ */
2706
+ SetVoiceVolumeScale(self: Player, arg0: number): void;
2707
+ }
2708
+
2709
+ interface Player {
2710
+ /**
2711
+ * Sets the player's normal walking speed. Not sprinting, not slow walking +walk.
2712
+ *
2713
+ * See also [Player:SetSlowWalkSpeed](https://wiki.facepunch.com/gmod/Player:SetSlowWalkSpeed), [Player:GetWalkSpeed](https://wiki.facepunch.com/gmod/Player:GetWalkSpeed), [Player:SetCrouchedWalkSpeed](https://wiki.facepunch.com/gmod/Player:SetCrouchedWalkSpeed), [Player:SetMaxSpeed](https://wiki.facepunch.com/gmod/Player:SetMaxSpeed) and [Player:SetRunSpeed](https://wiki.facepunch.com/gmod/Player:SetRunSpeed).
2714
+ *
2715
+ * Using a speed of `0` can lead to prediction errors, and can cause players to move at sv_maxvelocity
2716
+ *
2717
+ * **NOTE**: `player_default` class walk speed is: `200`.
2718
+ *
2719
+ *
2720
+ * @realm shared
2721
+ * @source https://wiki.facepunch.com/gmod/Player:SetWalkSpeed
2722
+ */
2723
+ SetWalkSpeed(self: Player, walkSpeed: number): void;
2724
+ }
2725
+
2726
+ interface Player {
2727
+ /**
2728
+ * Sets the player weapon's color. The part of the model that is colored is determined by the model itself, and is different for each model.
2729
+ * @realm shared
2730
+ * @source https://wiki.facepunch.com/gmod/Player:SetWeaponColor
2731
+ */
2732
+ SetWeaponColor(self: Player, Color: Vector): void;
2733
+ }
2734
+
2735
+ interface Player {
2736
+ /**
2737
+ * Sets up the player's hands for the viewmodel. Calls [GM:PlayerSetHandsModel](https://wiki.facepunch.com/gmod/GM:PlayerSetHandsModel) to determine the model. If no entity is provided, uses the player's own hands model. If spectating another entity, pass that entity to use its hands model instead.
2738
+ * @realm server
2739
+ * @source https://wiki.facepunch.com/gmod/Player:SetupHands
2740
+ */
2741
+ SetupHands(self: Player, ent?: Entity): void;
2742
+ }
2743
+
2744
+ interface Player {
2745
+ /**
2746
+ * Returns whether the **local player's** player model will be drawn at the time the function is called.
2747
+ *
2748
+ * Despite this being a method on a player object, this will always represent the state of the [local player](https://wiki.facepunch.com/gmod/Global.LocalPlayer), not of the player entity this method is used on.
2749
+ *
2750
+ * @realm client
2751
+ * @source https://wiki.facepunch.com/gmod/Player:ShouldDrawLocalPlayer
2752
+ */
2753
+ ShouldDrawLocalPlayer(self: Player): boolean;
2754
+ }
2755
+
2756
+ interface Player {
2757
+ /**
2758
+ * Sets whether the player's current weapon should drop on death.
2759
+ *
2760
+ * **NOTE**: This is reset on spawn to the [player class](https://wiki.facepunch.com/gmod/Player_Classes)'s **DropWeaponOnDie** field by [player_manager.OnPlayerSpawn](https://wiki.facepunch.com/gmod/player_manager.OnPlayerSpawn).
2761
+ *
2762
+ *
2763
+ * @realm server
2764
+ * @source https://wiki.facepunch.com/gmod/Player:ShouldDropWeapon
2765
+ */
2766
+ ShouldDropWeapon(self: Player, drop: boolean): void;
2767
+ }
2768
+
2769
+ interface Player {
2770
+ /**
2771
+ * Opens the player steam profile page in the steam overlay browser.
2772
+ * @realm client
2773
+ * @source https://wiki.facepunch.com/gmod/Player:ShowProfile
2774
+ */
2775
+ ShowProfile(self: Player): void;
2776
+ }
2777
+
2778
+ interface Player {
2779
+ /**
2780
+ * Signals the entity that it was dropped by the gravity gun.
2781
+ * @realm server
2782
+ * @source https://wiki.facepunch.com/gmod/Player:SimulateGravGunDrop
2783
+ */
2784
+ SimulateGravGunDrop(self: Player, ent: Entity): void;
2785
+ }
2786
+
2787
+ interface Player {
2788
+ /**
2789
+ * Signals the entity that it was picked up by the gravity gun. This call is only required if you want to simulate the situation of picking up objects.
2790
+ * @realm server
2791
+ * @source https://wiki.facepunch.com/gmod/Player:SimulateGravGunPickup
2792
+ */
2793
+ SimulateGravGunPickup(self: Player, ent: Entity, lightning?: boolean): void;
2794
+ }
2795
+
2796
+ interface Player {
2797
+ /**
2798
+ * Starts spectate mode for given player. This will also affect the players movetype in some cases.
2799
+ *
2800
+ * [Player:UnSpectate](https://wiki.facepunch.com/gmod/Player:UnSpectate) should be used to remove the player from spectate mode, or call this with `OBS_MODE_NONE`.
2801
+ *
2802
+ * The player must be respawned, otherwise they will be able to walk through doors and become invincible. This will be fixed in a future update.
2803
+ *
2804
+ * @realm server
2805
+ * @source https://wiki.facepunch.com/gmod/Player:Spectate
2806
+ */
2807
+ Spectate(self: Player, mode: OBS_MODE): void;
2808
+ }
2809
+
2810
+ interface Player {
2811
+ /**
2812
+ * Makes the player spectate the entity.
2813
+ *
2814
+ * To get the applied spectated entity, use [Player:GetObserverTarget](https://wiki.facepunch.com/gmod/Player:GetObserverTarget).
2815
+ *
2816
+ * @realm server
2817
+ * @source https://wiki.facepunch.com/gmod/Player:SpectateEntity
2818
+ */
2819
+ SpectateEntity(self: Player, entity: Entity): void;
2820
+ }
2821
+
2822
+ interface Player {
2823
+ /**
2824
+ * Makes a player spray their decal.
2825
+ * @realm server
2826
+ * @source https://wiki.facepunch.com/gmod/Player:SprayDecal
2827
+ */
2828
+ SprayDecal(self: Player, sprayOrigin: Vector, sprayEndPos: Vector): void;
2829
+ }
2830
+
2831
+ interface Player {
2832
+ /**
2833
+ * Disables the sprint on the player.
2834
+ *
2835
+ * @realm server
2836
+ * @source https://wiki.facepunch.com/gmod/Player:SprintDisable
2837
+ */
2838
+ SprintDisable(self: Player): void;
2839
+ }
2840
+
2841
+ interface Player {
2842
+ /**
2843
+ * Enables the sprint on the player.
2844
+ *
2845
+ * @realm server
2846
+ * @source https://wiki.facepunch.com/gmod/Player:SprintEnable
2847
+ */
2848
+ SprintEnable(self: Player): void;
2849
+ }
2850
+
2851
+ interface Player {
2852
+ /**
2853
+ * Doesn't appear to do anything.
2854
+ *
2855
+ * @realm shared
2856
+ * @source https://wiki.facepunch.com/gmod/Player:StartSprinting
2857
+ * @deprecated This appears to be a direct binding to internal functionality that is overridden by the engine every frame so calling these functions may not have any or expected effect.
2858
+ */
2859
+ StartSprinting(self: Player): void;
2860
+ }
2861
+
2862
+ interface Player {
2863
+ /**
2864
+ * When used in a [GM:SetupMove](https://wiki.facepunch.com/gmod/GM:SetupMove) hook, this function will force the player to walk, as well as preventing the player from sprinting.
2865
+ *
2866
+ * @realm shared
2867
+ * @source https://wiki.facepunch.com/gmod/Player:StartWalking
2868
+ * @deprecated This appears to be a direct binding to internal functionality that is overridden by the engine every frame so calling these functions may not have any or expected effect.
2869
+ */
2870
+ StartWalking(self: Player): void;
2871
+ }
2872
+
2873
+ interface Player {
2874
+ /**
2875
+ * Returns the player's SteamID.
2876
+ *
2877
+ * See [Player:AccountID](https://wiki.facepunch.com/gmod/Player:AccountID) for a shorter version of the SteamID and [Player:SteamID64](https://wiki.facepunch.com/gmod/Player:SteamID64) for the full SteamID.
2878
+ *
2879
+ * It is recommended to use [Player:SteamID64](https://wiki.facepunch.com/gmod/Player:SteamID64) over the other SteamID formats whenever possible.
2880
+ *
2881
+ * **NOTE**: In a `-multirun` environment, this will return `STEAM_ID_LAN` for all "copies" of a player because they are not authenticated with Steam.
2882
+ *
2883
+ * For Bots this will return `BOT`.
2884
+ *
2885
+ *
2886
+ * @realm shared
2887
+ * @source https://wiki.facepunch.com/gmod/Player:SteamID
2888
+ */
2889
+ SteamID(self: Player): string;
2890
+ }
2891
+
2892
+ interface Player {
2893
+ /**
2894
+ * Returns the player's full **64-bit SteamID**, also known as **CommunityID**. Information on how data is packed into this value can be found [here](https://developer.valvesoftware.com/wiki/SteamID).
2895
+ *
2896
+ * See [Player:AccountID](https://wiki.facepunch.com/gmod/Player:AccountID) for a function that returns only the Account ID part of the SteamID and [Player:SteamID](https://wiki.facepunch.com/gmod/Player:SteamID) for the text version of the SteamID.
2897
+ *
2898
+ * **NOTE**: In a `-multirun` environment, this will return `"0"` for all "copies" of a player because they are not authenticated with Steam.
2899
+ *
2900
+ * For bots, this will return `90071996842377216` (equivalent to `STEAM_0:0:0`) for the first bot to join.
2901
+ *
2902
+ * For each additional bot, the number increases by 1. So the next bot will be `90071996842377217` (`STEAM_0:1:0`) then `90071996842377218` (`STEAM_0:0:1`) and so on.
2903
+ *
2904
+ *
2905
+ * @realm shared
2906
+ * @source https://wiki.facepunch.com/gmod/Player:SteamID64
2907
+ */
2908
+ SteamID64(self: Player): string;
2909
+ }
2910
+
2911
+ interface Player {
2912
+ /**
2913
+ * When used in a [GM:SetupMove](https://wiki.facepunch.com/gmod/GM:SetupMove) hook, this function will prevent the player from sprinting.
2914
+ *
2915
+ * When +walk is engaged, the player will still be able to sprint to half speed (normal run speed) as opposed to full sprint speed without this function.
2916
+ *
2917
+ * @realm shared
2918
+ * @source https://wiki.facepunch.com/gmod/Player:StopSprinting
2919
+ * @deprecated This appears to be a direct binding to internal functionality that is overridden by the engine every frame so calling these functions may not have any or expected effect.
2920
+ */
2921
+ StopSprinting(self: Player): void;
2922
+ }
2923
+
2924
+ interface Player {
2925
+ /**
2926
+ * When used in a [GM:SetupMove](https://wiki.facepunch.com/gmod/GM:SetupMove) hook, this function behaves unexpectedly by preventing the player from sprinting similar to [Player:StopSprinting](https://wiki.facepunch.com/gmod/Player:StopSprinting).
2927
+ *
2928
+ * @realm shared
2929
+ * @source https://wiki.facepunch.com/gmod/Player:StopWalking
2930
+ * @deprecated This appears to be a direct binding to internal functionality that is overridden by the engine every frame so calling these functions may not have any or expected effect.
2931
+ */
2932
+ StopWalking(self: Player): void;
2933
+ }
2934
+
2935
+ interface Player {
2936
+ /**
2937
+ * Turns off the zoom mode of the player. (+zoom console command)
2938
+ *
2939
+ * Basically equivalent of entering "-zoom" into player's console.
2940
+ *
2941
+ * @realm server
2942
+ * @source https://wiki.facepunch.com/gmod/Player:StopZooming
2943
+ */
2944
+ StopZooming(self: Player): void;
2945
+ }
2946
+
2947
+ interface Player {
2948
+ /**
2949
+ * Removes all ammo from the player.
2950
+ * @realm server
2951
+ * @source https://wiki.facepunch.com/gmod/Player:StripAmmo
2952
+ * @deprecated Alias of Player:RemoveAllAmmo
2953
+ */
2954
+ StripAmmo(self: Player): void;
2955
+ }
2956
+
2957
+ interface Player {
2958
+ /**
2959
+ * Removes the specified weapon class from a certain player
2960
+ * **NOTE**: this function will call the [Entity:OnRemove](https://wiki.facepunch.com/gmod/Entity:OnRemove) but if you try use [Entity:GetOwner](https://wiki.facepunch.com/gmod/Entity:GetOwner) it will return nil
2961
+ *
2962
+ * @realm server
2963
+ * @source https://wiki.facepunch.com/gmod/Player:StripWeapon
2964
+ */
2965
+ StripWeapon(self: Player, weapon: string): void;
2966
+ }
2967
+
2968
+ interface Player {
2969
+ /**
2970
+ * Removes all weapons from a certain player
2971
+ * @realm server
2972
+ * @source https://wiki.facepunch.com/gmod/Player:StripWeapons
2973
+ */
2974
+ StripWeapons(self: Player): void;
2975
+ }
2976
+
2977
+ interface Player {
2978
+ /**
2979
+ * Prevents a hint from showing up.
2980
+ *
2981
+ *
2982
+ * **NOTE**: This function is only available in Sandbox and its derivatives
2983
+ *
2984
+ *
2985
+ * @realm server
2986
+ * @source https://wiki.facepunch.com/gmod/Player:SuppressHint
2987
+ */
2988
+ SuppressHint(self: Player, name: string): void;
2989
+ }
2990
+
2991
+ interface Player {
2992
+ /**
2993
+ * Attempts to switch the player weapon to the one specified in the "cl_defaultweapon" convar, if the player does not own the specified weapon nothing will happen.
2994
+ *
2995
+ * If you want to switch to a specific weapon, use: [Player:SetActiveWeapon](https://wiki.facepunch.com/gmod/Player:SetActiveWeapon)
2996
+ *
2997
+ * @realm server
2998
+ * @source https://wiki.facepunch.com/gmod/Player:SwitchToDefaultWeapon
2999
+ */
3000
+ SwitchToDefaultWeapon(self: Player): void;
3001
+ }
3002
+
3003
+ interface Player {
3004
+ /**
3005
+ * Returns the player's team ID, set by [Player:SetTeam](https://wiki.facepunch.com/gmod/Player:SetTeam)
3006
+ *
3007
+ * Returns 0 clientside when the game is not fully loaded.
3008
+ *
3009
+ * @realm shared
3010
+ * @source https://wiki.facepunch.com/gmod/Player:Team
3011
+ */
3012
+ Team(self: Player): number;
3013
+ }
3014
+
3015
+ interface Player {
3016
+ /**
3017
+ * Returns the time in seconds since the player connected.
3018
+ *
3019
+ * Bots will always return value 0.
3020
+ * @realm server
3021
+ * @source https://wiki.facepunch.com/gmod/Player:TimeConnected
3022
+ */
3023
+ TimeConnected(self: Player): number;
3024
+ }
3025
+
3026
+ interface Player {
3027
+ /**
3028
+ * Performs a trace hull and applies damage to the entities hit, returns the first entity hit.
3029
+ *
3030
+ * **WARNING**: Hitting the victim entity with this function in [ENTITY:OnTakeDamage](https://wiki.facepunch.com/gmod/ENTITY:OnTakeDamage) can cause infinite loops.
3031
+ *
3032
+ *
3033
+ * @realm server
3034
+ * @source https://wiki.facepunch.com/gmod/Player:TraceHullAttack
3035
+ */
3036
+ TraceHullAttack(self: Player, startPos: Vector, endPos: Vector, mins: Vector, maxs: Vector, damage: number, damageFlags: number, damageForce: number, damageAllNPCs: boolean): Entity;
3037
+ }
3038
+
3039
+ interface Player {
3040
+ /**
3041
+ * Translates [Enums/ACT](https://wiki.facepunch.com/gmod/Enums/ACT) according to the holdtype of players currently held weapon.
3042
+ * @realm shared
3043
+ * @source https://wiki.facepunch.com/gmod/Player:TranslateWeaponActivity
3044
+ */
3045
+ TranslateWeaponActivity(self: Player, act: number): number;
3046
+ }
3047
+
3048
+ interface Player {
3049
+ /**
3050
+ * Unlocks the player movement if locked previously.
3051
+ *
3052
+ * Will disable godmode for the player if locked previously.
3053
+ *
3054
+ * @realm server
3055
+ * @source https://wiki.facepunch.com/gmod/Player:UnLock
3056
+ */
3057
+ UnLock(self: Player): void;
3058
+ }
3059
+
3060
+ interface Player {
3061
+ /**
3062
+ * Removes the player from the spectate mode entirely.
3063
+ *
3064
+ * The player must be respawned, otherwise they will be able to walk through doors and become invincible. This will be fixed in a future update.
3065
+ *
3066
+ * @realm server
3067
+ * @source https://wiki.facepunch.com/gmod/Player:UnSpectate
3068
+ */
3069
+ UnSpectate(self: Player): void;
3070
+ }
3071
+
3072
+ interface Player {
3073
+ /**
3074
+ * Unfreezes all objects the player has frozen with their Physics Gun. Same as double pressing R while holding Physics Gun.
3075
+ * @realm shared
3076
+ * @source https://wiki.facepunch.com/gmod/Player:UnfreezePhysicsObjects
3077
+ */
3078
+ UnfreezePhysicsObjects(self: Player): void;
3079
+ }
3080
+
3081
+ interface Player {
3082
+ /**
3083
+ * Returns a 32 bit integer that remains constant for a player across joins/leaves and across different servers. This can be used when a string is inappropriate - e.g. in a database primary key.
3084
+ *
3085
+ *
3086
+ *
3087
+ * **NOTE**: In Singleplayer, this function will always return 1.
3088
+ *
3089
+ * In a `-multirun` environment, the value returned is different on the serverside and clientside.
3090
+ *
3091
+ * @realm shared
3092
+ * @source https://wiki.facepunch.com/gmod/Player:UniqueID
3093
+ * @deprecated **This function has collisions,** where more than one player can have the same UniqueID. It is **highly** recommended to use Player:SteamID64, Player:SteamID or Player:AccountID instead, which are guaranteed to be unique to each player.
3094
+ */
3095
+ UniqueID(self: Player): number;
3096
+ }
3097
+
3098
+ interface Player {
3099
+ /**
3100
+ * Returns a table that will stay allocated for the specific player serverside between connects until the server shuts down or change map. On client it has no such special behavior.
3101
+ *
3102
+ * **NOTE**: This table is not synchronized (networked) between client and server.
3103
+ *
3104
+ *
3105
+ * @realm shared
3106
+ * @source https://wiki.facepunch.com/gmod/Player:UniqueIDTable
3107
+ */
3108
+ UniqueIDTable(self: Player, key: any): table;
3109
+ }
3110
+
3111
+ interface Player {
3112
+ /**
3113
+ * Returns the player's user ID. This number will always be unique, but will reset if the player reconnects. (Always increments for each connecting player)
3114
+ *
3115
+ * You can use [Global.Player](https://wiki.facepunch.com/gmod/Global.Player) global function to get a player by their user ID.
3116
+ *
3117
+ * @realm shared
3118
+ * @source https://wiki.facepunch.com/gmod/Player:UserID
3119
+ */
3120
+ UserID(self: Player): number;
3121
+ }
3122
+
3123
+ interface Player {
3124
+ /**
3125
+ * Simulates a push on the client's screen. This **adds** view punch velocity, and does not reset the current view punch angle, for which you can use [Player:SetViewPunchAngles](https://wiki.facepunch.com/gmod/Player:SetViewPunchAngles).
3126
+ *
3127
+ * **NOTE**: Despite being defined shared, it only functions when called server-side.
3128
+ *
3129
+ *
3130
+ * @realm shared
3131
+ * @source https://wiki.facepunch.com/gmod/Player:ViewPunch
3132
+ */
3133
+ ViewPunch(self: Player, punchAngle: Angle): void;
3134
+ }
3135
+
3136
+ interface Player {
3137
+ /**
3138
+ * Resets the player's view punch (and the view punch velocity, read more at [Player:ViewPunch](https://wiki.facepunch.com/gmod/Player:ViewPunch)) effect back to normal.
3139
+ * @realm shared
3140
+ * @source https://wiki.facepunch.com/gmod/Player:ViewPunchReset
3141
+ */
3142
+ ViewPunchReset(self: Player, tolerance?: number): void;
3143
+ }
3144
+
3145
+ interface Player {
3146
+ /**
3147
+ * Returns the players voice volume, how loud the player's voice communication currently is, as a number in range of [0,1].
3148
+ *
3149
+ * @realm client
3150
+ * @source https://wiki.facepunch.com/gmod/Player:VoiceVolume
3151
+ */
3152
+ VoiceVolume(self: Player): number;
3153
+ }
3154
+
3155
+ interface PlayerLib {
3156
+ /**
3157
+ * Similar to the serverside command "bot", this function creates a new Player bot with the given name. This bot will not obey to the usual `bot_*` commands, and it's the same bot base used in TF2 and CS:S.
3158
+ *
3159
+ * The best way to control the behaviour of a Player bot right now is to use the [GM:StartCommand](https://wiki.facepunch.com/gmod/GM:StartCommand) hook and modify its input serverside.
3160
+ *
3161
+ * **NOTE**: Despite this Player being fake, it has to be removed from the server by using [Player:Kick](https://wiki.facepunch.com/gmod/Player:Kick) and **NOT** [Entity:Remove](https://wiki.facepunch.com/gmod/Entity:Remove).
3162
+ * Also keep in mind that these bots still use player slots, so you won't be able to spawn them in singleplayer!
3163
+ *
3164
+ *
3165
+ * **NOTE**: Any Bot created using this method will be considered UnAuthed by Garry's Mod
3166
+ *
3167
+ *
3168
+ * @realm server
3169
+ * @source https://wiki.facepunch.com/gmod/player.CreateNextBot
3170
+ */
3171
+ CreateNextBot(botName: string): Player;
3172
+ }
3173
+
3174
+ interface PlayerLib {
3175
+ /**
3176
+ * Gets all the current players in the server (not including connecting clients).
3177
+ *
3178
+ * This function returns bots as well as human players. See [player.GetBots](https://wiki.facepunch.com/gmod/player.GetBots) and [player.GetHumans](https://wiki.facepunch.com/gmod/player.GetHumans).
3179
+ *
3180
+ * **NOTE**: This function returns a sequential table, meaning it should be looped with [Global.ipairs](https://wiki.facepunch.com/gmod/Global.ipairs) instead of [Global.pairs](https://wiki.facepunch.com/gmod/Global.pairs) for efficiency reasons.
3181
+ *
3182
+ *
3183
+ * @realm shared
3184
+ * @source https://wiki.facepunch.com/gmod/player.GetAll
3185
+ */
3186
+ GetAll(): Player[];
3187
+ }
3188
+
3189
+ interface PlayerLib {
3190
+ /**
3191
+ * Returns a table of all bots on the server.
3192
+ * @realm shared
3193
+ * @source https://wiki.facepunch.com/gmod/player.GetBots
3194
+ */
3195
+ GetBots(): Player[];
3196
+ }
3197
+
3198
+ interface PlayerLib {
3199
+ /**
3200
+ * Tried to get the player with the specified [Player:AccountID](https://wiki.facepunch.com/gmod/Player:AccountID).
3201
+ * **WARNING**: Internally this function iterates over all players in the server, meaning it can be quite expensive in a performance-critical context.
3202
+ *
3203
+ *
3204
+ * @realm shared
3205
+ * @source https://wiki.facepunch.com/gmod/player.GetByAccountID
3206
+ */
3207
+ GetByAccountID(accountID: number): Player | boolean;
3208
+ }
3209
+
3210
+ interface PlayerLib {
3211
+ /**
3212
+ * Gets the player with the specified connection ID.
3213
+ *
3214
+ * Connection ID can be retrieved via [gameevent.Listen](https://wiki.facepunch.com/gmod/gameevent.Listen) events.
3215
+ *
3216
+ * For a function that returns a player based on their [Entity:EntIndex](https://wiki.facepunch.com/gmod/Entity:EntIndex), see [Global.Entity](https://wiki.facepunch.com/gmod/Global.Entity).
3217
+ *
3218
+ *
3219
+ * For a function that returns a player based on their [Player:UserID](https://wiki.facepunch.com/gmod/Player:UserID), see [Global.Player](https://wiki.facepunch.com/gmod/Global.Player).
3220
+ *
3221
+ * @realm shared
3222
+ * @source https://wiki.facepunch.com/gmod/player.GetByID
3223
+ */
3224
+ GetByID(connectionID: number): Player | NULL;
3225
+ }
3226
+
3227
+ interface PlayerLib {
3228
+ /**
3229
+ * Gets the player with the specified SteamID.
3230
+ * **WARNING**: Internally this function iterates over all players in the server, meaning it can be quite expensive in a performance-critical context.
3231
+ *
3232
+ *
3233
+ * @realm shared
3234
+ * @source https://wiki.facepunch.com/gmod/player.GetBySteamID
3235
+ */
3236
+ GetBySteamID(steamID: string): Player | boolean;
3237
+ }
3238
+
3239
+ interface PlayerLib {
3240
+ /**
3241
+ * Gets the player with the specified SteamID64.
3242
+ * **WARNING**: Internally this function iterates over all players in the server, meaning it can be quite expensive in a performance-critical context.
3243
+ *
3244
+ *
3245
+ * @realm shared
3246
+ * @source https://wiki.facepunch.com/gmod/player.GetBySteamID64
3247
+ */
3248
+ GetBySteamID64(steamID64: string): Player | boolean;
3249
+ }
3250
+
3251
+ interface PlayerLib {
3252
+ /**
3253
+ * Gets the player with the specified uniqueID (not recommended way to identify players).
3254
+ *
3255
+ * **WARNING**: It is highly recommended to use [player.GetByAccountID](https://wiki.facepunch.com/gmod/player.GetByAccountID), [player.GetBySteamID](https://wiki.facepunch.com/gmod/player.GetBySteamID) or [player.GetBySteamID64](https://wiki.facepunch.com/gmod/player.GetBySteamID64) instead as this function can have collisions ( be same for different people ) while SteamID is guaranteed to unique to each player.
3256
+ *
3257
+ * **WARNING**: Internally this function iterates over all players in the server, meaning it can be quite expensive in a performance-critical context.
3258
+ *
3259
+ *
3260
+ * @realm shared
3261
+ * @source https://wiki.facepunch.com/gmod/player.GetByUniqueID
3262
+ * @deprecated Use player.GetBySteamID64, player.GetBySteamID or player.GetByAccountID to get a player by a unique identifier instead.
3263
+ */
3264
+ GetByUniqueID(uniqueID: string): Player | boolean;
3265
+ }
3266
+
3267
+ interface PlayerLib {
3268
+ /**
3269
+ * Returns the active player count.
3270
+ *
3271
+ * **NOTE**: Similar to **#**[player.GetAll](https://wiki.facepunch.com/gmod/player.GetAll)() but with better performance since the player table doesn't have to be generated. If [player.GetAll](https://wiki.facepunch.com/gmod/player.GetAll) is already being called for iteration, then using the **#** operator on the table will be faster than calling this function since it is JITted.
3272
+ *
3273
+ * **NOTE**: Players who are currently connecting to the server will not be counted. See function: [player.GetCountConnecting](https://wiki.facepunch.com/gmod/player.GetCountConnecting)
3274
+ *
3275
+ *
3276
+ * @realm shared
3277
+ * @source https://wiki.facepunch.com/gmod/player.GetCount
3278
+ */
3279
+ GetCount(): number;
3280
+ }
3281
+
3282
+ interface PlayerLib {
3283
+ /**
3284
+ * Returns the amount of players connecting to the server, but not yet spawned in.
3285
+ *
3286
+ * `player.GetCountConnecting() + player.GetCount()` would result in the total player count on this server.
3287
+ *
3288
+ *
3289
+ * @realm server
3290
+ * @source https://wiki.facepunch.com/gmod/player.GetCountConnecting
3291
+ */
3292
+ GetCountConnecting(): number;
3293
+ }
3294
+
3295
+ interface PlayerLib {
3296
+ /**
3297
+ * Returns a table containing all human players (non-bot/AI).
3298
+ *
3299
+ * Unlike [player.GetAll](https://wiki.facepunch.com/gmod/player.GetAll), this does not include bots.
3300
+ * **NOTE**: This function returns a sequential table, meaning it should be looped with [Global.ipairs](https://wiki.facepunch.com/gmod/Global.ipairs) instead of [Global.pairs](https://wiki.facepunch.com/gmod/Global.pairs) for efficiency reasons.
3301
+ *
3302
+ *
3303
+ * @realm shared
3304
+ * @source https://wiki.facepunch.com/gmod/player.GetHumans
3305
+ */
3306
+ GetHumans(): Player[];
3307
+ }
3308
+
3309
+ interface PlayerLib {
3310
+ /**
3311
+ * Returns a stateless iterator for all players on the server, intended for use
3312
+ * in generic for-loops. Uses cached Lua values, so it is more efficient than
3313
+ * player.GetAll.
3314
+ * @realm shared
3315
+ * @source https://wiki.facepunch.com/gmod/player.Iterator
3316
+ */
3317
+ Iterator(): (((tbl: any, prev?: number) => (number, Player)), Player[], number);
3318
+ }
3319
+
3320
+