@cybermp/client-types 2.2.0 → 2.2.2
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/out/enums.ts +1 -1
- package/out/game.d.ts +2 -5
- package/package.json +9 -7
- package/precomputed/cef.d.ts +24 -0
- package/{out/precomputed → precomputed}/enums.ts +10 -1
- package/precomputed/events.d.ts +234 -0
- package/precomputed/game.d.ts +558 -0
- package/precomputed/local-storage.d.ts +37 -0
- package/precomputed/meta.d.ts +78 -0
- package/precomputed/mp.d.ts +305 -0
- package/precomputed/voice-chat.d.ts +86 -0
- package/out/mp.d.ts +0 -8
- package/out/precomputed/cef.d.ts +0 -5
- package/out/precomputed/events.d.ts +0 -40
- package/out/precomputed/game.d.ts +0 -252
- package/out/precomputed/local-storage.d.ts +0 -9
- package/out/precomputed/meta.d.ts +0 -18
- package/out/precomputed/mp.d.ts +0 -139
- package/out/precomputed/voice-chat.d.ts +0 -23
- /package/{out/precomputed → precomputed}/discord.d.ts +0 -0
- /package/{out/precomputed → precomputed}/index.d.ts +0 -0
|
@@ -0,0 +1,558 @@
|
|
|
1
|
+
import type * as CyberEnums from '../out/enums';
|
|
2
|
+
import type {
|
|
3
|
+
Box,
|
|
4
|
+
EulerAngles,
|
|
5
|
+
entMorphTargetWeightEntry,
|
|
6
|
+
MpClasses,
|
|
7
|
+
Vector3,
|
|
8
|
+
} from '../out/game';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Extracts the instance type from a class constructor type, or returns the type itself if it is not a constructor.
|
|
12
|
+
* @template T - The type to unwrap.
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
type UnwrapClass<T> = T extends { new (): infer U } ? U : T;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
20
|
+
type AnyFunc = (...args: any[]) => any;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* @internal
|
|
24
|
+
*/
|
|
25
|
+
type SafeMethod<I, M extends keyof I> = I[M] extends AnyFunc ? I[M] : AnyFunc;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Defines a function signature used to completely override a method within a specified game class.
|
|
29
|
+
* The callback receives the instance (`self`), the original arguments, and the original method implementation as the final parameter.
|
|
30
|
+
* @template C - The class name key from `MpClasses`.
|
|
31
|
+
* @template I - The resolved instance type of the class.
|
|
32
|
+
* @template M - The method names available on the class instance.
|
|
33
|
+
*/
|
|
34
|
+
export type OverrideFunction = <
|
|
35
|
+
C extends keyof MpClasses,
|
|
36
|
+
I extends UnwrapClass<MpClasses[C]>,
|
|
37
|
+
M extends keyof I,
|
|
38
|
+
>(
|
|
39
|
+
className: C,
|
|
40
|
+
methodName: M,
|
|
41
|
+
callback: (
|
|
42
|
+
self: I,
|
|
43
|
+
...args: [...Parameters<SafeMethod<I, M>>, origin: SafeMethod<I, M>]
|
|
44
|
+
) => ReturnType<SafeMethod<I, M>>,
|
|
45
|
+
) => void;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Defines a function signature used to observe (hook into) a method within a specified game class.
|
|
49
|
+
* The callback receives the instance (`self`) and the arguments passed to the method.
|
|
50
|
+
* @template C - The class name key from `MpClasses`.
|
|
51
|
+
* @template I - The resolved instance type of the class.
|
|
52
|
+
* @template M - The method names available on the class instance.
|
|
53
|
+
*/
|
|
54
|
+
export type ObserveFunction = <
|
|
55
|
+
C extends keyof MpClasses,
|
|
56
|
+
I extends UnwrapClass<MpClasses[C]>,
|
|
57
|
+
M extends keyof I,
|
|
58
|
+
>(
|
|
59
|
+
className: C,
|
|
60
|
+
methodName: M,
|
|
61
|
+
callback: (self: I, ...args: Parameters<SafeMethod<I, M>>) => void,
|
|
62
|
+
) => void;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Interface for interacting with the game's TweakDB database.
|
|
66
|
+
* TweakDB contains static game data, tweaks, and entity configurations.
|
|
67
|
+
* @category Natives
|
|
68
|
+
*/
|
|
69
|
+
export interface TweakDB {
|
|
70
|
+
/**
|
|
71
|
+
* Retrieves an array of records matching a specific query or record type.
|
|
72
|
+
* @template T - The expected type of the records.
|
|
73
|
+
* @param str - The TweakDB record path or type identifier.
|
|
74
|
+
* @returns An array of matching records.
|
|
75
|
+
*/
|
|
76
|
+
getRecords<T = any>(str: string): T[];
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Retrieves a single record from TweakDB.
|
|
80
|
+
* @template T - The expected type of the record.
|
|
81
|
+
* @param str - The specific TweakDB ID or path string.
|
|
82
|
+
* @returns The requested record.
|
|
83
|
+
*/
|
|
84
|
+
getRecord<T = any>(str: string): T;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Queries TweakDB paths and returns matching entry keys.
|
|
88
|
+
* @param str - The search or query pattern string.
|
|
89
|
+
* @returns An array of matching string IDs.
|
|
90
|
+
*/
|
|
91
|
+
query(str: string): string[];
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Retrieves a "flat" property value directly from TweakDB.
|
|
95
|
+
* @template T - The expected type of the flat property.
|
|
96
|
+
* @param str - The path to the flat property (e.g., "Items.SomeItem.someProperty").
|
|
97
|
+
* @returns The flat property value.
|
|
98
|
+
*/
|
|
99
|
+
getFlat<T = any>(str: string): T;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Overwrites an array flat property in TweakDB and updates the engine immediately.
|
|
103
|
+
* @param str - The path to the flat property.
|
|
104
|
+
* @param arr - The new array of values to assign.
|
|
105
|
+
* @returns `true` if the operation was successful, otherwise `false`.
|
|
106
|
+
*/
|
|
107
|
+
setFlats(str: string, arr: any[]): boolean;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Overwrites a single flat property value in TweakDB and updates the engine immediately.
|
|
111
|
+
* @param str - The path to the flat property.
|
|
112
|
+
* @param obj - The new value to assign.
|
|
113
|
+
* @returns `true` if the operation was successful, otherwise `false`.
|
|
114
|
+
*/
|
|
115
|
+
setFlat(str: string, obj: any): boolean;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Overwrites a flat property value in TweakDB *without* triggering an immediate engine update.
|
|
119
|
+
* Useful when batching multiple TweakDB edits before a manual refresh.
|
|
120
|
+
* @param str - The path to the flat property.
|
|
121
|
+
* @param obj - The new value to assign.
|
|
122
|
+
* @returns `true` if the operation was successful, otherwise `false`.
|
|
123
|
+
*/
|
|
124
|
+
setFlatNoUpdate(str: string, obj: any): boolean;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Forces the engine to re-read and update a specific record from its current TweakDB state.
|
|
128
|
+
* @param str - The path to the record to update.
|
|
129
|
+
* @returns `true` if the update succeeded, otherwise `false`.
|
|
130
|
+
*/
|
|
131
|
+
updateRecord(str: string): boolean;
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Runtime creates a new TweakDB record.
|
|
135
|
+
* @param key - The new record identifier key.
|
|
136
|
+
* @param value - The record blueprint or type definition key.
|
|
137
|
+
* @returns `true` if creation succeeded, otherwise `false`.
|
|
138
|
+
*/
|
|
139
|
+
createRecord(key: string, value: string): boolean;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Custom CyberMP System managing asset deletion maps, and basic spawn configurations.
|
|
144
|
+
* Accessible through `mp.game.ScriptGameInstance.GetMultiplayerSystem()`
|
|
145
|
+
* @category Natives
|
|
146
|
+
*/
|
|
147
|
+
export class MultiplayerSystem {
|
|
148
|
+
/**
|
|
149
|
+
* Removes game object classes (e.g., `GameObject`, `Door`) from the active multiplayer map state.
|
|
150
|
+
* @param objectClassMap - Array of class names from `MpClasses` to clear.
|
|
151
|
+
*/
|
|
152
|
+
DeclareDeletedObjects(objectClassMap: Array<keyof MpClasses>): void;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Removes specific game objects from the network replication map using their unique hash keys.
|
|
156
|
+
* @param objectHashMap - Array of unique entity hashes to delete.
|
|
157
|
+
*/
|
|
158
|
+
DeletedObjectsByUniqueHash(objectHashMap: string[]): void;
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Enables or disables synchronization of default game effects, as defined by the CyberMP platform.
|
|
162
|
+
* @param value - `true` to utilize default synchronization effects, `false` to disable them.
|
|
163
|
+
*/
|
|
164
|
+
UseDefaultEffectsByPlatform(value: boolean): void;
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Sets the initial default coordinate and orientation fallback position when spawning players.
|
|
168
|
+
* @param position - The 3D coordinates vector.
|
|
169
|
+
* @param yaw - The horizontal rotation (yaw angle) in degrees/radians.
|
|
170
|
+
*/
|
|
171
|
+
SetDefaultSpawnPosition(position: Vector3, yaw: number): void;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* System providing status and progression access for the game's loading screen interface.
|
|
176
|
+
* Accessible through `mp.game.ScriptGameInstance.GetLoadingScreenSystem()`
|
|
177
|
+
* @category Natives
|
|
178
|
+
*/
|
|
179
|
+
export class LoadingScreenSystem {
|
|
180
|
+
/**
|
|
181
|
+
* Retrieves the current explicit state of the loading screen lifecycle.
|
|
182
|
+
* @returns The state enum value.
|
|
183
|
+
*/
|
|
184
|
+
GetLoadingScreenState(): CyberEnums.ELoadingScreenState;
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Gets the numeric loading progression factor.
|
|
188
|
+
* @returns A value representing loading progress (from 0 to 100).
|
|
189
|
+
*/
|
|
190
|
+
GetLoadingScreenProgress(): number;
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Callback fired or invoked when the loading screen switches states.
|
|
194
|
+
* @param newState - The new incoming loading screen state enum value.
|
|
195
|
+
*/
|
|
196
|
+
OnLoadingScreenStateChange(newState: CyberEnums.ELoadingScreenState): void;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Core CyberMP Game Interface linking subsystem instances, runtime overrides, using game natives, engine callbacks, and engine utility tasks.
|
|
201
|
+
*/
|
|
202
|
+
export interface MpGame {
|
|
203
|
+
/**
|
|
204
|
+
* The global interface instance for TweakDB manipulation.
|
|
205
|
+
*/
|
|
206
|
+
TweakDB: TweakDB;
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Registers a callback listener tracking real-time keyboard or controller hardware input events.
|
|
210
|
+
* @param callback - Function invoked on keystrokes.
|
|
211
|
+
*/
|
|
212
|
+
onInputKeyEvent(
|
|
213
|
+
callback: (
|
|
214
|
+
action: CyberEnums.EInputAction,
|
|
215
|
+
key: CyberEnums.EInputKey,
|
|
216
|
+
) => void,
|
|
217
|
+
): void;
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* Gets the rendering dimensions of the active screen display.
|
|
221
|
+
* @returns A tuple format containing `[width, height]` in pixels.
|
|
222
|
+
*/
|
|
223
|
+
getDisplayResolution(): [width: number, height: number];
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* Event hook that fires immediately when the underlying game session finishes initial loading structures.
|
|
227
|
+
* @param callback - Execution callback.
|
|
228
|
+
*/
|
|
229
|
+
onGameLoaded(callback: () => void): void;
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Event hook that fires specifically when tweaks and TweakDB engine patches are loaded and safe to manipulate.
|
|
233
|
+
* @param callback - Execution callback.
|
|
234
|
+
*/
|
|
235
|
+
onTweak(callback: () => void): void;
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Event hook triggered during early initialization phase of the modding script runtime container.
|
|
239
|
+
* @param callback - Execution callback.
|
|
240
|
+
*/
|
|
241
|
+
onInit(callback: () => void): void;
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Event hook that triggers immediately after the local user's player character object spawns in the world space.
|
|
245
|
+
* @param callback - Execution callback.
|
|
246
|
+
*/
|
|
247
|
+
onLocalPlayerSpawned(callback: () => void): void;
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Resolves and fetches an engine singleton class reference safely.
|
|
251
|
+
* @template T - The specific key class identifier inside `MpClasses`.
|
|
252
|
+
* @param name - The name identifier string of the singleton.
|
|
253
|
+
* @returns The active unwrapped instance object of that designated class.
|
|
254
|
+
*/
|
|
255
|
+
getSingleton<T extends keyof MpClasses>(name: T): UnwrapClass<MpClasses[T]>;
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* Directly injects or appends an item template into the player's primary inventory framework.
|
|
259
|
+
* @param itemName - The specific TweakDB string ID of the item.
|
|
260
|
+
* @param count - Total item quantity stack to add.
|
|
261
|
+
*/
|
|
262
|
+
AddToInventory(itemName: string, count: number): void;
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* Converts a plaintext string model or path identifier name directly into a stable 64-bit unsigned hash representation.
|
|
266
|
+
* @param name - Raw item asset or TweakDB blueprint name path string.
|
|
267
|
+
* @param type - Parsing method mode targeting either a TweakDB path reference (`tweakdbid`) or an internal engine CName string hash (`cname`).
|
|
268
|
+
* @returns The calculated hash string value.
|
|
269
|
+
*/
|
|
270
|
+
getHashFromName(name: string, type: 'tweakdbid' | 'cname'): string;
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* Fully replaces a targeted class method with custom script logic.
|
|
274
|
+
* @see {@link OverrideFunction}
|
|
275
|
+
*/
|
|
276
|
+
override: OverrideFunction;
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* Hooks an observation callback that runs immediately **after** the target native class method executes.
|
|
280
|
+
* @see {@link ObserveFunction}
|
|
281
|
+
*/
|
|
282
|
+
observeAfter: ObserveFunction;
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* Hooks an observation callback that runs immediately **before** the target native class method executes.
|
|
286
|
+
* @see {@link ObserveFunction}
|
|
287
|
+
*/
|
|
288
|
+
observeBefore: ObserveFunction;
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* Standard alias hook pointing to {@link observeBefore}. Evaluates logic prior to core target execution.
|
|
292
|
+
* @see {@link ObserveFunction}
|
|
293
|
+
*/
|
|
294
|
+
observe: ObserveFunction;
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* Observes a method inside a selected class after execution. Can only invoke methods native to {@link MpGame}.
|
|
298
|
+
* Should be used when it is crucial for performance that the function executes as fast as V8 allows.
|
|
299
|
+
* @see {@link ObserveFunction}
|
|
300
|
+
*/
|
|
301
|
+
observeAfterRaw: ObserveFunction;
|
|
302
|
+
|
|
303
|
+
/**
|
|
304
|
+
* Observes a method inside a selected class before execution. Can only invoke methods native to {@link MpGame}.
|
|
305
|
+
* Should be used when it is crucial for performance that the function executes as fast as V8 allows.
|
|
306
|
+
* @see {@link ObserveFunction}
|
|
307
|
+
*/
|
|
308
|
+
observeBeforeRaw: ObserveFunction;
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* Standard alias hook pointing to {@link observeBeforeRaw}. Evaluates high-performance raw logic prior to execution.
|
|
312
|
+
* @see {@link ObserveFunction}
|
|
313
|
+
*/
|
|
314
|
+
observeRaw: ObserveFunction;
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* Serializes a JavaScript runtime payload object structural value into a native engine container format (`Variant`).
|
|
318
|
+
* @template R - The expected return typing output blueprint shape.
|
|
319
|
+
* @param obj - Target entity object structure to convert.
|
|
320
|
+
* @param str - Native structural reflection mapping blueprint name string.
|
|
321
|
+
* @returns The wrapped engine reference asset layout structure.
|
|
322
|
+
*/
|
|
323
|
+
toVariant<R = Record<string, unknown>>(obj: any, str: string): R;
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* Deserializes a native engine container structure layout (`Variant`) back into raw accessible JavaScript object values.
|
|
327
|
+
* @template R - The expected target JavaScript shape format.
|
|
328
|
+
* @param obj - Variant payload container input from the game engine.
|
|
329
|
+
* @returns The unwrapped JavaScript object structure data.
|
|
330
|
+
*/
|
|
331
|
+
fromVariant<R = any>(obj: any): R;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* Extended by CyberMP `inkISystemRequestsHandler` class
|
|
336
|
+
* @category Natives
|
|
337
|
+
*/
|
|
338
|
+
export interface extended__inkISystemRequestsHandler {
|
|
339
|
+
/**
|
|
340
|
+
* Forces the UI context architecture to navigate back out into the main landing splash screen.
|
|
341
|
+
*/
|
|
342
|
+
StartMainMenu(): void;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
/**
|
|
346
|
+
* Extended by CyberMP `entEntity` class
|
|
347
|
+
* @category Natives
|
|
348
|
+
*/
|
|
349
|
+
interface extended__entEntity {
|
|
350
|
+
/**
|
|
351
|
+
* Obtains lists specifying explicit weight indexes controlling facial custom blendshapes or structural targets.
|
|
352
|
+
* @returns Array listing mesh blend weights structures.
|
|
353
|
+
*/
|
|
354
|
+
GetMorphWeights(): entMorphTargetWeightEntry[];
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* Forces the entity container model frame structural layers to assemble and update via selected visual components arrays.
|
|
358
|
+
* @param arr - List containing components structures to attach.
|
|
359
|
+
*/
|
|
360
|
+
ReassembleWithComponents(arr: entIComponent[]): void;
|
|
361
|
+
|
|
362
|
+
/**
|
|
363
|
+
* Teleports a physical game object / Pedestrian directly to specific vector coordinates.
|
|
364
|
+
* @param position - Target 3D destination coordinate vector.
|
|
365
|
+
* @param rotation - Optional Euler orientation layout coordinates (Pitch, Roll, Yaw).
|
|
366
|
+
*/
|
|
367
|
+
TeleportPed(position: Vector3, rotation?: EulerAngles): void;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
/**
|
|
371
|
+
* Extended by CyberMP `gameuiICharacterCustomizationSystem` class
|
|
372
|
+
* @category Natives
|
|
373
|
+
*/
|
|
374
|
+
interface extended__gameuiICharacterCustomizationSystem {
|
|
375
|
+
/**
|
|
376
|
+
* Updates player's gender state representation variables directly inside system profiles.
|
|
377
|
+
* @param gender - Target gender enum identifier asset option.
|
|
378
|
+
* @param savedPos - Optional parameter to persist or retain vector frame state context layout positions.
|
|
379
|
+
*/
|
|
380
|
+
SetPlayerGender(gender: CyberEnums.EPlayerGender, savedPos?: boolean): void;
|
|
381
|
+
|
|
382
|
+
/**
|
|
383
|
+
* Callback fired immediately following successful adjustments to player character gender states.
|
|
384
|
+
* @param gender - The incoming target modified gender enumeration value.
|
|
385
|
+
*/
|
|
386
|
+
OnPlayerGenderChanged(gender: CyberEnums.EPlayerGender): void;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
/**
|
|
390
|
+
* Extended by CyberMP `worldWeatherScriptInterface` class
|
|
391
|
+
* @category Natives
|
|
392
|
+
*/
|
|
393
|
+
interface extended__worldWeatherScriptInterface {
|
|
394
|
+
/**
|
|
395
|
+
* Commands the environment engine manager to override active weather profiles.
|
|
396
|
+
* @param weather - The weather enum state or specific profile asset name path string.
|
|
397
|
+
* @param blendTime - Optional transition timeline sequence parameter in seconds.
|
|
398
|
+
* @param priority - Optional overlay layer sorting stack index weight level identifier.
|
|
399
|
+
* @returns `true` if weather override commands executed, otherwise `false`.
|
|
400
|
+
*/
|
|
401
|
+
SetWeather(
|
|
402
|
+
weather: CyberEnums.EWeatherState,
|
|
403
|
+
blendTime?: number,
|
|
404
|
+
priority?: number,
|
|
405
|
+
): boolean;
|
|
406
|
+
|
|
407
|
+
/**
|
|
408
|
+
* Clears ongoing script-driven environmental alterations and returns to automated weather loops.
|
|
409
|
+
* @param forceRestore - Optional flag bypass to drop timelines and clear immediately.
|
|
410
|
+
* @param blendTime - Optional transition timeline layout duration in seconds.
|
|
411
|
+
* @returns `true` if successfully reset, otherwise `false`.
|
|
412
|
+
*/
|
|
413
|
+
ResetWeather(forceRestore?: boolean, blendTime?: number): boolean;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
/**
|
|
417
|
+
* Extended by CyberMP `vehicleBaseObject` class
|
|
418
|
+
* @category Natives
|
|
419
|
+
*/
|
|
420
|
+
interface extended__vehicleBaseObject {
|
|
421
|
+
/**
|
|
422
|
+
* Confirms whether gravity properties are currently influencing the physical vehicle entity.
|
|
423
|
+
* @returns `true` if gravity calculations are active, otherwise `false`.
|
|
424
|
+
*/
|
|
425
|
+
HasGravity(): boolean;
|
|
426
|
+
|
|
427
|
+
/**
|
|
428
|
+
* Enables or disables physics engine gravity forces on this vehicle.
|
|
429
|
+
* @param enable - `true` to apply normal downforce gravity, `false` to disable.
|
|
430
|
+
* @returns `true` if state adjusted successfully.
|
|
431
|
+
*/
|
|
432
|
+
EnableGravity(enable: boolean): boolean;
|
|
433
|
+
|
|
434
|
+
/**
|
|
435
|
+
* Imparts instantaneous raw linear velocity vector impulses into the structural entity coordinates frame.
|
|
436
|
+
* @param velocity - Linear velocity vector forces factor.
|
|
437
|
+
* @param angularVelocity - Angular momentum spinning forces vector.
|
|
438
|
+
* @returns `true` if impulse registers onto object layers.
|
|
439
|
+
*/
|
|
440
|
+
AddLinelyVelocity(velocity: Vector3, angularVelocity: Vector3): boolean;
|
|
441
|
+
|
|
442
|
+
/**
|
|
443
|
+
* Explicitly sets or resets the exact speed vectors tracking ongoing object momentum.
|
|
444
|
+
* @param velocity - Target directional speed vector values coordinates.
|
|
445
|
+
* @param angularVelocity - Target rotational angular values coordinates.
|
|
446
|
+
* @param switchIndex - Index configuration selection identifier flag.
|
|
447
|
+
* @returns `true` if velocity state fields successfully updated.
|
|
448
|
+
*/
|
|
449
|
+
ChangeLinelyVelocity(
|
|
450
|
+
velocity: Vector3,
|
|
451
|
+
angularVelocity: Vector3,
|
|
452
|
+
switchIndex: number,
|
|
453
|
+
): boolean;
|
|
454
|
+
|
|
455
|
+
/**
|
|
456
|
+
* Retrieves the ongoing linear velocity vectors representing forward/lateral speed momentum.
|
|
457
|
+
* @returns Directional speed coordinate matrix vector tracking values.
|
|
458
|
+
*/
|
|
459
|
+
GetVelocity(): Vector3;
|
|
460
|
+
|
|
461
|
+
/**
|
|
462
|
+
* Retrieves the current rotation speed vector parameters tracking operational values.
|
|
463
|
+
* @returns Rotational velocity tracking data vector.
|
|
464
|
+
*/
|
|
465
|
+
GetAngularVelocity(): Vector3;
|
|
466
|
+
|
|
467
|
+
/**
|
|
468
|
+
* Retrieves the physics engine simulation state mask flags from the object tracking loop.
|
|
469
|
+
* @returns Numeric evaluation bitmask tracking active states.
|
|
470
|
+
*/
|
|
471
|
+
GetPhysicsState(): number;
|
|
472
|
+
|
|
473
|
+
/**
|
|
474
|
+
* Checks whether the vehicle tires or frame base are actively making physical contact with terrain/surfaces.
|
|
475
|
+
* @returns `true` if supported on terrain boundaries, otherwise `false`.
|
|
476
|
+
*/
|
|
477
|
+
IsOnGround(): boolean;
|
|
478
|
+
|
|
479
|
+
/**
|
|
480
|
+
* Retrieves structural bounding box spatial calculation variables for collision tracking.
|
|
481
|
+
* @returns Object bounding structural frame dimensional properties limits.
|
|
482
|
+
*/
|
|
483
|
+
GetBoundaryBox(): Box;
|
|
484
|
+
|
|
485
|
+
/**
|
|
486
|
+
* Callback fired or called manually when the driving authority or network owner ID of this vehicle shifts.
|
|
487
|
+
*/
|
|
488
|
+
VehicleOwnerWasChanged(): void;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
/**
|
|
492
|
+
* Extended by CyberMP `gameMappinSystem` class
|
|
493
|
+
* @category Natives
|
|
494
|
+
*/
|
|
495
|
+
interface extended__gameMappinSystem {
|
|
496
|
+
/**
|
|
497
|
+
* Pins or tracks a UI map indicator landmark tracking profile target pathing point.
|
|
498
|
+
* @param id - Unique mapping ID parameter identifier structure.
|
|
499
|
+
*/
|
|
500
|
+
TrackMappin(id: gameNewMappinID): void;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
import '../out/game';
|
|
504
|
+
|
|
505
|
+
declare module '../out/game' {
|
|
506
|
+
interface worldWeatherScriptInterface {
|
|
507
|
+
SetWeather(
|
|
508
|
+
weather: CyberEnums.EWeatherState,
|
|
509
|
+
blendTime?: number,
|
|
510
|
+
priority?: number,
|
|
511
|
+
): boolean;
|
|
512
|
+
ResetWeather(forceRestore?: boolean, blendTime?: number): boolean;
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
interface vehicleBaseObject extends extended__vehicleBaseObject {}
|
|
516
|
+
|
|
517
|
+
interface gameMappinSystem extends extended__gameMappinSystem {}
|
|
518
|
+
|
|
519
|
+
/**
|
|
520
|
+
* Filter type mapped strictly to extract fields inheriting properties originating from `gameScriptableSystem`.
|
|
521
|
+
* @template T - The baseline target typing mapping block index to scan.
|
|
522
|
+
*/
|
|
523
|
+
type OnlyExtendingScriptableSystem<T> = {
|
|
524
|
+
[K in keyof T as T[K] extends typeof gameScriptableSystem
|
|
525
|
+
? K
|
|
526
|
+
: never]: T[K];
|
|
527
|
+
};
|
|
528
|
+
|
|
529
|
+
interface gameScriptableSystemsContainer<
|
|
530
|
+
Map = OnlyExtendingScriptableSystem<MpClasses>,
|
|
531
|
+
> {
|
|
532
|
+
/**
|
|
533
|
+
* Resolves an isolated structural execution system script framework block instance module by name.
|
|
534
|
+
* @template N - Key matching target extensions inside active scripting layouts.
|
|
535
|
+
* @param systemName - The exact structural name of the requested scriptable system.
|
|
536
|
+
* @returns The active unwrapped instance structure mapping implementation.
|
|
537
|
+
*/
|
|
538
|
+
Get<N extends keyof Map>(systemName: N): UnwrapClass<Map[N]>;
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
namespace ScriptGameInstance {
|
|
542
|
+
export function GetLoadingScreenSystem(): LoadingScreenSystem;
|
|
543
|
+
export function GetMultiplayerSystem(): MultiplayerSystem;
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
interface inkISystemRequestsHandler
|
|
547
|
+
extends extended__inkISystemRequestsHandler {}
|
|
548
|
+
|
|
549
|
+
interface gameuiICharacterCustomizationSystem
|
|
550
|
+
extends extended__gameuiICharacterCustomizationSystem {}
|
|
551
|
+
|
|
552
|
+
interface entEntity extends extended__entEntity {}
|
|
553
|
+
|
|
554
|
+
interface MpClasses {
|
|
555
|
+
LoadingScreenSystem: typeof LoadingScreenSystem;
|
|
556
|
+
MultiplayerSystem: typeof MultiplayerSystem;
|
|
557
|
+
}
|
|
558
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interface providing access to persistent client-side key-value storage.
|
|
3
|
+
* Data saved here remains available across different game sessions and server reconnections.
|
|
4
|
+
*/
|
|
5
|
+
export interface MpLocalStorage {
|
|
6
|
+
/**
|
|
7
|
+
* Associates a string value with a specific key in the storage database.
|
|
8
|
+
* If the key already exists, its value will be overwritten.
|
|
9
|
+
* @param key - The unique identifier name for the storage entry.
|
|
10
|
+
* @param value - The plaintext string data payload to be stored.
|
|
11
|
+
*/
|
|
12
|
+
set(key: string, value: string): void;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Retrieves the stored string value associated with the specified key.
|
|
16
|
+
* @param key - The unique identifier name of the entry to fetch.
|
|
17
|
+
* @returns The stored string value, or an empty string/null if the key does not exist.
|
|
18
|
+
*/
|
|
19
|
+
get(key: string): string;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Permanently removes a specific key-value entry from the storage map.
|
|
23
|
+
* @param key - The unique identifier name of the entry to delete.
|
|
24
|
+
*/
|
|
25
|
+
delete(key: string): void;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Clears all keys and values currently held in this resource's local storage instance.
|
|
29
|
+
*/
|
|
30
|
+
deleteAll(): void;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Explicitly flushes the current state of the in-memory storage data down to the physical disk.
|
|
34
|
+
* Use this to ensure volatile data isn't lost if the game client unexpectedly crashes.
|
|
35
|
+
*/
|
|
36
|
+
save(): void;
|
|
37
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interface managing cross-resource and synchronized state metadata across the network layer.
|
|
3
|
+
* Allows attaching arbitrary data structures to globals, specific players, the local player, or synchronized network entities.
|
|
4
|
+
*/
|
|
5
|
+
export interface MpMeta {
|
|
6
|
+
/**
|
|
7
|
+
* Sets a global metadata value accessible across the entire runtime environment.
|
|
8
|
+
* @param key - The unique identifier string for the metadata entry.
|
|
9
|
+
* @param value - The data payload to store (can be any serializable object or primitive).
|
|
10
|
+
* @param sync - Optional flag. If `true`, synchronizes this metadata across the network to all other clients.
|
|
11
|
+
*/
|
|
12
|
+
setGlobalMeta(key: string, value: any, sync?: boolean): void;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Retrieves a global metadata value by its key.
|
|
16
|
+
* @template T - The expected type of the returned metadata value.
|
|
17
|
+
* @param key - The unique identifier string of the metadata entry to look up.
|
|
18
|
+
* @returns The stored global metadata value cast to type T, or undefined if it does not exist.
|
|
19
|
+
*/
|
|
20
|
+
getGlobalMeta<T = any>(key: string): T;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Assigns a metadata value to a specific remote player using their unique player network ID.
|
|
24
|
+
* @param playerId - The network identification integer of the target player.
|
|
25
|
+
* @param key - The unique identifier string for this player's metadata entry.
|
|
26
|
+
* @param value - The data payload to attach to the player.
|
|
27
|
+
* @param sync - Optional flag. If `true`, syncs this change to all other connected clients over the network.
|
|
28
|
+
*/
|
|
29
|
+
setPlayerMeta(
|
|
30
|
+
playerId: number,
|
|
31
|
+
key: string,
|
|
32
|
+
value: any,
|
|
33
|
+
sync?: boolean,
|
|
34
|
+
): void;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Retrieves a metadata value attached to a specific remote player.
|
|
38
|
+
* @template T - The expected type of the returned metadata value.
|
|
39
|
+
* @param playerId - The network identification integer of the target player.
|
|
40
|
+
* @param key - The unique identifier string of the player's metadata entry.
|
|
41
|
+
* @returns The stored metadata value cast to type T, or undefined if it does not exist.
|
|
42
|
+
*/
|
|
43
|
+
getPlayerMeta<T = any>(playerId: number, key: string): T;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Sets a metadata value restricted or assigned specifically to the local player instance.
|
|
47
|
+
* @param key - The unique identifier string for the local player's metadata entry.
|
|
48
|
+
* @param value - The data payload to store.
|
|
49
|
+
* @param sync - Optional flag. If `true`, relays this local metadata state out to the server and other clients.
|
|
50
|
+
*/
|
|
51
|
+
setLocalPlayerMeta(key: string, value: any, sync?: boolean): void;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Retrieves a metadata value attached specifically to the local player instance.
|
|
55
|
+
* @template T - The expected type of the returned metadata value.
|
|
56
|
+
* @param key - The unique identifier string of the local player's metadata entry.
|
|
57
|
+
* @returns The stored metadata value cast to type T, or undefined if it does not exist.
|
|
58
|
+
*/
|
|
59
|
+
getLocalPlayerMeta<T = any>(key: string): T;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Attaches a metadata state payload to any synchronized network entity (e.g., vehicles, props, peds) using its network ID.
|
|
63
|
+
* @param netId - The network-assigned unique identifier tracking the target entity.
|
|
64
|
+
* @param key - The unique identifier string for the entity's metadata entry.
|
|
65
|
+
* @param value - The data payload to attach to the entity.
|
|
66
|
+
* @param sync - Optional flag. If `true`, synchronizes this entity metadata property to all clients tracking this object.
|
|
67
|
+
*/
|
|
68
|
+
setEntityMeta(netId: number, key: string, value: any, sync?: boolean): void;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Retrieves a metadata value associated with a synchronized network entity.
|
|
72
|
+
* @template T - The expected type of the returned metadata value.
|
|
73
|
+
* @param netId - The network-assigned unique identifier tracking the target entity.
|
|
74
|
+
* @param key - The unique identifier string of the entity's metadata entry.
|
|
75
|
+
* @returns The stored metadata value cast to type T, or undefined if it does not exist.
|
|
76
|
+
*/
|
|
77
|
+
getEntityMeta<T = any>(netId: number, key: string): T;
|
|
78
|
+
}
|