@nativewrappers/fivem 0.0.24 → 0.0.25

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/client/Game.d.ts CHANGED
@@ -9,6 +9,10 @@ export declare abstract class Game {
9
9
  * @param input The input string to calculate the hash
10
10
  */
11
11
  static generateHash(input: string): number;
12
+ static setLocalPlayerGhosted(isGhosted: boolean, inverseGhost: boolean): void;
13
+ static setGhostAlpha(alpha: number): void;
14
+ static resetGhostAlpha(): void;
15
+ static setGhostingInverted(isInverted: boolean): void;
12
16
  /**
13
17
  * Gets the game language
14
18
  */
package/client/Game.js CHANGED
@@ -19,6 +19,20 @@ export class Game {
19
19
  this.hashCache.set(input, hash);
20
20
  return hash;
21
21
  }
22
+ static setLocalPlayerGhosted(isGhosted, inverseGhost) {
23
+ // @ts-ignore
24
+ SetLocalPlayerAsGhost(isGhosted, inverseGhost);
25
+ }
26
+ static setGhostAlpha(alpha) {
27
+ SetGhostedEntityAlpha(alpha);
28
+ }
29
+ static resetGhostAlpha() {
30
+ ResetGhostedEntityAlpha();
31
+ }
32
+ static setGhostingInverted(isInverted) {
33
+ // actual name is SET_INVERT_GHOSTING
34
+ N_0xd7b6c73cad419bcf(isInverted);
35
+ }
22
36
  /**
23
37
  * Gets the game language
24
38
  */
@@ -37,6 +37,8 @@ export declare class Player {
37
37
  get PvPEnabled(): boolean;
38
38
  set PvPEnabled(value: boolean);
39
39
  get IsDead(): boolean;
40
+ set DisableFiring(value: boolean);
41
+ set Ghosted(isGhosted: boolean);
40
42
  get EntityPlayerIsAimingAt(): BaseEntity | null;
41
43
  get StealthNoise(): number;
42
44
  get FakeWantedLevel(): number;
@@ -90,10 +90,19 @@ export class Player {
90
90
  get IsDead() {
91
91
  return IsPlayerDead(this.handle);
92
92
  }
93
- // Should this even be here?
94
- // public set DisableFiring(value: boolean) {
95
- // DisablePlayerFiring(this.handle, value);
96
- // }
93
+ set DisableFiring(value) {
94
+ DisablePlayerFiring(this.handle, value);
95
+ }
96
+ set Ghosted(isGhosted) {
97
+ // if we're the local player then use the local version of the native
98
+ if (this.Handle === 128) {
99
+ SetLocalPlayerAsGhost(isGhosted);
100
+ }
101
+ else {
102
+ // actual name is SET_REMOTE_PLAYER_AS_GHOST
103
+ SetRelationshipToPlayer(this.handle, isGhosted);
104
+ }
105
+ }
97
106
  get EntityPlayerIsAimingAt() {
98
107
  const [entityHit, entity] = GetEntityPlayerIsFreeAimingAt(this.handle);
99
108
  if (entityHit) {
@@ -124,6 +124,12 @@ export declare class Vehicle extends BaseEntity {
124
124
  set IsBurnoutForced(value: boolean);
125
125
  get IsInBurnout(): boolean;
126
126
  get Driver(): Ped;
127
+ get Ghosted(): boolean;
128
+ set GhostedForGhostPlayers(isGhostedForGhostPlayers: boolean);
129
+ set Ghosted(isGhosted: boolean);
130
+ static set GhostAlpha(alpha: number);
131
+ get IsInGhostCollision(): boolean;
132
+ static resetGhostAlpha(): void;
127
133
  get Occupants(): Ped[];
128
134
  get Passengers(): Ped[];
129
135
  get Doors(): VehicleDoorCollection;
@@ -382,6 +382,29 @@ export class Vehicle extends BaseEntity {
382
382
  get Driver() {
383
383
  return this.getPedOnSeat(VehicleSeat.Driver);
384
384
  }
385
+ // while ghosted use entity index, it doesn't look like you can ghost
386
+ // anything but players and vehicles
387
+ get Ghosted() {
388
+ // actual name is IS_ENTITY_A_GHOST
389
+ return IsEntityGhostedToLocalPlayer(this.handle);
390
+ }
391
+ set GhostedForGhostPlayers(isGhostedForGhostPlayers) {
392
+ // actual name is SET_ENTITY_GHOSTED_FOR_GHOST_PLAYERS
393
+ NetworkSetEntityGhostedWithOwner(this.handle, isGhostedForGhostPlayers);
394
+ }
395
+ set Ghosted(isGhosted) {
396
+ SetNetworkVehicleAsGhost(this.Handle, isGhosted);
397
+ }
398
+ static set GhostAlpha(alpha) {
399
+ SetGhostedEntityAlpha(alpha);
400
+ }
401
+ get IsInGhostCollision() {
402
+ // actual name is IS_ENTITY_IN_GHOST_COLLISION
403
+ return N_0x7ef7649b64d7ff10(this.handle);
404
+ }
405
+ static resetGhostAlpha() {
406
+ ResetGhostedEntityAlpha();
407
+ }
385
408
  get Occupants() {
386
409
  const driver = this.Driver;
387
410
  if (!Ped.exists(driver)) {
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "author": "Remco Troost <d0p3t>",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
- "version": "0.0.24",
7
+ "version": "0.0.25",
8
8
  "publishConfig": {
9
9
  "directory": "lib"
10
10
  },