@infernus/core 0.11.9 → 0.11.10

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/dist/bundle.d.ts CHANGED
@@ -132,7 +132,7 @@ declare enum ObjectMaterialTextSizeEnum {
132
132
  _512x256 = 130,
133
133
  _512x512 = 140
134
134
  }
135
- declare enum ObjectMaterialAlignmmentEnum {
135
+ declare enum ObjectMaterialAlignmentEnum {
136
136
  LEFT = 0,
137
137
  CENTER = 1,
138
138
  RIGHT = 2
@@ -1024,8 +1024,8 @@ declare class Vehicle {
1024
1024
  getHydraReactorAngle(): number;
1025
1025
  getLandingGearState(): number;
1026
1026
  getSirenState(): number;
1027
- getDriver(players: Map<number, Player>): Player | undefined;
1028
- getLastDriver(players: Map<number, Player>): Player | undefined;
1027
+ getDriver(): Player | undefined;
1028
+ getLastDriver(): Player | undefined;
1029
1029
  isSirenEnabled(): boolean;
1030
1030
  toggleSirenEnabled(enabled: boolean): number;
1031
1031
  setParamsSirenState(enabled: boolean): number;
@@ -1932,14 +1932,19 @@ declare const DynamicAreaEvent: Readonly<{
1932
1932
  }) => PromisifyCallbackRet) => () => number | undefined;
1933
1933
  }>;
1934
1934
 
1935
+ interface IInnerPlayerProps {
1936
+ isAndroid: boolean;
1937
+ }
1938
+ declare const innerPlayerProps: unique symbol;
1939
+
1935
1940
  declare class Player {
1936
1941
  readonly id: number;
1942
+ [innerPlayerProps]: IInnerPlayerProps;
1937
1943
  static readonly players: Map<number, Player>;
1938
1944
  static MAX_CHECK_ANDROID_DELAY: number;
1939
1945
  static SKIP_CHECK_ANDROID: boolean;
1940
1946
  private _charset;
1941
1947
  private _locale;
1942
- _isAndroid: boolean;
1943
1948
  lastDrunkLevel: number;
1944
1949
  lastFps: number;
1945
1950
  lastUpdateTick: number;
@@ -2193,6 +2198,88 @@ declare class I18n {
2193
2198
  static convertSpecialChar(input: string): string;
2194
2199
  }
2195
2200
 
2201
+ declare class Npc {
2202
+ static readonly npcs: Map<number, Npc>;
2203
+ private id;
2204
+ private name;
2205
+ private static recordStatus;
2206
+ constructor(name: string);
2207
+ getName(): string;
2208
+ destroy(): this;
2209
+ isValid(): boolean;
2210
+ spawn(): this;
2211
+ setPos(x: number, y: number, z: number): this;
2212
+ setRot(rX: number, rY: number, rZ: number): this;
2213
+ getRot(): {
2214
+ rX: number;
2215
+ rY: number;
2216
+ rZ: number;
2217
+ };
2218
+ setFacingAngle(angle: number): this;
2219
+ getFacingAngle(): number;
2220
+ setVirtualWorld(virtualWorld: number): this;
2221
+ getVirtualWorld(): number;
2222
+ move(targetPosX: number, targetPosY: number, targetPosZ: number, moveType: number, moveSpeed?: number): boolean;
2223
+ stopMove(): this;
2224
+ isMoving(): boolean;
2225
+ setSkin(model: number): this;
2226
+ isStreamedIn(player: Player): boolean;
2227
+ isAnyStreamedIn(): boolean;
2228
+ setInterior(interior: number): this;
2229
+ getInterior(): number;
2230
+ setHealth(health: number): this;
2231
+ getHealth(): number;
2232
+ setArmour(armour: number): this;
2233
+ getArmour(): number;
2234
+ isDead(): boolean;
2235
+ applyAnimation(animLib: string, animName: string, delta: number, loop: boolean, lockX: boolean, lockY: boolean, freeze: boolean, time: number, sync: number): this;
2236
+ setWeapon(weapon: WeaponEnum): this;
2237
+ getWeapon(): WeaponEnum;
2238
+ setAmmo(ammo: number): this;
2239
+ getAmmo(): number;
2240
+ setKeys(upAndDown: number, leftAndDown: number, keys: number): this;
2241
+ getKeys(): {
2242
+ upAndDown: number;
2243
+ leftAndDown: number;
2244
+ keys: number;
2245
+ };
2246
+ setWeaponSkillLevel(skill: WeaponSkillsEnum, level: number): this;
2247
+ getWeaponSkillLevel(skill: WeaponSkillsEnum): number;
2248
+ meleeAttack(time: number, secondaryAttack: boolean): this;
2249
+ stopMeleeAttack(): this;
2250
+ isMeleeAttacking(): boolean;
2251
+ setFightingStyle(style: FightingStylesEnum): this;
2252
+ getFightingStyle(): FightingStylesEnum;
2253
+ enableReloading(enable: boolean): this;
2254
+ isReloadEnabled(): boolean;
2255
+ isReloading(): boolean;
2256
+ enableInfiniteAmmo(enable: boolean): this;
2257
+ isInfiniteAmmoEnabled(): boolean;
2258
+ getWeaponState(): WeaponStatesEnum;
2259
+ setAmmoInClip(ammo: number): this;
2260
+ getAmmoInClip(): number;
2261
+ shoot(weapon: WeaponStatesEnum, hitId: number, hitType: BulletHitTypesEnum, endPointX: number, endPointY: number, endPointZ: number, offsetX: number, offsetY: number, offsetZ: number, isHit: boolean, checkInBetweenFlags: number): this;
2262
+ isShooting(): boolean;
2263
+ aimAt(pointX: number, pointY: number, pointZ: number, shoot: boolean, shootDelay: number, updateAngle: boolean, offsetFromX: number, offsetFromY: number, offsetFromZ: number, checkInBetweenFlags: number): this;
2264
+ aimAtPlayer(player: Player, shoot: boolean, shootDelay: number, updateAngle: boolean, offsetX: number, offsetY: number, offsetZ: number, offsetFromX: number, offsetFromY: number, offsetFromZ: number, checkInBetweenFlags: number): this;
2265
+ stopAim(): this;
2266
+ isAiming(): boolean;
2267
+ isAimingAtPlayer(player: Player): boolean;
2268
+ setWeaponAccuracy(weapon: WeaponEnum, accuracy: number): this;
2269
+ getWeaponAccuracy(weapon: number): number;
2270
+ enterVehicle(vehicle: Vehicle, seatId: number, moveType: number): this;
2271
+ exitVehicle(): this;
2272
+ static readonly connect: (name: string, script: string) => number;
2273
+ static startRecordingPlayerData(player: Player, recordtype: RecordTypesEnum, recordname: string): void;
2274
+ static stopRecordingPlayerData(player: Player): void;
2275
+ static startRecordingPlayback(playbacktype: RecordTypesEnum, recordname: string): void;
2276
+ static stopRecordingPlayback(): void;
2277
+ static pauseRecordingPlayback(): void;
2278
+ static resumeRecordingPlayback(): void;
2279
+ static getInstance(id: number): Npc | undefined;
2280
+ static getInstances(): Npc[];
2281
+ }
2282
+
2196
2283
  declare const NpcEvent: Readonly<{
2197
2284
  onConnect: (cb: (ret: {
2198
2285
  myPlayerId: number;
@@ -2214,10 +2301,6 @@ declare const NpcEvent: Readonly<{
2214
2301
  next: () => CallbackRet;
2215
2302
  defaultValue: boolean | undefined;
2216
2303
  }) => PromisifyCallbackRet) => () => number | undefined;
2217
- onSpawn: (cb: (ret: object & {
2218
- next: () => CallbackRet;
2219
- defaultValue: boolean | undefined;
2220
- }) => PromisifyCallbackRet) => () => number | undefined;
2221
2304
  onClientMessage: (cb: (ret: {
2222
2305
  color: number;
2223
2306
  buffer: number[];
@@ -2226,20 +2309,68 @@ declare const NpcEvent: Readonly<{
2226
2309
  next: () => CallbackRet;
2227
2310
  defaultValue: boolean | undefined;
2228
2311
  }) => PromisifyCallbackRet) => () => number | undefined;
2312
+ onFinishMove: (cb: (ret: {
2313
+ npc: Npc;
2314
+ } & {
2315
+ next: () => CallbackRet;
2316
+ defaultValue: boolean | undefined;
2317
+ }) => PromisifyCallbackRet) => () => number | undefined;
2318
+ onCreate: (cb: (ret: {
2319
+ npc: Npc;
2320
+ } & {
2321
+ next: () => CallbackRet;
2322
+ defaultValue: boolean | undefined;
2323
+ }) => PromisifyCallbackRet) => () => number | undefined;
2324
+ onDestroy: (cb: (ret: {
2325
+ npc: Npc;
2326
+ } & {
2327
+ next: () => CallbackRet;
2328
+ defaultValue: boolean | undefined;
2329
+ }) => PromisifyCallbackRet) => () => number | undefined;
2330
+ onWeaponStateChange: (cb: (ret: {
2331
+ npc: Npc;
2332
+ newState: PlayerStateEnum;
2333
+ oldState: PlayerStateEnum;
2334
+ } & {
2335
+ next: () => CallbackRet;
2336
+ defaultValue: boolean | undefined;
2337
+ }) => PromisifyCallbackRet) => () => number | undefined;
2338
+ onTakeDamage: (cb: (ret: {
2339
+ npc: Npc;
2340
+ damager: Player;
2341
+ damage: number;
2342
+ weapon: WeaponEnum;
2343
+ bodyPart: BodyPartsEnum;
2344
+ } & {
2345
+ next: () => CallbackRet;
2346
+ defaultValue: boolean | undefined;
2347
+ }) => PromisifyCallbackRet) => () => number | undefined;
2348
+ onGiveDamage: (cb: (ret: {
2349
+ npc: Npc;
2350
+ damager: Player;
2351
+ damage: number;
2352
+ weapon: WeaponEnum;
2353
+ bodyPart: BodyPartsEnum;
2354
+ } & {
2355
+ next: () => CallbackRet;
2356
+ defaultValue: boolean | undefined;
2357
+ }) => PromisifyCallbackRet) => () => number | undefined;
2358
+ onDeath: (cb: (ret: {
2359
+ npc: Npc;
2360
+ killer: InvalidEnum.PLAYER_ID | Player;
2361
+ reason: number;
2362
+ } & {
2363
+ next: () => CallbackRet;
2364
+ defaultValue: boolean | undefined;
2365
+ }) => PromisifyCallbackRet) => () => number | undefined;
2366
+ onSpawn: (cb: (ret: {
2367
+ npc: Npc;
2368
+ } & {
2369
+ next: () => CallbackRet;
2370
+ defaultValue: boolean | undefined;
2371
+ }) => PromisifyCallbackRet) => () => number | undefined;
2229
2372
  }>;
2230
2373
 
2231
- declare class Npc {
2232
- private constructor();
2233
- private static recordStatus;
2234
- static readonly connect: (name: string, script: string) => number;
2235
- static startRecordingPlayerData(player: Player, recordtype: RecordTypesEnum, recordname: string): void;
2236
- static stopRecordingPlayerData(player: Player): void;
2237
- static startRecordingPlayback(playbacktype: RecordTypesEnum, recordname: string): void;
2238
- static stopRecordingPlayback(): void;
2239
- static pauseRecordingPlayback(): void;
2240
- static resumeRecordingPlayback(): void;
2241
- }
2242
-
2243
2374
  declare class GameMode {
2244
2375
  private constructor();
2245
2376
  static onInit: (cb: (ret: object & {
@@ -2547,7 +2678,7 @@ declare class TextDraw {
2547
2678
  setOutline(size: number): this;
2548
2679
  setPreviewModel(modelIndex: number): this;
2549
2680
  setPreviewRot(fRotX: number, fRotY: number, fRotZ: number, fZoom?: number): this;
2550
- setPreviewVehColors(color1: string, color2: string): this;
2681
+ setPreviewVehColors(color1: string | number, color2: string | number): this;
2551
2682
  setProportional(set?: boolean): this;
2552
2683
  setSelectable(set: boolean): this;
2553
2684
  setShadow(size: number): this;
@@ -2618,4 +2749,4 @@ declare const getAnimateDurationByLibName: (lib: string, name: string) => number
2618
2749
 
2619
2750
  declare function defineHooks<T extends new (...args: any[]) => any>(target: T): readonly [THookedMethods<T>, <K extends TMethodKeys<InstanceType<T>>>(methodName: K, interceptor: (this: InstanceType<T>, ...args: Parameters<InstanceType<T>[K]>) => ReturnType<InstanceType<T>[K]>) => (this: InstanceType<T>, ...args: Parameters<InstanceType<T>[K]>) => ReturnType<InstanceType<T>[K]>];
2620
2751
 
2621
- export { ArtworkEnum, BodyPartsEnum, BoneIdsEnum, BulletHitTypesEnum, CameraCutStylesEnum, CameraModesEnum, CarModTypeEnum, ClickSourcesEnum, type CmdBusCallback, type CommandErrorRet, type CommandErrorTypes, CommandErrors, ConnectionStatusEnum, DamageDeathReasonEnum, Dialog, DialogStylesEnum, Dynamic3DTextLabel, Dynamic3DTextLabelEvent, DynamicActor, DynamicActorEvent, DynamicArea, DynamicAreaEvent, DynamicCheckPointEvent, DynamicCheckpoint, DynamicMapIcon, DynamicMapIconEvent, DynamicObject, DynamicObjectEvent, DynamicPickup, DynamicPickupEvent, DynamicRaceCP, DynamicRaceCPEvent, ERecordStatus, EditResponseTypesEnum, FightingStylesEnum, ForceSyncEnum, GameMode, GameText, GangZone, type GangZoneCb, GangZoneEvent, type GangZonePos, I18n, type IActorAnimation, type IActorSpawn, type IAnimateInfo, type IAttachedData, type IAttachedObject, type IBounds, type ICheckPoint, type IClientResRaw, type ICmdOptions, type ICommonTextDrawKey, type IDialog, type IDialogFuncQueue, type IDialogResCommon, type IDialogResRaw, type IDialogResResult, type IDynamic, type IDynamic3DTextLabel, type IDynamicActor, type IDynamicAreaKey, type IDynamicCheckPoint, type IDynamicCircle, type IDynamicCircleCommon, type IDynamicCommon, type IDynamicCuboid, type IDynamicCylinder, type IDynamicMapIcon, type IDynamicObject, type IDynamicPickup, type IDynamicPolygon, type IDynamicRaceCp, type IDynamicRectangle, type IDynamicRectangleCommon, type IDynamicSphere, type IFilterScript, type IGangZone, type IMaterial, type IMaterialText, type IObjectPos, type IObjectRotPos, type IOffsets, type IPlayerClass, type IQuat, type IRaceCheckPoint, type ITextDraw, type ITextDrawCommonSize, type ITextDrawRot, type IVehColor, type IVehMatrix, type IVehSpawnInfo, type IVehicle, InvalidEnum, KeysEnum, LimitsEnum, MapIconStylesEnum, MarkerModesEnum, Menu, MenuEvent, NPCPlaybackEnum, NetStats, Npc, NpcEvent, ObjectMaterialAlignmmentEnum, ObjectMaterialTextSizeEnum, Player, PlayerEvent, PlayerStateEnum, RecordTypesEnum, SelectObjectTypesEnum, SpecialActionsEnum, SpectateModesEnum, Streamer, type TCommonCallback, type TDynamicArea, type TDynamicAreaTypes, type TEventFunc, type TEventName, type THookedMethods, type TLocales, type TMethodKeys, type TPos, type TStreamerExtendable, TextDraw, TextDrawAlignEnum, TextDrawEvent, TextDrawFontsEnum, Vehicle, VehicleEvent, VehicleModelInfoEnum, VehicleParamsEnum, WeaponEnum, WeaponSkillsEnum, WeaponStatesEnum, animateLib, defineEvent, defineHooks, getAnimateDurationByLibName, isHolding, isPressed, isPressing, isReleased, isValidAnimateLib, isValidAnimateName, rgba };
2752
+ export { ArtworkEnum, BodyPartsEnum, BoneIdsEnum, BulletHitTypesEnum, CameraCutStylesEnum, CameraModesEnum, CarModTypeEnum, ClickSourcesEnum, type CmdBusCallback, type CommandErrorRet, type CommandErrorTypes, CommandErrors, ConnectionStatusEnum, DamageDeathReasonEnum, Dialog, DialogStylesEnum, Dynamic3DTextLabel, Dynamic3DTextLabelEvent, DynamicActor, DynamicActorEvent, DynamicArea, DynamicAreaEvent, DynamicCheckPointEvent, DynamicCheckpoint, DynamicMapIcon, DynamicMapIconEvent, DynamicObject, DynamicObjectEvent, DynamicPickup, DynamicPickupEvent, DynamicRaceCP, DynamicRaceCPEvent, ERecordStatus, EditResponseTypesEnum, FightingStylesEnum, ForceSyncEnum, GameMode, GameText, GangZone, type GangZoneCb, GangZoneEvent, type GangZonePos, I18n, type IActorAnimation, type IActorSpawn, type IAnimateInfo, type IAttachedData, type IAttachedObject, type IBounds, type ICheckPoint, type IClientResRaw, type ICmdOptions, type ICommonTextDrawKey, type IDialog, type IDialogFuncQueue, type IDialogResCommon, type IDialogResRaw, type IDialogResResult, type IDynamic, type IDynamic3DTextLabel, type IDynamicActor, type IDynamicAreaKey, type IDynamicCheckPoint, type IDynamicCircle, type IDynamicCircleCommon, type IDynamicCommon, type IDynamicCuboid, type IDynamicCylinder, type IDynamicMapIcon, type IDynamicObject, type IDynamicPickup, type IDynamicPolygon, type IDynamicRaceCp, type IDynamicRectangle, type IDynamicRectangleCommon, type IDynamicSphere, type IFilterScript, type IGangZone, type IMaterial, type IMaterialText, type IObjectPos, type IObjectRotPos, type IOffsets, type IPlayerClass, type IQuat, type IRaceCheckPoint, type ITextDraw, type ITextDrawCommonSize, type ITextDrawRot, type IVehColor, type IVehMatrix, type IVehSpawnInfo, type IVehicle, InvalidEnum, KeysEnum, LimitsEnum, MapIconStylesEnum, MarkerModesEnum, Menu, MenuEvent, NPCPlaybackEnum, NetStats, Npc, NpcEvent, ObjectMaterialAlignmentEnum, ObjectMaterialTextSizeEnum, Player, PlayerEvent, PlayerStateEnum, RecordTypesEnum, SelectObjectTypesEnum, SpecialActionsEnum, SpectateModesEnum, Streamer, type TCommonCallback, type TDynamicArea, type TDynamicAreaTypes, type TEventFunc, type TEventName, type THookedMethods, type TLocales, type TMethodKeys, type TPos, type TStreamerExtendable, TextDraw, TextDrawAlignEnum, TextDrawEvent, TextDrawFontsEnum, Vehicle, VehicleEvent, VehicleModelInfoEnum, VehicleParamsEnum, WeaponEnum, WeaponSkillsEnum, WeaponStatesEnum, animateLib, defineEvent, defineHooks, getAnimateDurationByLibName, isHolding, isPressed, isPressing, isReleased, isValidAnimateLib, isValidAnimateName, rgba };