gtac-types 0.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.
- package/LICENSE +201 -0
- package/README.md +435 -0
- package/bin/gtac.js +35 -0
- package/index.js +6 -0
- package/lib/build.js +186 -0
- package/package.json +51 -0
- package/src/index.d.ts +22 -0
- package/src/runtime/shared/constants.ts +146 -0
- package/src/runtime/shared/utils.ts +26 -0
- package/src/types/client/animations.d.ts +902 -0
- package/src/types/client/events.d.ts +809 -0
- package/src/types/client/functions.d.ts +715 -0
- package/src/types/client/gta.d.ts +724 -0
- package/src/types/client/natives.d.ts +1091 -0
- package/src/types/element.d.ts +853 -0
- package/src/types/event.d.ts +100 -0
- package/src/types/misc.d.ts +256 -0
- package/src/types/resource.d.ts +252 -0
- package/src/types/server/client.d.ts +144 -0
- package/src/types/server/events.d.ts +407 -0
- package/src/types/server/functions.d.ts +890 -0
- package/src/types/vec.d.ts +594 -0
- package/src/types/xml.d.ts +232 -0
- package/templates/meta.xml +4 -0
- package/templates/tsconfig.json +12 -0
|
@@ -0,0 +1,724 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GTAC Client Game, Platform, and Natives Declarations
|
|
3
|
+
*
|
|
4
|
+
* Defines the client-side `gta` global object (the primary API for interacting
|
|
5
|
+
* with the GTA game world), the `game` object (engine-level controls), the
|
|
6
|
+
* `platform` object (timing information), and the `natives` reference
|
|
7
|
+
* (low-level game opcode functions).
|
|
8
|
+
*
|
|
9
|
+
* The `gta` object provides methods for controlling AI, buildings, camera,
|
|
10
|
+
* cheats, controls, drawing, entities, cutscenes, messages, radar, HUD,
|
|
11
|
+
* IPL loading, and world creation (markers, objects, peds, pickups, vehicles,
|
|
12
|
+
* blips, spheres), as well as time, weather, and world physics.
|
|
13
|
+
*
|
|
14
|
+
* All declarations are global — no import required.
|
|
15
|
+
*
|
|
16
|
+
* @module types/client/gta
|
|
17
|
+
* @see https://wiki.gtaconnected.com — GTA Connected Wiki
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* // Change the weather and time
|
|
21
|
+
* gta.setWeather(0); // Sunny
|
|
22
|
+
* gta.setTime(12, 0); // Noon
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* // Spawn a vehicle at the player's position
|
|
26
|
+
* const pos = localPlayer.position;
|
|
27
|
+
* const car = gta.createVehicle(141, pos.x, pos.y, pos.z, 0);
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
// ===== Game (gta) =====
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Primary GTA game world manipulation API.
|
|
34
|
+
* Provides methods and properties for controlling nearly every aspect of
|
|
35
|
+
* the game world: AI, buildings, camera, cheats, controls, rendering,
|
|
36
|
+
* entities, cutscenes, messages, radar, HUD, IPL loading, creation of game
|
|
37
|
+
* objects (markers, objects, peds, pickups, vehicles, blips, spheres),
|
|
38
|
+
* time/weather management, and world physics.
|
|
39
|
+
*
|
|
40
|
+
* @see https://wiki.gtaconnected.com — GTA Connected Wiki
|
|
41
|
+
*/
|
|
42
|
+
declare var gta: {
|
|
43
|
+
// -- AI --
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Enables or disables the spawning of civilian peds.
|
|
47
|
+
* @param enabled - `true` to allow civilians, `false` to prevent civilian spawning.
|
|
48
|
+
*/
|
|
49
|
+
setCiviliansEnabled(enabled: boolean): void;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Enables or disables airplane traffic.
|
|
53
|
+
* @param enabled - `true` to allow planes, `false` to disable plane traffic.
|
|
54
|
+
*/
|
|
55
|
+
setPlanesEnabled(enabled: boolean): void;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Enables or disables general vehicle traffic.
|
|
59
|
+
* When disabled, no AI-controlled vehicles will spawn on roads.
|
|
60
|
+
* @param enabled - `true` to allow traffic, `false` to disable.
|
|
61
|
+
*/
|
|
62
|
+
setTrafficEnabled(enabled: boolean): void;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Sets the density of vehicle traffic.
|
|
66
|
+
* @param density - Traffic density value (0.0 = none, 1.0 = normal, higher = denser).
|
|
67
|
+
*/
|
|
68
|
+
trafficDensity(density: number): void;
|
|
69
|
+
|
|
70
|
+
// -- Building --
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Swaps the nearest building model within a radius with a new model.
|
|
74
|
+
* Useful for dynamic world modification (e.g. replacing a building with another).
|
|
75
|
+
*
|
|
76
|
+
* @param oldModel - The existing building model ID to replace.
|
|
77
|
+
* @param newModel - The new building model ID to use.
|
|
78
|
+
* @param x - X coordinate of the search centre.
|
|
79
|
+
* @param y - Y coordinate of the search centre.
|
|
80
|
+
* @param z - Z coordinate of the search centre.
|
|
81
|
+
* @param radius - Search radius in world units.
|
|
82
|
+
*/
|
|
83
|
+
swapNearestBuildingModel(
|
|
84
|
+
oldModel: number,
|
|
85
|
+
newModel: number,
|
|
86
|
+
x: number,
|
|
87
|
+
y: number,
|
|
88
|
+
z: number,
|
|
89
|
+
radius: number
|
|
90
|
+
): void;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Reverts all building model swaps, restoring original models.
|
|
94
|
+
*/
|
|
95
|
+
undoBuildingSwaps(): void;
|
|
96
|
+
|
|
97
|
+
// -- Camera --
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Current camera interior ID.
|
|
101
|
+
* 0 = exterior, other values correspond to specific interiors.
|
|
102
|
+
*/
|
|
103
|
+
cameraInterior: number;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Current camera transformation matrix.
|
|
107
|
+
* Represents the camera's position and orientation as a 4x4 matrix.
|
|
108
|
+
*/
|
|
109
|
+
cameraMatrix: Matrix4x4;
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* The `Entity` the camera is currently looking at/targeting.
|
|
113
|
+
*/
|
|
114
|
+
cameraTarget: Entity;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Fades the camera in or out over a specified duration.
|
|
118
|
+
*
|
|
119
|
+
* @param fade - Fade direction: `FADE_IN` (show) or `FADE_OUT` (hide).
|
|
120
|
+
* @param duration - Duration of the fade in milliseconds.
|
|
121
|
+
* @param args - Additional arguments (e.g. colour).
|
|
122
|
+
*/
|
|
123
|
+
fadeCamera(fade: number, duration: number, ...args: any[]): void;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Whether the camera is currently in the middle of a fade transition.
|
|
127
|
+
*/
|
|
128
|
+
fading: boolean;
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Restores the camera to its default position (behind the player).
|
|
132
|
+
*/
|
|
133
|
+
restoreCamera(): void;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Points the camera to look at a specific world coordinate.
|
|
137
|
+
*
|
|
138
|
+
* @param x - Target X coordinate.
|
|
139
|
+
* @param y - Target Y coordinate.
|
|
140
|
+
* @param z - Target Z coordinate.
|
|
141
|
+
*/
|
|
142
|
+
setCameraLookAt(x: number, y: number, z: number): void;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Points the camera to look at a specific entity, following it.
|
|
146
|
+
*
|
|
147
|
+
* @param entity - The `Entity` to point the camera at.
|
|
148
|
+
*/
|
|
149
|
+
setCameraLookAtEntity(entity: Entity): void;
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Positions and orients the camera using a matrix.
|
|
153
|
+
*
|
|
154
|
+
* @param x - Camera X position.
|
|
155
|
+
* @param y - Camera Y position.
|
|
156
|
+
* @param z - Camera Z position.
|
|
157
|
+
* @param rx - Camera X rotation (pitch).
|
|
158
|
+
* @param ry - Camera Y rotation (yaw).
|
|
159
|
+
* @param rz - Camera Z rotation (roll).
|
|
160
|
+
*/
|
|
161
|
+
setCameraMatrix(
|
|
162
|
+
x: number,
|
|
163
|
+
y: number,
|
|
164
|
+
z: number,
|
|
165
|
+
rx: number,
|
|
166
|
+
ry: number,
|
|
167
|
+
rz: number
|
|
168
|
+
): void;
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Sets the camera to target/follow a specific entity.
|
|
172
|
+
*
|
|
173
|
+
* @param entity - The `Entity` for the camera to target.
|
|
174
|
+
*/
|
|
175
|
+
setCameraTarget(entity: Entity): void;
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Toggles whether cars are generated around the camera position.
|
|
179
|
+
* @param enabled - `true` to generate cars around the camera.
|
|
180
|
+
*/
|
|
181
|
+
setGenerateCarsAroundCamera(enabled: boolean): void;
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Forces a camera update, applying any pending changes immediately.
|
|
185
|
+
*/
|
|
186
|
+
updateCamera(): void;
|
|
187
|
+
|
|
188
|
+
// -- Cheat --
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Checks whether a specific cheat is currently active.
|
|
192
|
+
*
|
|
193
|
+
* @param cheat - Cheat ID constant (e.g. `CHEAT_FASTTIME`).
|
|
194
|
+
* @returns `true` if the cheat is enabled.
|
|
195
|
+
*/
|
|
196
|
+
isCheatEnabled(cheat: number): boolean;
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Enables or disables a specific cheat.
|
|
200
|
+
*
|
|
201
|
+
* @param cheat - Cheat ID constant.
|
|
202
|
+
* @param enabled - `true` to enable, `false` to disable.
|
|
203
|
+
*/
|
|
204
|
+
setCheatEnabled(cheat: number, enabled: boolean): void;
|
|
205
|
+
|
|
206
|
+
// -- Control --
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Enables or disables the standard game controls for the local player.
|
|
210
|
+
* When disabled, the player cannot move, jump, shoot, etc.
|
|
211
|
+
*
|
|
212
|
+
* @param enabled - `true` to enable standard controls, `false` to freeze input.
|
|
213
|
+
*/
|
|
214
|
+
standardControls(enabled: boolean): void;
|
|
215
|
+
|
|
216
|
+
// -- Drawing --
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* Draws a 2D rectangle on screen using a texture.
|
|
220
|
+
*
|
|
221
|
+
* Arguments are variadic to match the `drawRectangle` opcode:
|
|
222
|
+
* `(texture, position: Vec2, size: Vec2, centre: boolean, rotation: number, colour, source: Vec2, sourceSize: Vec2)`.
|
|
223
|
+
*
|
|
224
|
+
* @param args - Variadic parameters as documented for the drawRectangle opcode.
|
|
225
|
+
*/
|
|
226
|
+
drawRectangle(...args: any[]): void;
|
|
227
|
+
|
|
228
|
+
// -- Entity --
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* Undoes all entity invisibility settings, restoring visibility defaults.
|
|
232
|
+
*/
|
|
233
|
+
undoEntityInvisibilitySettings(): void;
|
|
234
|
+
|
|
235
|
+
// -- Cutscene --
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Loads a cutscene by name for later playback.
|
|
239
|
+
* @param name - The cutscene name/identifier to load.
|
|
240
|
+
*/
|
|
241
|
+
loadCutscene(name: string): void;
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Plays the currently loaded cutscene.
|
|
245
|
+
*/
|
|
246
|
+
playCutscene(): void;
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* Stops any currently playing cutscene.
|
|
250
|
+
*/
|
|
251
|
+
stopCutscene(): void;
|
|
252
|
+
|
|
253
|
+
// -- Message / Text --
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* Displays styled text at screen coordinates.
|
|
257
|
+
* @param x - Screen X position (pixels).
|
|
258
|
+
* @param y - Screen Y position (pixels).
|
|
259
|
+
* @param text - Text string to display.
|
|
260
|
+
*/
|
|
261
|
+
displayText(x: number, y: number, text: string): void;
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* Displays styled text with a number embedded, at screen coordinates.
|
|
265
|
+
* @param x - Screen X position.
|
|
266
|
+
* @param y - Screen Y position.
|
|
267
|
+
* @param text - Text string (use `~1~` as placeholder for the number).
|
|
268
|
+
* @param num - The number to insert into the text.
|
|
269
|
+
*/
|
|
270
|
+
displayTextWithNumber(x: number, y: number, text: string, num: number): void;
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* Clears all displayed text from the screen.
|
|
274
|
+
*/
|
|
275
|
+
clearText(): void;
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* Displays help text (the small text area in the top-left of the HUD).
|
|
279
|
+
* @param text - Help text string to display.
|
|
280
|
+
*/
|
|
281
|
+
displayHelpText(text: string): void;
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* Clears the currently displayed help text.
|
|
285
|
+
*/
|
|
286
|
+
clearHelpText(): void;
|
|
287
|
+
|
|
288
|
+
// -- Radar --
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* Whether the radar/minimap is currently enabled.
|
|
292
|
+
*/
|
|
293
|
+
radarEnabled: boolean;
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* Enables or disables the radar/minimap display.
|
|
297
|
+
* @param enabled - `true` to show radar, `false` to hide.
|
|
298
|
+
*/
|
|
299
|
+
setRadarEnabled(enabled: boolean): void;
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* Gets the current radar enabled state.
|
|
303
|
+
* @returns `true` if the radar is enabled.
|
|
304
|
+
*/
|
|
305
|
+
getRadarEnabled(): boolean;
|
|
306
|
+
|
|
307
|
+
// -- HUD --
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* Shows or hides the entire HUD (health, armour, weapon, radar, etc.).
|
|
311
|
+
* @param visible - `true` to show HUD, `false` to hide entirely.
|
|
312
|
+
*/
|
|
313
|
+
setHUDVisible(visible: boolean): void;
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* Checks whether the HUD is currently visible.
|
|
317
|
+
* @returns `true` if the HUD is visible.
|
|
318
|
+
*/
|
|
319
|
+
isHUDVisible(): boolean;
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
* Shows or hides a specific HUD component.
|
|
323
|
+
* @param component - HUD component ID.
|
|
324
|
+
* @param visible - `true` to show, `false` to hide.
|
|
325
|
+
*/
|
|
326
|
+
setHUDComponentVisible(component: number, visible: boolean): void;
|
|
327
|
+
|
|
328
|
+
/**
|
|
329
|
+
* Checks whether a specific HUD component is visible.
|
|
330
|
+
* @param component - HUD component ID.
|
|
331
|
+
* @returns `true` if the component is visible.
|
|
332
|
+
*/
|
|
333
|
+
isHUDComponentVisible(component: number): boolean;
|
|
334
|
+
|
|
335
|
+
// -- IPL --
|
|
336
|
+
|
|
337
|
+
/**
|
|
338
|
+
* Loads an IPL (Item Placement) file, adding its buildings/objects to the world.
|
|
339
|
+
* @param name - IPL file name without extension.
|
|
340
|
+
*/
|
|
341
|
+
loadIPL(name: string): void;
|
|
342
|
+
|
|
343
|
+
/**
|
|
344
|
+
* Unloads an IPL file, removing its buildings/objects from the world.
|
|
345
|
+
* @param name - IPL file name without extension.
|
|
346
|
+
*/
|
|
347
|
+
unloadIPL(name: string): void;
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* Checks whether an IPL file is currently loaded.
|
|
351
|
+
* @param name - IPL file name.
|
|
352
|
+
* @returns `true` if the IPL is loaded.
|
|
353
|
+
*/
|
|
354
|
+
isIPLLoaded(name: string): boolean;
|
|
355
|
+
|
|
356
|
+
// -- Markers --
|
|
357
|
+
|
|
358
|
+
/**
|
|
359
|
+
* Creates a 3D world marker at the specified position.
|
|
360
|
+
*
|
|
361
|
+
* @param x - X coordinate.
|
|
362
|
+
* @param y - Y coordinate.
|
|
363
|
+
* @param z - Z coordinate.
|
|
364
|
+
* @param type - Marker type ID (cylinder, arrow, etc.).
|
|
365
|
+
* @param size - Marker size/diameter.
|
|
366
|
+
* @param r - Red colour component (0–255).
|
|
367
|
+
* @param g - Green colour component (0–255).
|
|
368
|
+
* @param b - Blue colour component (0–255).
|
|
369
|
+
* @param a - Alpha/opacity component (0–255, 255 = fully opaque).
|
|
370
|
+
* @returns The created `Marker`.
|
|
371
|
+
*/
|
|
372
|
+
createMarker(
|
|
373
|
+
x: number,
|
|
374
|
+
y: number,
|
|
375
|
+
z: number,
|
|
376
|
+
type: number,
|
|
377
|
+
size: number,
|
|
378
|
+
r: number,
|
|
379
|
+
g: number,
|
|
380
|
+
b: number,
|
|
381
|
+
a: number
|
|
382
|
+
): Marker;
|
|
383
|
+
|
|
384
|
+
// -- Objects --
|
|
385
|
+
|
|
386
|
+
/**
|
|
387
|
+
* Creates a placeable object with a given model at the specified position and rotation.
|
|
388
|
+
*
|
|
389
|
+
* @param model - GTA model ID.
|
|
390
|
+
* @param x - X position.
|
|
391
|
+
* @param y - Y position.
|
|
392
|
+
* @param z - Z position.
|
|
393
|
+
* @param rx - X rotation (pitch) in degrees.
|
|
394
|
+
* @param ry - Y rotation (roll) in degrees.
|
|
395
|
+
* @param rz - Z rotation (yaw) in degrees.
|
|
396
|
+
* @returns The created `Object`.
|
|
397
|
+
*/
|
|
398
|
+
createObject(
|
|
399
|
+
model: number,
|
|
400
|
+
x: number,
|
|
401
|
+
y: number,
|
|
402
|
+
z: number,
|
|
403
|
+
rx: number,
|
|
404
|
+
ry: number,
|
|
405
|
+
rz: number
|
|
406
|
+
): Object;
|
|
407
|
+
|
|
408
|
+
// -- Peds --
|
|
409
|
+
|
|
410
|
+
/**
|
|
411
|
+
* Creates a pedestrian (AI character) at the specified position.
|
|
412
|
+
*
|
|
413
|
+
* @param model - Ped model/skin ID (see PedSkin enum).
|
|
414
|
+
* @param x - X position.
|
|
415
|
+
* @param y - Y position.
|
|
416
|
+
* @param z - Z position.
|
|
417
|
+
* @param rz - Z rotation (heading) in degrees.
|
|
418
|
+
* @returns The created `Ped`.
|
|
419
|
+
*/
|
|
420
|
+
createPed(model: number, x: number, y: number, z: number, rz: number): Ped;
|
|
421
|
+
|
|
422
|
+
// -- Pickups --
|
|
423
|
+
|
|
424
|
+
/**
|
|
425
|
+
* Creates a collectible pickup in the world.
|
|
426
|
+
*
|
|
427
|
+
* @param model - Pickup model ID (see PickupModel enum).
|
|
428
|
+
* @param position - World position as a `Vec3`.
|
|
429
|
+
* @param type - Pickup type constant.
|
|
430
|
+
* @returns The created `Pickup`, or `null` on failure.
|
|
431
|
+
*/
|
|
432
|
+
createPickup(model: number, position: Vec3, type: number): Pickup | null;
|
|
433
|
+
|
|
434
|
+
// -- Vehicles --
|
|
435
|
+
|
|
436
|
+
/**
|
|
437
|
+
* Creates a vehicle at the specified position.
|
|
438
|
+
*
|
|
439
|
+
* @param model - Vehicle model ID (see VehicleModel enum).
|
|
440
|
+
* @param x - X position.
|
|
441
|
+
* @param y - Y position.
|
|
442
|
+
* @param z - Z position.
|
|
443
|
+
* @param rz - Z rotation (heading) in degrees.
|
|
444
|
+
* @param c1 - Primary colour ID (optional).
|
|
445
|
+
* @param c2 - Secondary colour ID (optional).
|
|
446
|
+
* @returns The created `Vehicle`.
|
|
447
|
+
*/
|
|
448
|
+
createVehicle(
|
|
449
|
+
model: number,
|
|
450
|
+
x: number,
|
|
451
|
+
y: number,
|
|
452
|
+
z: number,
|
|
453
|
+
rz: number,
|
|
454
|
+
c1?: number,
|
|
455
|
+
c2?: number
|
|
456
|
+
): Vehicle;
|
|
457
|
+
|
|
458
|
+
// -- Blips --
|
|
459
|
+
|
|
460
|
+
/**
|
|
461
|
+
* Creates a radar blip at a fixed world position.
|
|
462
|
+
*
|
|
463
|
+
* @param position - World position as a `Vec3`.
|
|
464
|
+
* @param icon - Blip icon ID (see Icon enum).
|
|
465
|
+
* @param size - Blip size on radar (optional, default 2).
|
|
466
|
+
* @param colour - Blip colour as 0xRRGGBB hex (optional, default 0). Example: `0xFFD700` for yellow.
|
|
467
|
+
* @returns The created `Blip`.
|
|
468
|
+
*/
|
|
469
|
+
createBlip(
|
|
470
|
+
position: Vec3,
|
|
471
|
+
icon: number,
|
|
472
|
+
size?: number,
|
|
473
|
+
colour?: number
|
|
474
|
+
): Blip;
|
|
475
|
+
|
|
476
|
+
/**
|
|
477
|
+
* Creates a radar blip attached to an element, following its position.
|
|
478
|
+
*
|
|
479
|
+
* @param element - The element to attach the blip to, or `null`.
|
|
480
|
+
* @param icon - Blip icon ID (see Icon enum).
|
|
481
|
+
* @param size - Blip size on radar (optional, default 2).
|
|
482
|
+
* @param colour - Blip colour as 0xRRGGBB hex (optional, default 0).
|
|
483
|
+
* @param blip - Whether to show a radar blip (optional, default `true`).
|
|
484
|
+
* @param marker - Whether to show a 3D world marker (optional, default `false`).
|
|
485
|
+
* @returns The created `Blip`.
|
|
486
|
+
*/
|
|
487
|
+
createBlipAttachedTo(
|
|
488
|
+
element: Element | null,
|
|
489
|
+
icon: number,
|
|
490
|
+
size?: number,
|
|
491
|
+
colour?: number,
|
|
492
|
+
blip?: boolean,
|
|
493
|
+
marker?: boolean
|
|
494
|
+
): Blip;
|
|
495
|
+
|
|
496
|
+
// -- Time --
|
|
497
|
+
|
|
498
|
+
/**
|
|
499
|
+
* Gets the real-time duration of one in-game minute in milliseconds.
|
|
500
|
+
* Default is 1000ms (one real second = one game minute).
|
|
501
|
+
*
|
|
502
|
+
* @returns Duration in milliseconds.
|
|
503
|
+
*/
|
|
504
|
+
getMinuteDuration(): number;
|
|
505
|
+
|
|
506
|
+
/**
|
|
507
|
+
* Sets the real-time duration of one in-game minute.
|
|
508
|
+
* Lower values = faster in-game clock.
|
|
509
|
+
*
|
|
510
|
+
* @param ms - Duration per game minute in milliseconds.
|
|
511
|
+
*/
|
|
512
|
+
setMinuteDuration(ms: number): void;
|
|
513
|
+
|
|
514
|
+
/**
|
|
515
|
+
* Gets the current in-game time.
|
|
516
|
+
*
|
|
517
|
+
* @returns Object with `hour` (0–23) and `minute` (0–59).
|
|
518
|
+
*/
|
|
519
|
+
getTime(): { hour: number; minute: number };
|
|
520
|
+
|
|
521
|
+
/**
|
|
522
|
+
* Sets the current in-game time.
|
|
523
|
+
*
|
|
524
|
+
* @param h - Hour (0–23).
|
|
525
|
+
* @param m - Minute (0–59).
|
|
526
|
+
*/
|
|
527
|
+
setTime(h: number, m: number): void;
|
|
528
|
+
|
|
529
|
+
// -- Weather --
|
|
530
|
+
|
|
531
|
+
/**
|
|
532
|
+
* Gets the current weather ID.
|
|
533
|
+
* @returns Weather ID (0 = sunny, 1 = cloudy, 2 = rainy, 3 = foggy, etc.).
|
|
534
|
+
*/
|
|
535
|
+
getWeather(): number;
|
|
536
|
+
|
|
537
|
+
/**
|
|
538
|
+
* Sets the current weather immediately.
|
|
539
|
+
* @param weather - Weather ID to apply.
|
|
540
|
+
*/
|
|
541
|
+
setWeather(weather: number): void;
|
|
542
|
+
|
|
543
|
+
/**
|
|
544
|
+
* Smoothly blends between two weather states over time.
|
|
545
|
+
*
|
|
546
|
+
* @param w1 - Source weather ID.
|
|
547
|
+
* @param w2 - Target weather ID.
|
|
548
|
+
* @param percent - Blend percentage (0.0 = all source, 1.0 = all target).
|
|
549
|
+
*/
|
|
550
|
+
setWeatherBlend(w1: number, w2: number, percent: number): void;
|
|
551
|
+
|
|
552
|
+
// -- World --
|
|
553
|
+
|
|
554
|
+
/**
|
|
555
|
+
* Gets the current gravity multiplier.
|
|
556
|
+
* @returns Gravity value (default ~0.008).
|
|
557
|
+
*/
|
|
558
|
+
getGravity(): number;
|
|
559
|
+
|
|
560
|
+
/**
|
|
561
|
+
* Sets the gravity multiplier for the game world.
|
|
562
|
+
* @param g - Gravity value (0.008 = normal; 0.002 = moon-like; negative = reverse).
|
|
563
|
+
*/
|
|
564
|
+
setGravity(g: number): void;
|
|
565
|
+
|
|
566
|
+
/**
|
|
567
|
+
* Gets the current game speed multiplier.
|
|
568
|
+
* @returns Game speed value (1.0 = normal).
|
|
569
|
+
*/
|
|
570
|
+
getGameSpeed(): number;
|
|
571
|
+
|
|
572
|
+
/**
|
|
573
|
+
* Sets the game speed multiplier.
|
|
574
|
+
* @param speed - Speed value (1.0 = normal; 2.0 = double speed; 0.5 = slow motion).
|
|
575
|
+
*/
|
|
576
|
+
setGameSpeed(speed: number): void;
|
|
577
|
+
|
|
578
|
+
// -- Existing Extensions --
|
|
579
|
+
|
|
580
|
+
/**
|
|
581
|
+
* Whether the game is currently paused.
|
|
582
|
+
*/
|
|
583
|
+
paused: boolean;
|
|
584
|
+
|
|
585
|
+
/**
|
|
586
|
+
* Whether the player is currently on a mission.
|
|
587
|
+
*/
|
|
588
|
+
onMission: boolean;
|
|
589
|
+
|
|
590
|
+
/**
|
|
591
|
+
* Game screen width in pixels.
|
|
592
|
+
*/
|
|
593
|
+
width: number;
|
|
594
|
+
|
|
595
|
+
/**
|
|
596
|
+
* Game screen height in pixels.
|
|
597
|
+
*/
|
|
598
|
+
height: number;
|
|
599
|
+
|
|
600
|
+
/**
|
|
601
|
+
* Current weather ID (property — use `getWeather()` and `setWeather()` for function access).
|
|
602
|
+
*/
|
|
603
|
+
weather: number;
|
|
604
|
+
|
|
605
|
+
/**
|
|
606
|
+
* Current in-game time as `{ hour, minute }`.
|
|
607
|
+
*/
|
|
608
|
+
time: { hour: number; minute: number };
|
|
609
|
+
|
|
610
|
+
/**
|
|
611
|
+
* Sets a custom GXT (game text) key to a new value.
|
|
612
|
+
* GXT keys are used by the game for displaying localized text.
|
|
613
|
+
*
|
|
614
|
+
* @param key - The GXT key name.
|
|
615
|
+
* @param text - The new text value to assign.
|
|
616
|
+
*/
|
|
617
|
+
setCustomText(key: string, text: string): void;
|
|
618
|
+
|
|
619
|
+
/**
|
|
620
|
+
* Starts a game mission by ID.
|
|
621
|
+
* @param id - Mission ID to start.
|
|
622
|
+
*/
|
|
623
|
+
startMission(id: number): void;
|
|
624
|
+
|
|
625
|
+
/**
|
|
626
|
+
* Cancels the currently active mission.
|
|
627
|
+
* @param instant - If `true`, stop instantly; otherwise transition out.
|
|
628
|
+
*/
|
|
629
|
+
cancelMission(instant?: boolean): void;
|
|
630
|
+
|
|
631
|
+
/**
|
|
632
|
+
* Creates an invisible trigger sphere at a position with a given radius.
|
|
633
|
+
*
|
|
634
|
+
* @param position - World position as a `Vec3`.
|
|
635
|
+
* @param radius - Sphere radius in world units.
|
|
636
|
+
* @returns The created `Sphere`.
|
|
637
|
+
*/
|
|
638
|
+
createSphere(position: Vec3, radius: number): Sphere;
|
|
639
|
+
|
|
640
|
+
/**
|
|
641
|
+
* Gets a list of all currently active game script names.
|
|
642
|
+
* @returns Array of script name strings.
|
|
643
|
+
*/
|
|
644
|
+
getActiveScripts(): string[];
|
|
645
|
+
|
|
646
|
+
/**
|
|
647
|
+
* Terminates a game script by its name.
|
|
648
|
+
* @param name - The script name to terminate.
|
|
649
|
+
*/
|
|
650
|
+
terminateScript(name: string): void;
|
|
651
|
+
};
|
|
652
|
+
|
|
653
|
+
// ===== Game Control =====
|
|
654
|
+
|
|
655
|
+
/**
|
|
656
|
+
* Engine-level game control and state API.
|
|
657
|
+
* Provides low-level access to game tick count, player control toggling,
|
|
658
|
+
* camera fading, and interior IDs.
|
|
659
|
+
*/
|
|
660
|
+
declare var game: {
|
|
661
|
+
/**
|
|
662
|
+
* Game type identifier (e.g. `GAME_GTA_VC`).
|
|
663
|
+
*/
|
|
664
|
+
game: number;
|
|
665
|
+
|
|
666
|
+
/**
|
|
667
|
+
* Enables or disables player control (movement, actions).
|
|
668
|
+
* @param enabled - `true` to allow player input, `false` to freeze.
|
|
669
|
+
*/
|
|
670
|
+
setPlayerControl(enabled: boolean): void;
|
|
671
|
+
|
|
672
|
+
/**
|
|
673
|
+
* Fades the camera in or out.
|
|
674
|
+
* @param state - `true` = fade in, `false` = fade out.
|
|
675
|
+
* @param duration - Fade duration in milliseconds.
|
|
676
|
+
*/
|
|
677
|
+
fadeCamera(state: boolean, duration: number): void;
|
|
678
|
+
|
|
679
|
+
/**
|
|
680
|
+
* Fades the camera in or out with a custom fade colour.
|
|
681
|
+
* @param state - `true` = fade in, `false` = fade out.
|
|
682
|
+
* @param duration - Fade duration in milliseconds.
|
|
683
|
+
* @param colour - Packed ARGB colour for the fade.
|
|
684
|
+
*/
|
|
685
|
+
fadeCamera(state: boolean, duration: number, colour: number): void;
|
|
686
|
+
|
|
687
|
+
/**
|
|
688
|
+
* Current game tick counter (increments every frame).
|
|
689
|
+
*/
|
|
690
|
+
tick: number;
|
|
691
|
+
|
|
692
|
+
/**
|
|
693
|
+
* Current camera interior ID.
|
|
694
|
+
*/
|
|
695
|
+
cameraInterior: number;
|
|
696
|
+
|
|
697
|
+
/**
|
|
698
|
+
* Current player interior ID.
|
|
699
|
+
*/
|
|
700
|
+
interior: number;
|
|
701
|
+
};
|
|
702
|
+
|
|
703
|
+
// ===== Platform =====
|
|
704
|
+
|
|
705
|
+
/**
|
|
706
|
+
* Platform-level timing information.
|
|
707
|
+
*/
|
|
708
|
+
declare var platform: {
|
|
709
|
+
/**
|
|
710
|
+
* High-resolution tick count in milliseconds since the client started.
|
|
711
|
+
* Use for delta-time calculations and performance measurement.
|
|
712
|
+
*/
|
|
713
|
+
ticks: number;
|
|
714
|
+
};
|
|
715
|
+
|
|
716
|
+
// ===== Natives =====
|
|
717
|
+
|
|
718
|
+
/**
|
|
719
|
+
* Reference to the low-level game native functions (opcode interface).
|
|
720
|
+
* Provides direct access to all GTA Vice City game script opcodes.
|
|
721
|
+
*
|
|
722
|
+
* @see `types/client/natives.d.ts` for the full function list.
|
|
723
|
+
*/
|
|
724
|
+
declare var natives: Natives;
|