@tlua/gmod 1.0.3 → 1.0.5
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.
- package/index.d.tlua +1 -0
- package/package.json +1 -1
- package/types/achievements.d.tlua +15 -45
- package/types/ai.d.tlua +5 -15
- package/types/angle.d.tlua +18 -54
- package/types/baseclass.d.tlua +2 -4
- package/types/bf_read.d.tlua +11 -32
- package/types/bit.d.tlua +11 -33
- package/types/cam.d.tlua +16 -48
- package/types/ceffectdata.d.tlua +32 -95
- package/types/chat.d.tlua +5 -15
- package/types/cleanup.d.tlua +7 -21
- package/types/cluaemitter.d.tlua +12 -35
- package/types/clualocomotion.d.tlua +40 -119
- package/types/cluaparticle.d.tlua +44 -131
- package/types/cmovedata.d.tlua +47 -140
- package/types/cnavarea.d.tlua +77 -230
- package/types/cnavladder.d.tlua +22 -65
- package/types/cnewparticleeffect.d.tlua +26 -77
- package/types/color.d.tlua +28 -84
- package/types/concommand.d.tlua +4 -12
- package/types/constraint.d.tlua +28 -84
- package/types/construct.d.tlua +1 -3
- package/types/contentheader.d.tlua +3 -6
- package/types/contenticon.d.tlua +9 -24
- package/types/contentsidebar.d.tlua +4 -9
- package/types/contextbase.d.tlua +4 -9
- package/types/controlpanel.d.tlua +18 -40
- package/types/controlpresets.d.tlua +13 -36
- package/types/convar.d.tlua +16 -47
- package/types/cookie.d.tlua +3 -9
- package/types/coroutine.d.tlua +7 -21
- package/types/crecipientfilter.d.tlua +16 -47
- package/types/csoundpatch.d.tlua +14 -41
- package/types/ctakedamageinfo.d.tlua +33 -98
- package/types/ctrlnumpad.d.tlua +6 -17
- package/types/cusercmd.d.tlua +27 -80
- package/types/cvars.d.tlua +6 -18
- package/types/dadjustablemodelpanel.d.tlua +7 -18
- package/types/dalphabar.d.tlua +3 -6
- package/types/dbinder.d.tlua +4 -9
- package/types/dbubblecontainer.d.tlua +2 -3
- package/types/dbutton.d.tlua +8 -21
- package/types/dcheckbox.d.tlua +5 -12
- package/types/dcheckboxlabel.d.tlua +9 -27
- package/types/dcollapsiblecategory.d.tlua +23 -66
- package/types/dcolorbutton.d.tlua +7 -18
- package/types/dcolorcombo.d.tlua +5 -12
- package/types/dcolorcube.d.tlua +13 -36
- package/types/dcolormixer.d.tlua +27 -78
- package/types/dcolorpalette.d.tlua +23 -66
- package/types/dcolumnsheet.d.tlua +5 -12
- package/types/dcombobox.d.tlua +17 -48
- package/types/ddragbase.d.tlua +13 -36
- package/types/ddrawer.d.tlua +8 -21
- package/types/debug.d.tlua +44 -76
- package/types/debugoverlay.d.tlua +11 -33
- package/types/dentityproperties.d.tlua +5 -12
- package/types/derma.d.tlua +10 -30
- package/types/dexpandbutton.d.tlua +3 -6
- package/types/dfilebrowser.d.tlua +20 -60
- package/types/dform.d.tlua +18 -51
- package/types/dframe.d.tlua +24 -72
- package/types/dgrid.d.tlua +11 -30
- package/types/dhorizontaldivider.d.tlua +20 -57
- package/types/dhorizontalscroller.d.tlua +11 -30
- package/types/dhscrollbar.d.tlua +11 -30
- package/types/dhtml.d.tlua +8 -21
- package/types/dhtmlcontrols.d.tlua +5 -15
- package/types/diconbrowser.d.tlua +11 -30
- package/types/diconlayout.d.tlua +18 -51
- package/types/dimage.d.tlua +20 -55
- package/types/dimagebutton.d.tlua +9 -27
- package/types/dlabel.d.tlua +33 -96
- package/types/dlabeleditable.d.tlua +5 -12
- package/types/dlabelurl.d.tlua +10 -27
- package/types/dlistbox.d.tlua +8 -21
- package/types/dlistboxitem.d.tlua +4 -9
- package/types/dlistview.d.tlua +34 -99
- package/types/dlistview_column.d.tlua +14 -39
- package/types/dlistview_line.d.tlua +13 -36
- package/types/dmenu.d.tlua +28 -75
- package/types/dmenubar.d.tlua +6 -11
- package/types/dmenuoption.d.tlua +13 -36
- package/types/dmenuoptioncvar.d.tlua +6 -15
- package/types/dmodelpanel.d.tlua +22 -63
- package/types/dmodelselect.d.tlua +2 -3
- package/types/dmodelselectmulti.d.tlua +2 -3
- package/types/dnotify.d.tlua +10 -27
- package/types/dnumberscratch.d.tlua +26 -75
- package/types/dnumberwang.d.tlua +16 -45
- package/types/dnumslider.d.tlua +17 -51
- package/types/dpanel.d.tlua +14 -39
- package/types/dpanellist.d.tlua +11 -33
- package/types/dpaneloverlay.d.tlua +7 -18
- package/types/dpanpanel.d.tlua +6 -15
- package/types/dprogress.d.tlua +3 -6
- package/types/dproperties.d.tlua +4 -9
- package/types/dproperty_combo.d.tlua +3 -6
- package/types/dproperty_generic.d.tlua +5 -12
- package/types/dpropertysheet.d.tlua +26 -56
- package/types/dragndrop.d.tlua +10 -30
- package/types/draw.d.tlua +11 -31
- package/types/drgbpicker.d.tlua +4 -9
- package/types/drive.d.tlua +18 -41
- package/types/dscrollpanel.d.tlua +10 -30
- package/types/dshape.d.tlua +7 -18
- package/types/dsizetocontents.d.tlua +5 -12
- package/types/dslider.d.tlua +28 -81
- package/types/dsprite.d.tlua +9 -24
- package/types/dtab.d.tlua +8 -21
- package/types/dtextentry.d.tlua +43 -126
- package/types/dtilelayout.d.tlua +21 -60
- package/types/dtooltip.d.tlua +6 -15
- package/types/dtree.d.tlua +16 -45
- package/types/dtree_node.d.tlua +68 -201
- package/types/duplicator.d.tlua +30 -88
- package/types/dverticaldivider.d.tlua +23 -66
- package/types/dvscrollbar.d.tlua +11 -30
- package/types/effect.d.tlua +4 -9
- package/types/effects.d.tlua +6 -18
- package/types/engine.d.tlua +21 -63
- package/types/entity.d.tlua +676 -1962
- package/types/ents.d.tlua +23 -61
- package/types/file.d.tlua +39 -117
- package/types/frame_blend.d.tlua +7 -21
- package/types/game.d.tlua +39 -117
- package/types/gameevent.d.tlua +4 -8
- package/types/gamemode.d.tlua +3 -7
- package/types/gm.d.tlua +267 -800
- package/types/gmsave.d.tlua +4 -12
- package/types/gui.d.tlua +21 -63
- package/types/gwen.d.tlua +3 -9
- package/types/halo.d.tlua +2 -6
- package/types/hook.d.tlua +8 -17
- package/types/hook_events.d.tlua +2412 -0
- package/types/http.d.tlua +1 -3
- package/types/iconeditor.d.tlua +11 -30
- package/types/igmodaudiochannel.d.tlua +41 -122
- package/types/imagecheckbox.d.tlua +4 -9
- package/types/imaterial.d.tlua +26 -77
- package/types/imesh.d.tlua +5 -14
- package/types/input.d.tlua +24 -68
- package/types/irestore.d.tlua +9 -26
- package/types/isave.d.tlua +9 -26
- package/types/itexture.d.tlua +10 -29
- package/types/ivideowriter.d.tlua +5 -14
- package/types/jit.d.tlua +21 -53
- package/types/killicon.d.tlua +7 -21
- package/types/language.d.tlua +1 -3
- package/types/list.d.tlua +8 -24
- package/types/markup.d.tlua +2 -6
- package/types/markupobject.d.tlua +5 -14
- package/types/math.d.tlua +277 -447
- package/types/matproxy.d.tlua +3 -9
- package/types/matselect.d.tlua +11 -30
- package/types/menubar.d.tlua +2 -6
- package/types/mesh.d.tlua +19 -57
- package/types/motionsensor.d.tlua +10 -30
- package/types/navmesh.d.tlua +26 -78
- package/types/net.d.tlua +52 -154
- package/types/nextbot.d.tlua +46 -116
- package/types/notification.d.tlua +2 -6
- package/types/npc.d.tlua +182 -543
- package/types/numpad.d.tlua +7 -21
- package/types/os.d.tlua +4 -10
- package/types/panel.d.tlua +333 -991
- package/types/pathfollower.d.tlua +31 -92
- package/types/permissions.d.tlua +6 -18
- package/types/physcollide.d.tlua +3 -8
- package/types/physenv.d.tlua +11 -33
- package/types/physobj.d.tlua +78 -233
- package/types/player.d.tlua +302 -880
- package/types/player_manager.d.tlua +13 -39
- package/types/presets.d.tlua +6 -18
- package/types/projectedtexture.d.tlua +48 -143
- package/types/properties.d.tlua +5 -15
- package/types/propselect.d.tlua +5 -12
- package/types/render.d.tlua +142 -426
- package/types/resource.d.tlua +2 -6
- package/types/sandbox.d.tlua +54 -159
- package/types/saverestore.d.tlua +12 -36
- package/types/schedule.d.tlua +6 -17
- package/types/scripted_ents.d.tlua +11 -29
- package/types/search.d.tlua +1 -3
- package/types/serverlist.d.tlua +7 -21
- package/types/sound.d.tlua +10 -30
- package/types/spawnicon.d.tlua +8 -21
- package/types/spawnmenu.d.tlua +24 -70
- package/types/spawnmenucontentpanel.d.tlua +5 -12
- package/types/sql.d.tlua +9 -27
- package/types/stack.d.tlua +5 -14
- package/types/steamworks.d.tlua +18 -54
- package/types/string.d.tlua +49 -141
- package/types/surface.d.tlua +34 -102
- package/types/surfaceinfo.d.tlua +5 -14
- package/types/system.d.tlua +10 -30
- package/types/table.d.tlua +47 -137
- package/types/task.d.tlua +9 -26
- package/types/team.d.tlua +19 -57
- package/types/timer.d.tlua +14 -42
- package/types/tool.d.tlua +46 -131
- package/types/ugcpublishwindow.d.tlua +9 -24
- package/types/umsg.d.tlua +12 -36
- package/types/undo.d.tlua +10 -30
- package/types/usermessage.d.tlua +2 -6
- package/types/utf8.d.tlua +7 -21
- package/types/util.d.tlua +94 -274
- package/types/vector.d.tlua +36 -108
- package/types/vehicle.d.tlua +52 -149
- package/types/vgui.d.tlua +18 -46
- package/types/vmatrix.d.tlua +35 -105
- package/types/weapon.d.tlua +85 -248
- package/types/weapons.d.tlua +6 -16
- package/types/widgets.d.tlua +1 -3
- package/types/workshopfilebase.d.tlua +5 -14
package/types/util.d.tlua
CHANGED
|
@@ -12,9 +12,6 @@ declare util: UtilLib;
|
|
|
12
12
|
*/
|
|
13
13
|
interface UtilLib {
|
|
14
14
|
worldpicker: UtilworldpickerLib;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
interface UtilLib {
|
|
18
15
|
/**
|
|
19
16
|
* Adds the specified string to a string table, which will cache it and network it to all clients automatically.
|
|
20
17
|
* Whenever you want to create a net message with [net.Start](https://wiki.facepunch.com/gmod/net.Start), you must add the name of that message as a networked string via this function.
|
|
@@ -35,9 +32,6 @@ interface UtilLib {
|
|
|
35
32
|
* @source https://wiki.facepunch.com/gmod/util.AddNetworkString
|
|
36
33
|
*/
|
|
37
34
|
AddNetworkString(str: string): number;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
interface UtilLib {
|
|
41
35
|
/**
|
|
42
36
|
* Function used to calculate aim vector from 2D screen position. It is used in SuperDOF calculate Distance.
|
|
43
37
|
*
|
|
@@ -47,18 +41,12 @@ interface UtilLib {
|
|
|
47
41
|
* @source https://wiki.facepunch.com/gmod/util.AimVector
|
|
48
42
|
*/
|
|
49
43
|
AimVector(ViewAngles: Angle, ViewFOV: number, x: number, y: number, scrWidth: number, scrHeight: number): Vector;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
interface UtilLib {
|
|
53
44
|
/**
|
|
54
45
|
* Decodes the specified string from base64.
|
|
55
46
|
* @realm shared and menu
|
|
56
47
|
* @source https://wiki.facepunch.com/gmod/util.Base64Decode
|
|
57
48
|
*/
|
|
58
49
|
Base64Decode(str: string): string;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
interface UtilLib {
|
|
62
50
|
/**
|
|
63
51
|
* Encodes the specified string to base64.
|
|
64
52
|
*
|
|
@@ -69,27 +57,18 @@ interface UtilLib {
|
|
|
69
57
|
* @source https://wiki.facepunch.com/gmod/util.Base64Encode
|
|
70
58
|
*/
|
|
71
59
|
Base64Encode(str: string, inline?: boolean): string;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
interface UtilLib {
|
|
75
60
|
/**
|
|
76
61
|
* Applies explosion damage to all entities in the specified radius. Performs block checking.
|
|
77
62
|
* @realm server
|
|
78
63
|
* @source https://wiki.facepunch.com/gmod/util.BlastDamage
|
|
79
64
|
*/
|
|
80
65
|
BlastDamage(inflictor: Entity, attacker: Entity, damageOrigin: Vector, damageRadius: number, damage: number): void;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
interface UtilLib {
|
|
84
66
|
/**
|
|
85
67
|
* Applies spherical damage based on damage info to all entities in the specified radius.
|
|
86
68
|
* @realm server
|
|
87
69
|
* @source https://wiki.facepunch.com/gmod/util.BlastDamageInfo
|
|
88
70
|
*/
|
|
89
71
|
BlastDamageInfo(dmg: CTakeDamageInfo, damageOrigin: Vector, damageRadius: number): void;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
interface UtilLib {
|
|
93
72
|
/**
|
|
94
73
|
* Generates the [CRC Checksum](https://en.wikipedia.org/wiki/Cyclic_redundancy_check) of the specified string.
|
|
95
74
|
*
|
|
@@ -100,9 +79,6 @@ interface UtilLib {
|
|
|
100
79
|
* @source https://wiki.facepunch.com/gmod/util.CRC
|
|
101
80
|
*/
|
|
102
81
|
CRC(stringToChecksum: string): string;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
interface UtilLib {
|
|
106
82
|
/**
|
|
107
83
|
* Compresses the given string using the [LZMA](https://en.wikipedia.org/wiki/LZMA) algorithm.
|
|
108
84
|
*
|
|
@@ -117,27 +93,18 @@ interface UtilLib {
|
|
|
117
93
|
* @source https://wiki.facepunch.com/gmod/util.Compress
|
|
118
94
|
*/
|
|
119
95
|
Compress(str: string): string;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
interface UtilLib {
|
|
123
96
|
/**
|
|
124
97
|
* Returns the current date formatted like '2012-10-31 18-00-00'
|
|
125
98
|
* @realm shared and menu
|
|
126
99
|
* @source https://wiki.facepunch.com/gmod/util.DateStamp
|
|
127
100
|
*/
|
|
128
101
|
DateStamp(): string;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
interface UtilLib {
|
|
132
102
|
/**
|
|
133
103
|
* Performs a trace and paints a decal to the surface hit.
|
|
134
104
|
* @realm shared
|
|
135
105
|
* @source https://wiki.facepunch.com/gmod/util.Decal
|
|
136
106
|
*/
|
|
137
107
|
Decal(name: string, start: Vector, _end: Vector, filter?: Entity | Entity[]): void;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
interface UtilLib {
|
|
141
108
|
/**
|
|
142
109
|
* Performs a trace and paints a decal to the surface hit.
|
|
143
110
|
*
|
|
@@ -148,9 +115,6 @@ interface UtilLib {
|
|
|
148
115
|
* @source https://wiki.facepunch.com/gmod/util.DecalEx
|
|
149
116
|
*/
|
|
150
117
|
DecalEx(material: IMaterial, ent: Entity, position: Vector, normal: Vector, color: Color, w: number, h: number): void;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
interface UtilLib {
|
|
154
118
|
/**
|
|
155
119
|
* Gets the full material path by the decal name. Used with [util.DecalEx](https://wiki.facepunch.com/gmod/util.DecalEx).
|
|
156
120
|
*
|
|
@@ -159,9 +123,6 @@ interface UtilLib {
|
|
|
159
123
|
* @source https://wiki.facepunch.com/gmod/util.DecalMaterial
|
|
160
124
|
*/
|
|
161
125
|
DecalMaterial(decalName: string): string;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
interface UtilLib {
|
|
165
126
|
/**
|
|
166
127
|
* Decompresses the given string using [LZMA](https://en.wikipedia.org/wiki/LZMA) algorithm. Used to decompress strings previously compressed with [util.Compress](https://wiki.facepunch.com/gmod/util.Compress).
|
|
167
128
|
*
|
|
@@ -178,18 +139,12 @@ interface UtilLib {
|
|
|
178
139
|
* @source https://wiki.facepunch.com/gmod/util.Decompress
|
|
179
140
|
*/
|
|
180
141
|
Decompress(compressedString: string, maxSize?: number): string | nil;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
interface UtilLib {
|
|
184
142
|
/**
|
|
185
143
|
* Gets the distance between a line and a point in 3d space.
|
|
186
144
|
* @realm shared
|
|
187
145
|
* @source https://wiki.facepunch.com/gmod/util.DistanceToLine
|
|
188
146
|
*/
|
|
189
147
|
DistanceToLine(lineStart: Vector, lineEnd: Vector, pointPos: Vector): (number, Vector, number);
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
interface UtilLib {
|
|
193
148
|
/**
|
|
194
149
|
* Creates an effect with the specified data.
|
|
195
150
|
*
|
|
@@ -204,9 +159,6 @@ interface UtilLib {
|
|
|
204
159
|
* @source https://wiki.facepunch.com/gmod/util.Effect
|
|
205
160
|
*/
|
|
206
161
|
Effect(effectName: string, effectData: CEffectData, allowOverride?: boolean, ignorePredictionOrRecipientFilter?: boolean | CRecipientFilter): void;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
interface UtilLib {
|
|
210
162
|
/**
|
|
211
163
|
* Filters given text using Steam's filtering system. The function will obey local client's Steam settings for chat filtering:
|
|
212
164
|
*
|
|
@@ -219,9 +171,6 @@ interface UtilLib {
|
|
|
219
171
|
* @source https://wiki.facepunch.com/gmod/util.FilterText
|
|
220
172
|
*/
|
|
221
173
|
FilterText(str: string, context?: number, player?: Player): string;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
interface UtilLib {
|
|
225
174
|
/**
|
|
226
175
|
* Converts the full path of the given file to a relative path.
|
|
227
176
|
* You can use [util.RelativePathToFull_Menu](https://wiki.facepunch.com/gmod/util.RelativePathToFull_Menu) to convert the relative path back to the full path.
|
|
@@ -230,9 +179,6 @@ interface UtilLib {
|
|
|
230
179
|
* @source https://wiki.facepunch.com/gmod/util.FullPathToRelative_Menu
|
|
231
180
|
*/
|
|
232
181
|
FullPathToRelative_Menu(fullPath: string, fsPath?: string): string;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
interface UtilLib {
|
|
236
182
|
/**
|
|
237
183
|
* Returns the ID of a custom model activity. This is useful for models that define custom ones.
|
|
238
184
|
*
|
|
@@ -242,9 +188,6 @@ interface UtilLib {
|
|
|
242
188
|
* @source https://wiki.facepunch.com/gmod/util.GetActivityIDByName
|
|
243
189
|
*/
|
|
244
190
|
GetActivityIDByName(arg0: string): number;
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
interface UtilLib {
|
|
248
191
|
/**
|
|
249
192
|
* Returns a name for given activity ID. This is useful for models that define custom activities.
|
|
250
193
|
*
|
|
@@ -254,9 +197,6 @@ interface UtilLib {
|
|
|
254
197
|
* @source https://wiki.facepunch.com/gmod/util.GetActivityNameByID
|
|
255
198
|
*/
|
|
256
199
|
GetActivityNameByID(id: number): string;
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
interface UtilLib {
|
|
260
200
|
/**
|
|
261
201
|
* Returns the ID of a custom model animation event. This is useful for models that define custom animation events.
|
|
262
202
|
*
|
|
@@ -266,9 +206,6 @@ interface UtilLib {
|
|
|
266
206
|
* @source https://wiki.facepunch.com/gmod/util.GetAnimEventIDByName
|
|
267
207
|
*/
|
|
268
208
|
GetAnimEventIDByName(arg0: string): number;
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
interface UtilLib {
|
|
272
209
|
/**
|
|
273
210
|
* Returns a name for given automatically generated numerical animation event ID. This is useful for models that define custom animation events.
|
|
274
211
|
*
|
|
@@ -278,9 +215,6 @@ interface UtilLib {
|
|
|
278
215
|
* @source https://wiki.facepunch.com/gmod/util.GetAnimEventNameByID
|
|
279
216
|
*/
|
|
280
217
|
GetAnimEventNameByID(id: number): string;
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
interface UtilLib {
|
|
284
218
|
/**
|
|
285
219
|
* Returns a table containing the info about the model. The model will be loaded and cached if it was not previously.
|
|
286
220
|
*
|
|
@@ -304,9 +238,6 @@ interface UtilLib {
|
|
|
304
238
|
* @source https://wiki.facepunch.com/gmod/util.GetModelInfo
|
|
305
239
|
*/
|
|
306
240
|
GetModelInfo(mdl: string): ModelInfo;
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
interface UtilLib {
|
|
310
241
|
/**
|
|
311
242
|
* Retrieves vertex, triangle, and bone data for the visual meshes of a given model.
|
|
312
243
|
*
|
|
@@ -317,9 +248,6 @@ interface UtilLib {
|
|
|
317
248
|
* @source https://wiki.facepunch.com/gmod/util.GetModelMeshes
|
|
318
249
|
*/
|
|
319
250
|
GetModelMeshes(model: string, lod?: number, bodygroupMask?: string | number, skin?: number): (ModelMeshData[], BoneBindPose[]);
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
interface UtilLib {
|
|
323
251
|
/**
|
|
324
252
|
* Gets persistent data of an offline player using their SteamID.
|
|
325
253
|
*
|
|
@@ -332,18 +260,12 @@ interface UtilLib {
|
|
|
332
260
|
* @source https://wiki.facepunch.com/gmod/util.GetPData
|
|
333
261
|
*/
|
|
334
262
|
GetPData(steamID: string, name: string, _default: any): string;
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
interface UtilLib {
|
|
338
263
|
/**
|
|
339
264
|
* Creates a new PixVis handle. See [util.PixelVisible](https://wiki.facepunch.com/gmod/util.PixelVisible).
|
|
340
265
|
* @realm client
|
|
341
266
|
* @source https://wiki.facepunch.com/gmod/util.GetPixelVisibleHandle
|
|
342
267
|
*/
|
|
343
268
|
GetPixelVisibleHandle(): pixelvis_handle_t;
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
interface UtilLib {
|
|
347
269
|
/**
|
|
348
270
|
* Utility function to quickly generate a trace table that starts at the players view position, and ends `32768` units along a specified direction.
|
|
349
271
|
*
|
|
@@ -352,27 +274,18 @@ interface UtilLib {
|
|
|
352
274
|
* @source https://wiki.facepunch.com/gmod/util.GetPlayerTrace
|
|
353
275
|
*/
|
|
354
276
|
GetPlayerTrace(ply: Player, dir?: Vector): Trace;
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
interface UtilLib {
|
|
358
277
|
/**
|
|
359
278
|
* Gets information about the sun position and obstruction or nil if there is no sun.
|
|
360
279
|
* @realm client
|
|
361
280
|
* @source https://wiki.facepunch.com/gmod/util.GetSunInfo
|
|
362
281
|
*/
|
|
363
282
|
GetSunInfo(): table;
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
interface UtilLib {
|
|
367
283
|
/**
|
|
368
284
|
* Returns data of a [surface property](https://developer.valvesoftware.com/wiki/Material_surface_properties) at given ID. New surface properties can be added via [physenv.AddSurfaceData](https://wiki.facepunch.com/gmod/physenv.AddSurfaceData).
|
|
369
285
|
* @realm shared
|
|
370
286
|
* @source https://wiki.facepunch.com/gmod/util.GetSurfaceData
|
|
371
287
|
*/
|
|
372
288
|
GetSurfaceData(id: number): SurfacePropertyData;
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
interface UtilLib {
|
|
376
289
|
/**
|
|
377
290
|
* Returns the matching surface property index for the given surface property name.
|
|
378
291
|
*
|
|
@@ -382,9 +295,6 @@ interface UtilLib {
|
|
|
382
295
|
* @source https://wiki.facepunch.com/gmod/util.GetSurfaceIndex
|
|
383
296
|
*/
|
|
384
297
|
GetSurfaceIndex(surfaceName: string): number;
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
interface UtilLib {
|
|
388
298
|
/**
|
|
389
299
|
* Returns the name of a surface property at given ID.
|
|
390
300
|
*
|
|
@@ -394,9 +304,6 @@ interface UtilLib {
|
|
|
394
304
|
* @source https://wiki.facepunch.com/gmod/util.GetSurfacePropName
|
|
395
305
|
*/
|
|
396
306
|
GetSurfacePropName(id: number): string;
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
interface UtilLib {
|
|
400
307
|
/**
|
|
401
308
|
* Returns a table of all SteamIDs that have a usergroup.
|
|
402
309
|
*
|
|
@@ -412,108 +319,72 @@ interface UtilLib {
|
|
|
412
319
|
* @source https://wiki.facepunch.com/gmod/util.GetUserGroups
|
|
413
320
|
*/
|
|
414
321
|
GetUserGroups(): table;
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
interface UtilLib {
|
|
418
322
|
/**
|
|
419
323
|
* Performs a Ray-OBB (Orientated Bounding Box) intersection and returns position, normal and the fraction if there was an intersection.
|
|
420
324
|
* @realm shared
|
|
421
325
|
* @source https://wiki.facepunch.com/gmod/util.IntersectRayWithOBB
|
|
422
326
|
*/
|
|
423
327
|
IntersectRayWithOBB(rayStart: Vector, rayDelta: Vector, boxOrigin: Vector, boxAngles: Angle, boxMins: Vector, boxMaxs: Vector): (Vector, Vector, number);
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
interface UtilLib {
|
|
427
328
|
/**
|
|
428
329
|
* Performs a [ray-plane intersection](https://en.wikipedia.org/wiki/Line%E2%80%93plane_intersection) and returns the hit position or nil.
|
|
429
330
|
* @realm shared
|
|
430
331
|
* @source https://wiki.facepunch.com/gmod/util.IntersectRayWithPlane
|
|
431
332
|
*/
|
|
432
333
|
IntersectRayWithPlane(rayOrigin: Vector, rayDirection: Vector, planePosition: Vector, planeNormal: Vector): Vector;
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
interface UtilLib {
|
|
436
334
|
/**
|
|
437
335
|
* Performs a ray-sphere intersection and returns the intersection positions or nil.
|
|
438
336
|
* @realm shared
|
|
439
337
|
* @source https://wiki.facepunch.com/gmod/util.IntersectRayWithSphere
|
|
440
338
|
*/
|
|
441
339
|
IntersectRayWithSphere(rayOrigin: Vector, rayDelta: Vector, spherePosition: Vector, sphereRadius: number): (number, number);
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
interface UtilLib {
|
|
445
340
|
/**
|
|
446
341
|
* Returns whether a binary module is installed and is resolvable by [Global.require](https://wiki.facepunch.com/gmod/Global.require).
|
|
447
342
|
* @realm shared and menu
|
|
448
343
|
* @source https://wiki.facepunch.com/gmod/util.IsBinaryModuleInstalled
|
|
449
344
|
*/
|
|
450
345
|
IsBinaryModuleInstalled(name: string): boolean;
|
|
451
|
-
}
|
|
452
|
-
|
|
453
|
-
interface UtilLib {
|
|
454
346
|
/**
|
|
455
347
|
* Performs a box-box intersection and returns whether there was an intersection or not.
|
|
456
348
|
* @realm shared
|
|
457
349
|
* @source https://wiki.facepunch.com/gmod/util.IsBoxIntersectingBox
|
|
458
350
|
*/
|
|
459
351
|
IsBoxIntersectingBox(boxMin: Vector, boxMax: Vector, box2Min: Vector, box2Max: Vector): boolean;
|
|
460
|
-
}
|
|
461
|
-
|
|
462
|
-
interface UtilLib {
|
|
463
352
|
/**
|
|
464
353
|
* Performs a box-sphere intersection and returns whether there was an intersection or not.
|
|
465
354
|
* @realm shared
|
|
466
355
|
* @source https://wiki.facepunch.com/gmod/util.IsBoxIntersectingSphere
|
|
467
356
|
*/
|
|
468
357
|
IsBoxIntersectingSphere(boxMin: Vector, boxMax: Vector, shpere2Position: Vector, sphere2Radius: number): boolean;
|
|
469
|
-
}
|
|
470
|
-
|
|
471
|
-
interface UtilLib {
|
|
472
358
|
/**
|
|
473
359
|
* Checks if a certain position is within the world bounds.
|
|
474
360
|
* @realm server
|
|
475
361
|
* @source https://wiki.facepunch.com/gmod/util.IsInWorld
|
|
476
362
|
*/
|
|
477
363
|
IsInWorld(position: Vector): boolean;
|
|
478
|
-
}
|
|
479
|
-
|
|
480
|
-
interface UtilLib {
|
|
481
364
|
/**
|
|
482
365
|
* Checks if the model is loaded in the game.
|
|
483
366
|
* @realm shared
|
|
484
367
|
* @source https://wiki.facepunch.com/gmod/util.IsModelLoaded
|
|
485
368
|
*/
|
|
486
369
|
IsModelLoaded(modelName: string): boolean;
|
|
487
|
-
}
|
|
488
|
-
|
|
489
|
-
interface UtilLib {
|
|
490
370
|
/**
|
|
491
371
|
* Performs OBB on OBB intersection test.
|
|
492
372
|
* @realm shared
|
|
493
373
|
* @source https://wiki.facepunch.com/gmod/util.IsOBBIntersectingOBB
|
|
494
374
|
*/
|
|
495
375
|
IsOBBIntersectingOBB(box1Origin: Vector, box1Angles: Angle, box1Mins: Vector, box1Maxs: Vector, box2Origin: Vector, box2Angles: Angle, box2Mins: Vector, box2Maxs: Vector, tolerance: number): boolean;
|
|
496
|
-
}
|
|
497
|
-
|
|
498
|
-
interface UtilLib {
|
|
499
376
|
/**
|
|
500
377
|
* Returns whether a point is within a cone or not.
|
|
501
378
|
* @realm shared
|
|
502
379
|
* @source https://wiki.facepunch.com/gmod/util.IsPointInCone
|
|
503
380
|
*/
|
|
504
381
|
IsPointInCone(point: Vector, coneOrigin: Vector, coneAxis: Vector, coneSine: number, coneLength: number): boolean;
|
|
505
|
-
}
|
|
506
|
-
|
|
507
|
-
interface UtilLib {
|
|
508
382
|
/**
|
|
509
383
|
* Performs a ray-ray intersection and returns whether there was an intersection or not.
|
|
510
384
|
* @realm shared
|
|
511
385
|
* @source https://wiki.facepunch.com/gmod/util.IsRayIntersectingRay
|
|
512
386
|
*/
|
|
513
387
|
IsRayIntersectingRay(ray1Start: Vector, ray1End: Vector, ray2Start: Vector, ray2End: Vector): (boolean, number, number);
|
|
514
|
-
}
|
|
515
|
-
|
|
516
|
-
interface UtilLib {
|
|
517
388
|
/**
|
|
518
389
|
* Check whether the skybox is visible from the point specified.
|
|
519
390
|
*
|
|
@@ -524,27 +395,18 @@ interface UtilLib {
|
|
|
524
395
|
* @source https://wiki.facepunch.com/gmod/util.IsSkyboxVisibleFromPoint
|
|
525
396
|
*/
|
|
526
397
|
IsSkyboxVisibleFromPoint(position: Vector): boolean;
|
|
527
|
-
}
|
|
528
|
-
|
|
529
|
-
interface UtilLib {
|
|
530
398
|
/**
|
|
531
399
|
* Returns whether a sphere is intersecting a cone or not.
|
|
532
400
|
* @realm shared
|
|
533
401
|
* @source https://wiki.facepunch.com/gmod/util.IsSphereIntersectingCone
|
|
534
402
|
*/
|
|
535
403
|
IsSphereIntersectingCone(sphereCenter: Vector, sphereRadius: number, coneOrigin: Vector, coneAxis: Vector, coneSine: number, coneCosine: number): boolean;
|
|
536
|
-
}
|
|
537
|
-
|
|
538
|
-
interface UtilLib {
|
|
539
404
|
/**
|
|
540
405
|
* Performs a sphere-sphere intersection and returns whether there was an intersection or not.
|
|
541
406
|
* @realm shared
|
|
542
407
|
* @source https://wiki.facepunch.com/gmod/util.IsSphereIntersectingSphere
|
|
543
408
|
*/
|
|
544
409
|
IsSphereIntersectingSphere(sphere1Position: Vector, sphere1Radius: number, sphere2Position: Vector, sphere2Radius: number): boolean;
|
|
545
|
-
}
|
|
546
|
-
|
|
547
|
-
interface UtilLib {
|
|
548
410
|
/**
|
|
549
411
|
* Checks if the specified model is valid.
|
|
550
412
|
*
|
|
@@ -574,36 +436,24 @@ interface UtilLib {
|
|
|
574
436
|
* @source https://wiki.facepunch.com/gmod/util.IsValidModel
|
|
575
437
|
*/
|
|
576
438
|
IsValidModel(modelName: string): boolean;
|
|
577
|
-
}
|
|
578
|
-
|
|
579
|
-
interface UtilLib {
|
|
580
439
|
/**
|
|
581
440
|
* Checks whether the given numbered physics object of the given entity is valid or not. Most useful for ragdolls.
|
|
582
441
|
* @realm shared
|
|
583
442
|
* @source https://wiki.facepunch.com/gmod/util.IsValidPhysicsObject
|
|
584
443
|
*/
|
|
585
444
|
IsValidPhysicsObject(ent: Entity, physobj: number): boolean;
|
|
586
|
-
}
|
|
587
|
-
|
|
588
|
-
interface UtilLib {
|
|
589
445
|
/**
|
|
590
446
|
* Checks if the specified prop is valid (has valid physics object).
|
|
591
447
|
* @realm shared
|
|
592
448
|
* @source https://wiki.facepunch.com/gmod/util.IsValidProp
|
|
593
449
|
*/
|
|
594
450
|
IsValidProp(modelName: string): boolean;
|
|
595
|
-
}
|
|
596
|
-
|
|
597
|
-
interface UtilLib {
|
|
598
451
|
/**
|
|
599
452
|
* Checks if the specified model name points to a valid ragdoll.
|
|
600
453
|
* @realm shared
|
|
601
454
|
* @source https://wiki.facepunch.com/gmod/util.IsValidRagdoll
|
|
602
455
|
*/
|
|
603
456
|
IsValidRagdoll(ragdollName: string): boolean;
|
|
604
|
-
}
|
|
605
|
-
|
|
606
|
-
interface UtilLib {
|
|
607
457
|
/**
|
|
608
458
|
* Converts a JSON string to a Lua table. It supports comments and trailing commas.
|
|
609
459
|
*
|
|
@@ -615,9 +465,6 @@ interface UtilLib {
|
|
|
615
465
|
* @source https://wiki.facepunch.com/gmod/util.JSONToTable
|
|
616
466
|
*/
|
|
617
467
|
JSONToTable(json: string, ignoreLimits?: boolean, ignoreConversions?: boolean): table | nil;
|
|
618
|
-
}
|
|
619
|
-
|
|
620
|
-
interface UtilLib {
|
|
621
468
|
/**
|
|
622
469
|
* Converts a Valve KeyValue string (typically from [util.TableToKeyValues](https://wiki.facepunch.com/gmod/util.TableToKeyValues)) to a Lua table.
|
|
623
470
|
*
|
|
@@ -628,18 +475,12 @@ interface UtilLib {
|
|
|
628
475
|
* @source https://wiki.facepunch.com/gmod/util.KeyValuesToTable
|
|
629
476
|
*/
|
|
630
477
|
KeyValuesToTable(keyValues: string, usesEscapeSequences?: boolean, preserveKeyCase?: boolean): table;
|
|
631
|
-
}
|
|
632
|
-
|
|
633
|
-
interface UtilLib {
|
|
634
478
|
/**
|
|
635
479
|
* Similar to [util.KeyValuesToTable](https://wiki.facepunch.com/gmod/util.KeyValuesToTable), but it also preserves order of keys (since Lua dictionary-style tables do not guarantee a specific order), and allows handling of repeated keys. (since each key can only appear once in a dictionary data structure)
|
|
636
480
|
* @realm shared and menu
|
|
637
481
|
* @source https://wiki.facepunch.com/gmod/util.KeyValuesToTablePreserveOrder
|
|
638
482
|
*/
|
|
639
483
|
KeyValuesToTablePreserveOrder(keyValues: string, usesEscapeSequences?: boolean, preserveKeyCase?: boolean): table;
|
|
640
|
-
}
|
|
641
|
-
|
|
642
|
-
interface UtilLib {
|
|
643
484
|
/**
|
|
644
485
|
* A convenience function around LocalToWorld-related functions.
|
|
645
486
|
*
|
|
@@ -650,9 +491,6 @@ interface UtilLib {
|
|
|
650
491
|
* @source https://wiki.facepunch.com/gmod/util.LocalToWorld
|
|
651
492
|
*/
|
|
652
493
|
LocalToWorld(ent: Entity, lpos: Vector, bone?: number): Vector;
|
|
653
|
-
}
|
|
654
|
-
|
|
655
|
-
interface UtilLib {
|
|
656
494
|
/**
|
|
657
495
|
* Generates the [MD5 hash](https://en.wikipedia.org/wiki/MD5) of the specified string.
|
|
658
496
|
* **WARNING**: MD5 is considered cryptographically broken and is known to be vulnerable to a variety of attacks including duplicate return values. If security or duplicate returns is a concern, use [util.SHA256](https://wiki.facepunch.com/gmod/util.SHA256).
|
|
@@ -662,36 +500,24 @@ interface UtilLib {
|
|
|
662
500
|
* @source https://wiki.facepunch.com/gmod/util.MD5
|
|
663
501
|
*/
|
|
664
502
|
MD5(stringToHash: string): string;
|
|
665
|
-
}
|
|
666
|
-
|
|
667
|
-
interface UtilLib {
|
|
668
503
|
/**
|
|
669
504
|
* Returns the networked string associated with the given ID from the string table.
|
|
670
505
|
* @realm shared
|
|
671
506
|
* @source https://wiki.facepunch.com/gmod/util.NetworkIDToString
|
|
672
507
|
*/
|
|
673
508
|
NetworkIDToString(stringTableID: number): string;
|
|
674
|
-
}
|
|
675
|
-
|
|
676
|
-
interface UtilLib {
|
|
677
509
|
/**
|
|
678
510
|
* Returns the networked ID associated with the given string from the string table.
|
|
679
511
|
* @realm shared
|
|
680
512
|
* @source https://wiki.facepunch.com/gmod/util.NetworkStringToID
|
|
681
513
|
*/
|
|
682
514
|
NetworkStringToID(networkString: string): number;
|
|
683
|
-
}
|
|
684
|
-
|
|
685
|
-
interface UtilLib {
|
|
686
515
|
/**
|
|
687
516
|
* Formats a float by stripping off extra `0's` and `.'s`.
|
|
688
517
|
* @realm shared and menu
|
|
689
518
|
* @source https://wiki.facepunch.com/gmod/util.NiceFloat
|
|
690
519
|
*/
|
|
691
520
|
NiceFloat(float: number): string;
|
|
692
|
-
}
|
|
693
|
-
|
|
694
|
-
interface UtilLib {
|
|
695
521
|
/**
|
|
696
522
|
* Creates an orange box (.pcf) tracer effect with the given parameters. See [util.ParticleTracerEx](https://wiki.facepunch.com/gmod/util.ParticleTracerEx) for version with additional arguments.
|
|
697
523
|
*
|
|
@@ -703,18 +529,12 @@ interface UtilLib {
|
|
|
703
529
|
* @source https://wiki.facepunch.com/gmod/util.ParticleTracer
|
|
704
530
|
*/
|
|
705
531
|
ParticleTracer(name: string, startPos: Vector, endPos: Vector, doWhiz: boolean): void;
|
|
706
|
-
}
|
|
707
|
-
|
|
708
|
-
interface UtilLib {
|
|
709
532
|
/**
|
|
710
533
|
* Creates a tracer effect with the given parameters. Expanded version of [util.ParticleTracer](https://wiki.facepunch.com/gmod/util.ParticleTracer).
|
|
711
534
|
* @realm shared
|
|
712
535
|
* @source https://wiki.facepunch.com/gmod/util.ParticleTracerEx
|
|
713
536
|
*/
|
|
714
537
|
ParticleTracerEx(name: string, startPos: Vector, endPos: Vector, doWhiz: boolean, entityIndex: number, attachmentIndex: number): void;
|
|
715
|
-
}
|
|
716
|
-
|
|
717
|
-
interface UtilLib {
|
|
718
538
|
/**
|
|
719
539
|
* Returns the visibility of a square that is always pointed at the camera in the world-space.
|
|
720
540
|
*
|
|
@@ -724,9 +544,6 @@ interface UtilLib {
|
|
|
724
544
|
* @source https://wiki.facepunch.com/gmod/util.PixelVisible
|
|
725
545
|
*/
|
|
726
546
|
PixelVisible(position: Vector, size: number, PixVis: pixelvis_handle_t): number;
|
|
727
|
-
}
|
|
728
|
-
|
|
729
|
-
interface UtilLib {
|
|
730
547
|
/**
|
|
731
548
|
* Returns the contents of the position specified.
|
|
732
549
|
* **NOTE**: This function will sample only the world environments. It can be used to check if [Entity:GetPos](https://wiki.facepunch.com/gmod/Entity:GetPos) is underwater for example unlike [Entity:WaterLevel](https://wiki.facepunch.com/gmod/Entity:WaterLevel) which works for players only.
|
|
@@ -736,9 +553,6 @@ interface UtilLib {
|
|
|
736
553
|
* @source https://wiki.facepunch.com/gmod/util.PointContents
|
|
737
554
|
*/
|
|
738
555
|
PointContents(position: Vector): CONTENTS;
|
|
739
|
-
}
|
|
740
|
-
|
|
741
|
-
interface UtilLib {
|
|
742
556
|
/**
|
|
743
557
|
* Precaches a model for later use. Model is cached after being loaded once.
|
|
744
558
|
* **WARNING**: Modelprecache is limited to 8192 unique models. When it reaches the limit the game will crash.
|
|
@@ -751,9 +565,6 @@ interface UtilLib {
|
|
|
751
565
|
* @source https://wiki.facepunch.com/gmod/util.PrecacheModel
|
|
752
566
|
*/
|
|
753
567
|
PrecacheModel(modelName: string): void;
|
|
754
|
-
}
|
|
755
|
-
|
|
756
|
-
interface UtilLib {
|
|
757
568
|
/**
|
|
758
569
|
* Precaches a sound for later use. Sound is cached after being loaded once.
|
|
759
570
|
* **NOTE**: Soundcache is limited to 16384 unique sounds on the server. Due to this fact this function is disabled on purpose, as exceeding the limit causes the server to shutdown.
|
|
@@ -765,9 +576,6 @@ interface UtilLib {
|
|
|
765
576
|
* @source https://wiki.facepunch.com/gmod/util.PrecacheSound
|
|
766
577
|
*/
|
|
767
578
|
PrecacheSound(soundName: string): void;
|
|
768
|
-
}
|
|
769
|
-
|
|
770
|
-
interface UtilLib {
|
|
771
579
|
/**
|
|
772
580
|
* Performs a trace with the given origin, direction, and filter.
|
|
773
581
|
* **NOTE**: This function will throw an error in the menu realm because it internally uses util.TraceLine which doesn't exist in the menu realm and thus error.
|
|
@@ -777,9 +585,6 @@ interface UtilLib {
|
|
|
777
585
|
* @source https://wiki.facepunch.com/gmod/util.QuickTrace
|
|
778
586
|
*/
|
|
779
587
|
QuickTrace(origin: Vector, dir: Vector, filter?: Entity | Entity[] | string[] | function): TraceResult;
|
|
780
|
-
}
|
|
781
|
-
|
|
782
|
-
interface UtilLib {
|
|
783
588
|
/**
|
|
784
589
|
* Converts the relative path of a given file to the full path on disk.
|
|
785
590
|
* You can use [util.FullPathToRelative_Menu](https://wiki.facepunch.com/gmod/util.FullPathToRelative_Menu) to convert the full path back to the relative path.
|
|
@@ -788,9 +593,6 @@ interface UtilLib {
|
|
|
788
593
|
* @source https://wiki.facepunch.com/gmod/util.RelativePathToFull_Menu
|
|
789
594
|
*/
|
|
790
595
|
RelativePathToFull_Menu(filePath: string, mountPath?: string): string;
|
|
791
|
-
}
|
|
792
|
-
|
|
793
|
-
interface UtilLib {
|
|
794
596
|
/**
|
|
795
597
|
* Returns which Workshop addon the given file belongs to.
|
|
796
598
|
*
|
|
@@ -798,9 +600,6 @@ interface UtilLib {
|
|
|
798
600
|
* @source https://wiki.facepunch.com/gmod/util.RelativePathToGMA_Menu
|
|
799
601
|
*/
|
|
800
602
|
RelativePathToGMA_Menu(filePath: string): table;
|
|
801
|
-
}
|
|
802
|
-
|
|
803
|
-
interface UtilLib {
|
|
804
603
|
/**
|
|
805
604
|
* Removes world decals at given position, in given radius. Does not remove decals on models!
|
|
806
605
|
*
|
|
@@ -808,9 +607,6 @@ interface UtilLib {
|
|
|
808
607
|
* @source https://wiki.facepunch.com/gmod/util.RemoveDecalsAt
|
|
809
608
|
*/
|
|
810
609
|
RemoveDecalsAt(pos: Vector, distance: number, limit?: number, permanent?: boolean): number;
|
|
811
|
-
}
|
|
812
|
-
|
|
813
|
-
interface UtilLib {
|
|
814
610
|
/**
|
|
815
611
|
* Removes persistent data of an offline player using their SteamID.
|
|
816
612
|
*
|
|
@@ -823,9 +619,6 @@ interface UtilLib {
|
|
|
823
619
|
* @source https://wiki.facepunch.com/gmod/util.RemovePData
|
|
824
620
|
*/
|
|
825
621
|
RemovePData(steamID: string, name: string): void;
|
|
826
|
-
}
|
|
827
|
-
|
|
828
|
-
interface UtilLib {
|
|
829
622
|
/**
|
|
830
623
|
* Generates the [SHA-1 hash](https://en.wikipedia.org/wiki/SHA-1) of the specified string.
|
|
831
624
|
* **WARNING**: SHA-1 is considered cryptographically broken and is known to be vulnerable to a variety of attacks. If security is a concern, use [util.SHA256](https://wiki.facepunch.com/gmod/util.SHA256).
|
|
@@ -835,18 +628,12 @@ interface UtilLib {
|
|
|
835
628
|
* @source https://wiki.facepunch.com/gmod/util.SHA1
|
|
836
629
|
*/
|
|
837
630
|
SHA1(stringToHash: string): string;
|
|
838
|
-
}
|
|
839
|
-
|
|
840
|
-
interface UtilLib {
|
|
841
631
|
/**
|
|
842
632
|
* Generates the [SHA-256 hash](https://en.wikipedia.org/wiki/SHA-2) of the specified string. This is mostly unique and is astronomically unlikely to return the same hash for a different string unlike [util.CRC](https://wiki.facepunch.com/gmod/util.CRC) or [util.MD5](https://wiki.facepunch.com/gmod/util.MD5) which are both much more vulnerable to duplicate returns.
|
|
843
633
|
* @realm shared
|
|
844
634
|
* @source https://wiki.facepunch.com/gmod/util.SHA256
|
|
845
635
|
*/
|
|
846
636
|
SHA256(stringToHash: string): string;
|
|
847
|
-
}
|
|
848
|
-
|
|
849
|
-
interface UtilLib {
|
|
850
637
|
/**
|
|
851
638
|
* Makes the screen shake.
|
|
852
639
|
*
|
|
@@ -856,9 +643,6 @@ interface UtilLib {
|
|
|
856
643
|
* @source https://wiki.facepunch.com/gmod/util.ScreenShake
|
|
857
644
|
*/
|
|
858
645
|
ScreenShake(pos: Vector, amplitude: number, frequency: number, duration: number, radius: number, airshake?: boolean, filter?: CRecipientFilter): void;
|
|
859
|
-
}
|
|
860
|
-
|
|
861
|
-
interface UtilLib {
|
|
862
646
|
/**
|
|
863
647
|
* Sets persistent data for offline player using their SteamID.
|
|
864
648
|
*
|
|
@@ -871,9 +655,6 @@ interface UtilLib {
|
|
|
871
655
|
* @source https://wiki.facepunch.com/gmod/util.SetPData
|
|
872
656
|
*/
|
|
873
657
|
SetPData(steamID: string, name: string, value: any): void;
|
|
874
|
-
}
|
|
875
|
-
|
|
876
|
-
interface UtilLib {
|
|
877
658
|
/**
|
|
878
659
|
* Generates a random float value that should be the same on client and server.
|
|
879
660
|
*
|
|
@@ -886,27 +667,18 @@ interface UtilLib {
|
|
|
886
667
|
* @source https://wiki.facepunch.com/gmod/util.SharedRandom
|
|
887
668
|
*/
|
|
888
669
|
SharedRandom(uniqueName: string, min: number, max: number, additionalSeed?: number): number;
|
|
889
|
-
}
|
|
890
|
-
|
|
891
|
-
interface UtilLib {
|
|
892
670
|
/**
|
|
893
671
|
* Adds a trail to the specified entity.
|
|
894
672
|
* @realm server
|
|
895
673
|
* @source https://wiki.facepunch.com/gmod/util.SpriteTrail
|
|
896
674
|
*/
|
|
897
675
|
SpriteTrail(ent: Entity, attachmentID: number, color: Color, additive: boolean, startWidth: number, endWidth: number, lifetime: number, textureRes: number, texture: string): Entity;
|
|
898
|
-
}
|
|
899
|
-
|
|
900
|
-
interface UtilLib {
|
|
901
676
|
/**
|
|
902
677
|
* Returns a new [Stack](https://wiki.facepunch.com/gmod/Stack) object.
|
|
903
678
|
* @realm shared and menu
|
|
904
679
|
* @source https://wiki.facepunch.com/gmod/util.Stack
|
|
905
680
|
*/
|
|
906
681
|
Stack(): Stack;
|
|
907
|
-
}
|
|
908
|
-
|
|
909
|
-
interface UtilLib {
|
|
910
682
|
/**
|
|
911
683
|
* Given a [64bit SteamID](https://wiki.facepunch.com/gmod/Player:SteamID64) will return a [STEAM_0:0:0](https://wiki.facepunch.com/gmod/Player:SteamID) style Steam ID.
|
|
912
684
|
*
|
|
@@ -917,18 +689,12 @@ interface UtilLib {
|
|
|
917
689
|
* @source https://wiki.facepunch.com/gmod/util.SteamIDFrom64
|
|
918
690
|
*/
|
|
919
691
|
SteamIDFrom64(id: string): string;
|
|
920
|
-
}
|
|
921
|
-
|
|
922
|
-
interface UtilLib {
|
|
923
692
|
/**
|
|
924
693
|
* Converts a [STEAM_0:0:0](https://wiki.facepunch.com/gmod/Player:SteamID) style SteamID to a [64bit SteamID](https://wiki.facepunch.com/gmod/Player:SteamID64).
|
|
925
694
|
* @realm shared
|
|
926
695
|
* @source https://wiki.facepunch.com/gmod/util.SteamIDTo64
|
|
927
696
|
*/
|
|
928
697
|
SteamIDTo64(id: string): string;
|
|
929
|
-
}
|
|
930
|
-
|
|
931
|
-
interface UtilLib {
|
|
932
698
|
/**
|
|
933
699
|
* Converts a string to the specified type.
|
|
934
700
|
*
|
|
@@ -938,9 +704,6 @@ interface UtilLib {
|
|
|
938
704
|
* @source https://wiki.facepunch.com/gmod/util.StringToType
|
|
939
705
|
*/
|
|
940
706
|
StringToType(str: string, typename: string): any;
|
|
941
|
-
}
|
|
942
|
-
|
|
943
|
-
interface UtilLib {
|
|
944
707
|
/**
|
|
945
708
|
* Converts a table to a JSON string. Keep in mind that not every data type can be stored in the JSON format, notably any entity will not be written, as if it wasn't in the table. Same goes for materials and textures, etc.
|
|
946
709
|
*
|
|
@@ -954,9 +717,6 @@ interface UtilLib {
|
|
|
954
717
|
* @source https://wiki.facepunch.com/gmod/util.TableToJSON
|
|
955
718
|
*/
|
|
956
719
|
TableToJSON(table: table, prettyPrint?: boolean): string;
|
|
957
|
-
}
|
|
958
|
-
|
|
959
|
-
interface UtilLib {
|
|
960
720
|
/**
|
|
961
721
|
* Converts the given table into a Valve keyValue formatted string.
|
|
962
722
|
*
|
|
@@ -968,27 +728,18 @@ interface UtilLib {
|
|
|
968
728
|
* @source https://wiki.facepunch.com/gmod/util.TableToKeyValues
|
|
969
729
|
*/
|
|
970
730
|
TableToKeyValues(table: table, rootKey?: string): string;
|
|
971
|
-
}
|
|
972
|
-
|
|
973
|
-
interface UtilLib {
|
|
974
731
|
/**
|
|
975
732
|
* Creates a timer object. The returned timer will be already started with given duration.
|
|
976
733
|
* @realm shared and menu
|
|
977
734
|
* @source https://wiki.facepunch.com/gmod/util.Timer
|
|
978
735
|
*/
|
|
979
736
|
Timer(duration?: number): table;
|
|
980
|
-
}
|
|
981
|
-
|
|
982
|
-
interface UtilLib {
|
|
983
737
|
/**
|
|
984
738
|
* Returns the time since this function has been last called
|
|
985
739
|
* @realm shared and menu
|
|
986
740
|
* @source https://wiki.facepunch.com/gmod/util.TimerCycle
|
|
987
741
|
*/
|
|
988
742
|
TimerCycle(): number;
|
|
989
|
-
}
|
|
990
|
-
|
|
991
|
-
interface UtilLib {
|
|
992
743
|
/**
|
|
993
744
|
* Runs a trace using the entity's collision model between two points. Does not
|
|
994
745
|
* take the entity's angles into account (traces the unrotated collision model).
|
|
@@ -996,10 +747,6 @@ interface UtilLib {
|
|
|
996
747
|
* @source https://wiki.facepunch.com/gmod/util.TraceEntity
|
|
997
748
|
*/
|
|
998
749
|
TraceEntity(tracedata: Trace, ent: Entity): TraceResult;
|
|
999
|
-
}
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
interface UtilLib {
|
|
1003
750
|
/**
|
|
1004
751
|
* Identical to util.TraceHull but uses an entity's Axis-Aligned Bounding Box
|
|
1005
752
|
* (AABB) for `mins`/`maxs` inputs (those two keys are ignored in the table).
|
|
@@ -1007,10 +754,6 @@ interface UtilLib {
|
|
|
1007
754
|
* @source https://wiki.facepunch.com/gmod/util.TraceEntityHull
|
|
1008
755
|
*/
|
|
1009
756
|
TraceEntityHull(tracedata: HullTrace, ent: Entity): TraceResult;
|
|
1010
|
-
}
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
interface UtilLib {
|
|
1014
757
|
/**
|
|
1015
758
|
* Performs an AABB hull (axis-aligned bounding box, not rotated) trace with the
|
|
1016
759
|
* given trace data. This trace type cannot hit hitboxes. See util.TraceLine for
|
|
@@ -1019,10 +762,6 @@ interface UtilLib {
|
|
|
1019
762
|
* @source https://wiki.facepunch.com/gmod/util.TraceHull
|
|
1020
763
|
*/
|
|
1021
764
|
TraceHull(TraceData: HullTrace): TraceResult;
|
|
1022
|
-
}
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
interface UtilLib {
|
|
1026
765
|
/**
|
|
1027
766
|
* Performs an infinitely thin, invisible ray trace in a line and returns a
|
|
1028
767
|
* table with information about what, if anything, the trace hit or intersected.
|
|
@@ -1031,19 +770,12 @@ interface UtilLib {
|
|
|
1031
770
|
* @source https://wiki.facepunch.com/gmod/util.TraceLine
|
|
1032
771
|
*/
|
|
1033
772
|
TraceLine(traceConfig: Trace): TraceResult;
|
|
1034
|
-
}
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
interface UtilLib {
|
|
1038
773
|
/**
|
|
1039
774
|
* Converts a type to a (nice, but still parsable) string
|
|
1040
775
|
* @realm shared and menu
|
|
1041
776
|
* @source https://wiki.facepunch.com/gmod/util.TypeToString
|
|
1042
777
|
*/
|
|
1043
778
|
TypeToString(input: any): string;
|
|
1044
|
-
}
|
|
1045
|
-
|
|
1046
|
-
interface UtilLib {
|
|
1047
779
|
/**
|
|
1048
780
|
* Converts string or a number to a bool, if possible. Alias of [Global.tobool](https://wiki.facepunch.com/gmod/Global.tobool).
|
|
1049
781
|
*
|
|
@@ -1054,6 +786,98 @@ interface UtilLib {
|
|
|
1054
786
|
tobool(input: any): boolean;
|
|
1055
787
|
}
|
|
1056
788
|
|
|
789
|
+
|
|
790
|
+
|
|
791
|
+
|
|
792
|
+
|
|
793
|
+
|
|
794
|
+
|
|
795
|
+
|
|
796
|
+
|
|
797
|
+
|
|
798
|
+
|
|
799
|
+
|
|
800
|
+
|
|
801
|
+
|
|
802
|
+
|
|
803
|
+
|
|
804
|
+
|
|
805
|
+
|
|
806
|
+
|
|
807
|
+
|
|
808
|
+
|
|
809
|
+
|
|
810
|
+
|
|
811
|
+
|
|
812
|
+
|
|
813
|
+
|
|
814
|
+
|
|
815
|
+
|
|
816
|
+
|
|
817
|
+
|
|
818
|
+
|
|
819
|
+
|
|
820
|
+
|
|
821
|
+
|
|
822
|
+
|
|
823
|
+
|
|
824
|
+
|
|
825
|
+
|
|
826
|
+
|
|
827
|
+
|
|
828
|
+
|
|
829
|
+
|
|
830
|
+
|
|
831
|
+
|
|
832
|
+
|
|
833
|
+
|
|
834
|
+
|
|
835
|
+
|
|
836
|
+
|
|
837
|
+
|
|
838
|
+
|
|
839
|
+
|
|
840
|
+
|
|
841
|
+
|
|
842
|
+
|
|
843
|
+
|
|
844
|
+
|
|
845
|
+
|
|
846
|
+
|
|
847
|
+
|
|
848
|
+
|
|
849
|
+
|
|
850
|
+
|
|
851
|
+
|
|
852
|
+
|
|
853
|
+
|
|
854
|
+
|
|
855
|
+
|
|
856
|
+
|
|
857
|
+
|
|
858
|
+
|
|
859
|
+
|
|
860
|
+
|
|
861
|
+
|
|
862
|
+
|
|
863
|
+
|
|
864
|
+
|
|
865
|
+
|
|
866
|
+
|
|
867
|
+
|
|
868
|
+
|
|
869
|
+
|
|
870
|
+
|
|
871
|
+
|
|
872
|
+
|
|
873
|
+
|
|
874
|
+
|
|
875
|
+
|
|
876
|
+
|
|
877
|
+
|
|
878
|
+
|
|
879
|
+
|
|
880
|
+
|
|
1057
881
|
interface UtilworldpickerLib {
|
|
1058
882
|
/**
|
|
1059
883
|
* Returns if the user is currently picking an entity.
|
|
@@ -1061,9 +885,6 @@ interface UtilworldpickerLib {
|
|
|
1061
885
|
* @source https://wiki.facepunch.com/gmod/util.worldpicker.Active
|
|
1062
886
|
*/
|
|
1063
887
|
Active(): boolean;
|
|
1064
|
-
}
|
|
1065
|
-
|
|
1066
|
-
interface UtilworldpickerLib {
|
|
1067
888
|
/**
|
|
1068
889
|
* **INTERNAL**: This is used internally - although you're able to use it you probably shouldn't.
|
|
1069
890
|
*
|
|
@@ -1074,9 +895,6 @@ interface UtilworldpickerLib {
|
|
|
1074
895
|
* @source https://wiki.facepunch.com/gmod/util.worldpicker.Finish
|
|
1075
896
|
*/
|
|
1076
897
|
Finish(tr: TraceResult): void;
|
|
1077
|
-
}
|
|
1078
|
-
|
|
1079
|
-
interface UtilworldpickerLib {
|
|
1080
898
|
/**
|
|
1081
899
|
* Starts picking an entity in the world. This will suppress the next mouse click, and instead use it as a direction in the trace sent to the callback.
|
|
1082
900
|
* @realm client
|
|
@@ -1085,3 +903,5 @@ interface UtilworldpickerLib {
|
|
|
1085
903
|
Start(callback: (tr: table) => void): void;
|
|
1086
904
|
}
|
|
1087
905
|
|
|
906
|
+
|
|
907
|
+
|