@nativewrappers/server 0.0.167 → 0.0.168
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/entities/Player.d.ts +4 -1
- package/entities/Player.js +7 -1
- package/package.json +1 -1
package/entities/Player.d.ts
CHANGED
|
@@ -33,8 +33,11 @@ export declare class Player {
|
|
|
33
33
|
/**
|
|
34
34
|
* Gets the players ped, this is only ever set once, so subsequent calls will be
|
|
35
35
|
* cached
|
|
36
|
+
*
|
|
37
|
+
* Due to the fact that the ped doesn't exist at `playerJoining` this can be
|
|
38
|
+
* `null`
|
|
36
39
|
*/
|
|
37
|
-
get Ped(): Ped;
|
|
40
|
+
get Ped(): Ped | null;
|
|
38
41
|
get Tokens(): string[];
|
|
39
42
|
get Identifiers(): string[];
|
|
40
43
|
get Endpoint(): string;
|
package/entities/Player.js
CHANGED
|
@@ -61,10 +61,16 @@ class Player {
|
|
|
61
61
|
/**
|
|
62
62
|
* Gets the players ped, this is only ever set once, so subsequent calls will be
|
|
63
63
|
* cached
|
|
64
|
+
*
|
|
65
|
+
* Due to the fact that the ped doesn't exist at `playerJoining` this can be
|
|
66
|
+
* `null`
|
|
64
67
|
*/
|
|
65
68
|
get Ped() {
|
|
66
69
|
if (!this.ped) {
|
|
67
|
-
|
|
70
|
+
const ped = GetPlayerPed(this.source);
|
|
71
|
+
if (ped !== 0) {
|
|
72
|
+
this.ped = new Ped(GetPlayerPed(this.source));
|
|
73
|
+
}
|
|
68
74
|
}
|
|
69
75
|
return this.ped;
|
|
70
76
|
}
|