@nativewrappers/fivem 0.0.1 → 0.0.4
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/lib/client/utils/Animations.d.ts +4 -1
- package/lib/server/Events.d.ts +0 -20
- package/lib/server/Events.js +0 -23
- package/lib/server/Game.d.ts +3 -34
- package/lib/server/Game.js +3 -34
- package/lib/server/cfx/StateBagChangeHandler.d.ts +0 -6
- package/lib/server/cfx/StateBagChangeHandler.js +0 -3
- package/lib/server/entities/BaseEntity.d.ts +0 -73
- package/lib/server/entities/BaseEntity.js +0 -73
- package/lib/server/entities/Entity.d.ts +0 -13
- package/lib/server/entities/Entity.js +0 -13
- package/lib/server/entities/Ped.d.ts +1 -61
- package/lib/server/entities/Ped.js +1 -61
- package/lib/server/entities/Player.d.ts +2 -101
- package/lib/server/entities/Player.js +2 -101
- package/lib/server/entities/Prop.d.ts +1 -20
- package/lib/server/entities/Prop.js +1 -20
- package/lib/server/entities/Vehicle.d.ts +1 -165
- package/lib/server/entities/Vehicle.js +1 -165
- package/lib/server/type/Anticheat.d.ts +0 -318
- package/lib/server/type/Anticheat.js +0 -159
- package/lib/server/type/Hash.d.ts +0 -2
- package/lib/server/type/Hash.js +0 -1
- package/package.json +1 -1
|
@@ -1,121 +1,61 @@
|
|
|
1
1
|
import { ClassTypes } from '../enum/ClassTypes';
|
|
2
2
|
import { BaseEntity } from './BaseEntity';
|
|
3
|
-
/** @extends BaseEntity */
|
|
4
3
|
export class Ped extends BaseEntity {
|
|
5
4
|
constructor(handle) {
|
|
6
5
|
super(handle);
|
|
7
|
-
/**
|
|
8
|
-
* @protected
|
|
9
|
-
* @default import("/home/skaggs/projects/fivem/server/src/enum/ClassTypes").ClassTypes.Ped
|
|
10
|
-
*/
|
|
11
6
|
this.type = ClassTypes.Ped;
|
|
12
7
|
}
|
|
13
8
|
/**
|
|
14
9
|
* Get an interable list of peds currently on the server
|
|
15
|
-
* @
|
|
16
|
-
* @static
|
|
17
|
-
* @returns {IterableIterator<Ped>} Iterable list of Peds.
|
|
10
|
+
* @returns Iterable list of Peds.
|
|
18
11
|
*/
|
|
19
12
|
static *AllPeds() {
|
|
20
13
|
for (const pedId of GetAllPeds()) {
|
|
21
14
|
yield new Ped(pedId);
|
|
22
15
|
}
|
|
23
16
|
}
|
|
24
|
-
/**
|
|
25
|
-
* @public
|
|
26
|
-
* @static
|
|
27
|
-
* @param {number} netId
|
|
28
|
-
* @returns {Ped}
|
|
29
|
-
*/
|
|
30
17
|
static fromNetworkId(netId) {
|
|
31
18
|
return new Ped(NetworkGetEntityFromNetworkId(netId));
|
|
32
19
|
}
|
|
33
|
-
/**
|
|
34
|
-
* @public
|
|
35
|
-
* @static
|
|
36
|
-
* @param {number} handle
|
|
37
|
-
* @returns {Ped}
|
|
38
|
-
*/
|
|
39
20
|
static fromHandle(handle) {
|
|
40
21
|
return new Ped(handle);
|
|
41
22
|
}
|
|
42
|
-
/**
|
|
43
|
-
* @public
|
|
44
|
-
*/
|
|
45
23
|
get Armour() {
|
|
46
24
|
return GetPedArmour(this.handle);
|
|
47
25
|
}
|
|
48
|
-
/**
|
|
49
|
-
* @public
|
|
50
|
-
*/
|
|
51
26
|
get CauseOfDeath() {
|
|
52
27
|
return GetPedCauseOfDeath(this.handle);
|
|
53
28
|
}
|
|
54
|
-
/**
|
|
55
|
-
* @public
|
|
56
|
-
*/
|
|
57
29
|
get DesiredHeading() {
|
|
58
30
|
return GetPedDesiredHeading(this.handle);
|
|
59
31
|
}
|
|
60
|
-
/**
|
|
61
|
-
* @public
|
|
62
|
-
*/
|
|
63
32
|
get MaxHealth() {
|
|
64
33
|
return GetPedMaxHealth(this.handle);
|
|
65
34
|
}
|
|
66
|
-
/**
|
|
67
|
-
* @public
|
|
68
|
-
*/
|
|
69
35
|
get TaskCommand() {
|
|
70
36
|
return GetPedScriptTaskCommand(this.handle);
|
|
71
37
|
}
|
|
72
|
-
/**
|
|
73
|
-
* @public
|
|
74
|
-
*/
|
|
75
38
|
get TaskStage() {
|
|
76
39
|
return GetPedScriptTaskStage(this.handle);
|
|
77
40
|
}
|
|
78
|
-
/**
|
|
79
|
-
* @public
|
|
80
|
-
*/
|
|
81
41
|
get LastSourceOfDamage() {
|
|
82
42
|
return GetPedSourceOfDamage(this.handle);
|
|
83
43
|
}
|
|
84
|
-
/**
|
|
85
|
-
* @public
|
|
86
|
-
*/
|
|
87
44
|
get DeathCause() {
|
|
88
45
|
return GetPedCauseOfDeath(this.handle);
|
|
89
46
|
}
|
|
90
|
-
/**
|
|
91
|
-
* @public
|
|
92
|
-
*/
|
|
93
47
|
get Weapon() {
|
|
94
48
|
return GetSelectedPedWeapon(this.handle);
|
|
95
49
|
}
|
|
96
|
-
/**
|
|
97
|
-
* @public
|
|
98
|
-
*/
|
|
99
50
|
get Vehicle() {
|
|
100
51
|
return GetVehiclePedIsIn(this.handle, false);
|
|
101
52
|
}
|
|
102
|
-
/**
|
|
103
|
-
* @public
|
|
104
|
-
*/
|
|
105
53
|
get LastVehicle() {
|
|
106
54
|
return GetVehiclePedIsIn(this.handle, true);
|
|
107
55
|
}
|
|
108
|
-
/**
|
|
109
|
-
* @public
|
|
110
|
-
*/
|
|
111
56
|
get IsPlayer() {
|
|
112
57
|
return IsPedAPlayer(this.handle);
|
|
113
58
|
}
|
|
114
|
-
/**
|
|
115
|
-
* @public
|
|
116
|
-
* @param {number} index
|
|
117
|
-
* @returns {number}
|
|
118
|
-
*/
|
|
119
59
|
specificTaskType(index) {
|
|
120
60
|
return GetPedSpecificTaskType(this.handle, index);
|
|
121
61
|
}
|
|
@@ -4,160 +4,61 @@ import { Vector3 } from '../utils';
|
|
|
4
4
|
import { Ped } from './Ped';
|
|
5
5
|
export declare class Player {
|
|
6
6
|
private readonly source;
|
|
7
|
-
/**
|
|
8
|
-
* @protected
|
|
9
|
-
* @default import("/home/skaggs/projects/fivem/server/src/enum/ClassTypes").ClassTypes.Player
|
|
10
|
-
*/
|
|
11
7
|
protected type: ClassTypes;
|
|
12
8
|
constructor(source: number);
|
|
13
9
|
/**
|
|
14
10
|
* Get an interable list of players currently on the server
|
|
15
|
-
* @
|
|
16
|
-
* @static
|
|
17
|
-
* @returns {IterableIterator<Player>} Iterable list of Players.
|
|
11
|
+
* @returns Iterable list of Players.
|
|
18
12
|
*/
|
|
19
13
|
static AllPlayers(): IterableIterator<Player>;
|
|
20
|
-
/**
|
|
21
|
-
* @public
|
|
22
|
-
*/
|
|
23
14
|
get Exists(): boolean;
|
|
24
|
-
/**
|
|
25
|
-
* @public
|
|
26
|
-
*/
|
|
27
15
|
get Source(): number;
|
|
28
|
-
/**
|
|
29
|
-
* @public
|
|
30
|
-
*/
|
|
31
16
|
get State(): StateBagInterface;
|
|
32
17
|
/**
|
|
33
18
|
* Returns the player source casted as a string
|
|
34
|
-
* @public
|
|
35
19
|
*/
|
|
36
20
|
get Src(): string;
|
|
37
|
-
/**
|
|
38
|
-
* @public
|
|
39
|
-
*/
|
|
40
21
|
get Ped(): Ped;
|
|
41
|
-
/**
|
|
42
|
-
* @public
|
|
43
|
-
*/
|
|
44
22
|
get Tokens(): string[];
|
|
45
|
-
/**
|
|
46
|
-
* @public
|
|
47
|
-
*/
|
|
48
23
|
get Identifiers(): string[];
|
|
49
|
-
/**
|
|
50
|
-
* @public
|
|
51
|
-
*/
|
|
52
24
|
get Endpoint(): string;
|
|
53
|
-
/**
|
|
54
|
-
* @public
|
|
55
|
-
*/
|
|
56
25
|
get CamerRotation(): Vector3;
|
|
57
26
|
/**
|
|
58
27
|
* Returns the time since the last player UDP message
|
|
59
|
-
* @public
|
|
60
28
|
*/
|
|
61
29
|
get LastMessage(): number;
|
|
62
|
-
/**
|
|
63
|
-
* @public
|
|
64
|
-
*/
|
|
65
30
|
get MaxArmour(): number;
|
|
66
|
-
/**
|
|
67
|
-
* @public
|
|
68
|
-
*/
|
|
69
31
|
get MaxHealth(): number;
|
|
70
|
-
/**
|
|
71
|
-
* @public
|
|
72
|
-
*/
|
|
73
32
|
get MeleeModifier(): number;
|
|
74
33
|
/**
|
|
75
34
|
* @returns the players name
|
|
76
|
-
* @public
|
|
77
35
|
*/
|
|
78
36
|
get Name(): string;
|
|
79
37
|
/**
|
|
80
|
-
* @
|
|
81
|
-
* @returns {string} the players name with any color code unicode, etc removed, this can lead to there being no name at all
|
|
38
|
+
* @returns the players name with any color code unicode, etc removed, this can lead to there being no name at all
|
|
82
39
|
*/
|
|
83
40
|
filteredName(): string;
|
|
84
41
|
/**
|
|
85
42
|
* @returns the players round trip ping
|
|
86
|
-
* @public
|
|
87
43
|
*/
|
|
88
44
|
get Ping(): number;
|
|
89
45
|
/**
|
|
90
46
|
* @returns the current routhing bucket the player is in, default is 0
|
|
91
|
-
* @public
|
|
92
47
|
*/
|
|
93
48
|
get RoutingBucket(): number;
|
|
94
|
-
/**
|
|
95
|
-
* @public
|
|
96
|
-
*/
|
|
97
49
|
get Team(): number;
|
|
98
|
-
/**
|
|
99
|
-
* @public
|
|
100
|
-
*/
|
|
101
50
|
get WantedPosition(): Vector3;
|
|
102
|
-
/**
|
|
103
|
-
* @public
|
|
104
|
-
*/
|
|
105
51
|
get WantedLevel(): number;
|
|
106
|
-
/**
|
|
107
|
-
* @public
|
|
108
|
-
*/
|
|
109
52
|
get IsEvadingWanted(): boolean;
|
|
110
|
-
/**
|
|
111
|
-
* @public
|
|
112
|
-
*/
|
|
113
53
|
get WeaponDamageModifier(): number;
|
|
114
|
-
/**
|
|
115
|
-
* @public
|
|
116
|
-
*/
|
|
117
54
|
get WeaponDefenseModifier(): number;
|
|
118
|
-
/**
|
|
119
|
-
* @public
|
|
120
|
-
*/
|
|
121
55
|
get WeaponDefenseModifier2(): number;
|
|
122
|
-
/**
|
|
123
|
-
* @public
|
|
124
|
-
*/
|
|
125
56
|
get AirDragMultiplier(): number;
|
|
126
|
-
/**
|
|
127
|
-
* @public
|
|
128
|
-
*/
|
|
129
57
|
get IsUsingSuperJump(): boolean;
|
|
130
|
-
/**
|
|
131
|
-
* @public
|
|
132
|
-
*/
|
|
133
58
|
get IsMuted(): boolean;
|
|
134
|
-
/**
|
|
135
|
-
* @public
|
|
136
|
-
*/
|
|
137
59
|
set IsMuted(isMuted: boolean);
|
|
138
|
-
/**
|
|
139
|
-
* @public
|
|
140
|
-
* @param {string} object
|
|
141
|
-
* @returns {boolean}
|
|
142
|
-
*/
|
|
143
60
|
isAceAllowed(object: string): boolean;
|
|
144
|
-
/**
|
|
145
|
-
* @public
|
|
146
|
-
* @param {boolean} [lastPursuit=false]
|
|
147
|
-
* @returns {number}
|
|
148
|
-
*/
|
|
149
61
|
timeInPersuit(lastPursuit?: boolean): number;
|
|
150
|
-
/**
|
|
151
|
-
* @public
|
|
152
|
-
* @param {string} [reason='No reason specified']
|
|
153
|
-
* @returns {void}
|
|
154
|
-
*/
|
|
155
62
|
drop(reason?: string): void;
|
|
156
|
-
/**
|
|
157
|
-
* @public
|
|
158
|
-
* @param {string} eventName
|
|
159
|
-
* @param {...any} [args]
|
|
160
|
-
* @returns {void}
|
|
161
|
-
*/
|
|
162
63
|
emit(eventName: string, ...args: any[]): void;
|
|
163
64
|
}
|
|
@@ -6,17 +6,11 @@ import { Ped } from './Ped';
|
|
|
6
6
|
export class Player {
|
|
7
7
|
constructor(source) {
|
|
8
8
|
this.source = source;
|
|
9
|
-
/**
|
|
10
|
-
* @protected
|
|
11
|
-
* @default import("/home/skaggs/projects/fivem/server/src/enum/ClassTypes").ClassTypes.Player
|
|
12
|
-
*/
|
|
13
9
|
this.type = ClassTypes.Player;
|
|
14
10
|
}
|
|
15
11
|
/**
|
|
16
12
|
* Get an interable list of players currently on the server
|
|
17
|
-
* @
|
|
18
|
-
* @static
|
|
19
|
-
* @returns {IterableIterator<Player>} Iterable list of Players.
|
|
13
|
+
* @returns Iterable list of Players.
|
|
20
14
|
*/
|
|
21
15
|
static *AllPlayers() {
|
|
22
16
|
const num = GetNumPlayerIndices();
|
|
@@ -24,211 +18,118 @@ export class Player {
|
|
|
24
18
|
yield new Player(parseInt(GetPlayerFromIndex(i)));
|
|
25
19
|
}
|
|
26
20
|
}
|
|
27
|
-
/**
|
|
28
|
-
* @public
|
|
29
|
-
*/
|
|
30
21
|
get Exists() {
|
|
31
22
|
return this.source !== 0;
|
|
32
23
|
}
|
|
33
|
-
/**
|
|
34
|
-
* @public
|
|
35
|
-
*/
|
|
36
24
|
get Source() {
|
|
37
25
|
return this.source;
|
|
38
26
|
}
|
|
39
|
-
/**
|
|
40
|
-
* @public
|
|
41
|
-
*/
|
|
42
27
|
get State() {
|
|
43
28
|
return cfx.Player(this.source).state;
|
|
44
29
|
}
|
|
45
30
|
/**
|
|
46
31
|
* Returns the player source casted as a string
|
|
47
|
-
* @public
|
|
48
32
|
*/
|
|
49
33
|
get Src() {
|
|
50
34
|
return this.source;
|
|
51
35
|
}
|
|
52
|
-
/**
|
|
53
|
-
* @public
|
|
54
|
-
*/
|
|
55
36
|
get Ped() {
|
|
56
37
|
return new Ped(GetPlayerPed(this.Src));
|
|
57
38
|
}
|
|
58
|
-
/**
|
|
59
|
-
* @public
|
|
60
|
-
*/
|
|
61
39
|
get Tokens() {
|
|
62
40
|
return getPlayerTokens(this.source);
|
|
63
41
|
}
|
|
64
|
-
/**
|
|
65
|
-
* @public
|
|
66
|
-
*/
|
|
67
42
|
get Identifiers() {
|
|
68
43
|
return getPlayerIdentifiers(this.source);
|
|
69
44
|
}
|
|
70
|
-
/**
|
|
71
|
-
* @public
|
|
72
|
-
*/
|
|
73
45
|
get Endpoint() {
|
|
74
46
|
return GetPlayerEndpoint(this.Src);
|
|
75
47
|
}
|
|
76
|
-
/**
|
|
77
|
-
* @public
|
|
78
|
-
*/
|
|
79
48
|
get CamerRotation() {
|
|
80
49
|
return Vector3.fromArray(GetPlayerCameraRotation(this.Src));
|
|
81
50
|
}
|
|
82
51
|
/**
|
|
83
52
|
* Returns the time since the last player UDP message
|
|
84
|
-
* @public
|
|
85
53
|
*/
|
|
86
54
|
get LastMessage() {
|
|
87
55
|
return GetPlayerLastMsg(this.Src);
|
|
88
56
|
}
|
|
89
|
-
/**
|
|
90
|
-
* @public
|
|
91
|
-
*/
|
|
92
57
|
get MaxArmour() {
|
|
93
58
|
return GetPlayerMaxArmour(this.Src);
|
|
94
59
|
}
|
|
95
|
-
/**
|
|
96
|
-
* @public
|
|
97
|
-
*/
|
|
98
60
|
get MaxHealth() {
|
|
99
61
|
return GetPlayerMaxHealth(this.Src);
|
|
100
62
|
}
|
|
101
|
-
/**
|
|
102
|
-
* @public
|
|
103
|
-
*/
|
|
104
63
|
get MeleeModifier() {
|
|
105
64
|
return GetPlayerMeleeWeaponDamageModifier(this.Src);
|
|
106
65
|
}
|
|
107
66
|
/**
|
|
108
67
|
* @returns the players name
|
|
109
|
-
* @public
|
|
110
68
|
*/
|
|
111
69
|
get Name() {
|
|
112
70
|
return GetPlayerName(this.Src);
|
|
113
71
|
}
|
|
114
72
|
/**
|
|
115
|
-
* @
|
|
116
|
-
* @returns {string} the players name with any color code unicode, etc removed, this can lead to there being no name at all
|
|
73
|
+
* @returns the players name with any color code unicode, etc removed, this can lead to there being no name at all
|
|
117
74
|
*/
|
|
118
75
|
filteredName() {
|
|
119
76
|
return cleanPlayerName(this.Name);
|
|
120
77
|
}
|
|
121
78
|
/**
|
|
122
79
|
* @returns the players round trip ping
|
|
123
|
-
* @public
|
|
124
80
|
*/
|
|
125
81
|
get Ping() {
|
|
126
82
|
return GetPlayerPing(this.Src);
|
|
127
83
|
}
|
|
128
84
|
/**
|
|
129
85
|
* @returns the current routhing bucket the player is in, default is 0
|
|
130
|
-
* @public
|
|
131
86
|
*/
|
|
132
87
|
get RoutingBucket() {
|
|
133
88
|
return GetPlayerRoutingBucket(this.Src);
|
|
134
89
|
}
|
|
135
|
-
/**
|
|
136
|
-
* @public
|
|
137
|
-
*/
|
|
138
90
|
get Team() {
|
|
139
91
|
return GetPlayerTeam(this.Src);
|
|
140
92
|
}
|
|
141
|
-
/**
|
|
142
|
-
* @public
|
|
143
|
-
*/
|
|
144
93
|
get WantedPosition() {
|
|
145
94
|
return Vector3.fromArray(GetPlayerWantedCentrePosition(this.Src));
|
|
146
95
|
}
|
|
147
|
-
/**
|
|
148
|
-
* @public
|
|
149
|
-
*/
|
|
150
96
|
get WantedLevel() {
|
|
151
97
|
return GetPlayerWantedLevel(this.Src);
|
|
152
98
|
}
|
|
153
|
-
/**
|
|
154
|
-
* @public
|
|
155
|
-
*/
|
|
156
99
|
get IsEvadingWanted() {
|
|
157
100
|
return IsPlayerEvadingWantedLevel(this.Src);
|
|
158
101
|
}
|
|
159
|
-
/**
|
|
160
|
-
* @public
|
|
161
|
-
*/
|
|
162
102
|
get WeaponDamageModifier() {
|
|
163
103
|
return GetPlayerWeaponDamageModifier(this.Src);
|
|
164
104
|
}
|
|
165
|
-
/**
|
|
166
|
-
* @public
|
|
167
|
-
*/
|
|
168
105
|
get WeaponDefenseModifier() {
|
|
169
106
|
return GetPlayerWeaponDefenseModifier(this.Src);
|
|
170
107
|
}
|
|
171
|
-
/**
|
|
172
|
-
* @public
|
|
173
|
-
*/
|
|
174
108
|
get WeaponDefenseModifier2() {
|
|
175
109
|
return GetPlayerWeaponDefenseModifier_2(this.Src);
|
|
176
110
|
}
|
|
177
|
-
/**
|
|
178
|
-
* @public
|
|
179
|
-
*/
|
|
180
111
|
get AirDragMultiplier() {
|
|
181
112
|
return GetAirDragMultiplierForPlayersVehicle(this.Src);
|
|
182
113
|
}
|
|
183
|
-
/**
|
|
184
|
-
* @public
|
|
185
|
-
*/
|
|
186
114
|
get IsUsingSuperJump() {
|
|
187
115
|
return IsPlayerUsingSuperJump(this.Src);
|
|
188
116
|
}
|
|
189
|
-
/**
|
|
190
|
-
* @public
|
|
191
|
-
*/
|
|
192
117
|
get IsMuted() {
|
|
193
118
|
return MumbleIsPlayerMuted(this.source);
|
|
194
119
|
}
|
|
195
|
-
/**
|
|
196
|
-
* @public
|
|
197
|
-
*/
|
|
198
120
|
set IsMuted(isMuted) {
|
|
199
121
|
MumbleSetPlayerMuted(this.source, isMuted);
|
|
200
122
|
}
|
|
201
|
-
/**
|
|
202
|
-
* @public
|
|
203
|
-
* @param {string} object
|
|
204
|
-
* @returns {boolean}
|
|
205
|
-
*/
|
|
206
123
|
isAceAllowed(object) {
|
|
207
124
|
return IsPlayerAceAllowed(this.Src, object);
|
|
208
125
|
}
|
|
209
|
-
/**
|
|
210
|
-
* @public
|
|
211
|
-
* @param {boolean} [lastPursuit=false]
|
|
212
|
-
* @returns {number}
|
|
213
|
-
*/
|
|
214
126
|
timeInPersuit(lastPursuit = false) {
|
|
215
127
|
return GetPlayerTimeInPursuit(this.Src, lastPursuit);
|
|
216
128
|
}
|
|
217
|
-
/**
|
|
218
|
-
* @public
|
|
219
|
-
* @param {string} [reason='No reason specified']
|
|
220
|
-
* @returns {void}
|
|
221
|
-
*/
|
|
222
129
|
drop(reason = 'No reason specified') {
|
|
223
130
|
DropPlayer(this.Src, reason);
|
|
224
131
|
}
|
|
225
132
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
226
|
-
/**
|
|
227
|
-
* @public
|
|
228
|
-
* @param {string} eventName
|
|
229
|
-
* @param {...any} [args]
|
|
230
|
-
* @returns {void}
|
|
231
|
-
*/
|
|
232
133
|
emit(eventName, ...args) {
|
|
233
134
|
TriggerClientEvent(eventName, this.source, ...args);
|
|
234
135
|
}
|
|
@@ -1,32 +1,13 @@
|
|
|
1
1
|
import { ClassTypes } from '../enum/ClassTypes';
|
|
2
2
|
import { BaseEntity } from './BaseEntity';
|
|
3
|
-
/** @extends BaseEntity */
|
|
4
3
|
export declare class Prop extends BaseEntity {
|
|
5
|
-
/**
|
|
6
|
-
* @protected
|
|
7
|
-
* @default import("/home/skaggs/projects/fivem/server/src/enum/ClassTypes").ClassTypes.Prop
|
|
8
|
-
*/
|
|
9
4
|
protected type: ClassTypes;
|
|
10
5
|
constructor(handle: number);
|
|
11
6
|
/**
|
|
12
7
|
* Get an interable list of props currently on the server
|
|
13
|
-
* @
|
|
14
|
-
* @static
|
|
15
|
-
* @returns {IterableIterator<Prop>} Iterable list of Props.
|
|
8
|
+
* @returns Iterable list of Props.
|
|
16
9
|
*/
|
|
17
10
|
static AllProps(): IterableIterator<Prop>;
|
|
18
|
-
/**
|
|
19
|
-
* @public
|
|
20
|
-
* @static
|
|
21
|
-
* @param {number} netId
|
|
22
|
-
* @returns {Prop}
|
|
23
|
-
*/
|
|
24
11
|
static fromNetworkId(netId: number): Prop;
|
|
25
|
-
/**
|
|
26
|
-
* @public
|
|
27
|
-
* @static
|
|
28
|
-
* @param {number} handle
|
|
29
|
-
* @returns {Prop}
|
|
30
|
-
*/
|
|
31
12
|
static fromHandle(handle: number): Prop;
|
|
32
13
|
}
|
|
@@ -1,41 +1,22 @@
|
|
|
1
1
|
import { ClassTypes } from '../enum/ClassTypes';
|
|
2
2
|
import { BaseEntity } from './BaseEntity';
|
|
3
|
-
/** @extends BaseEntity */
|
|
4
3
|
export class Prop extends BaseEntity {
|
|
5
4
|
constructor(handle) {
|
|
6
5
|
super(handle);
|
|
7
|
-
/**
|
|
8
|
-
* @protected
|
|
9
|
-
* @default import("/home/skaggs/projects/fivem/server/src/enum/ClassTypes").ClassTypes.Prop
|
|
10
|
-
*/
|
|
11
6
|
this.type = ClassTypes.Prop;
|
|
12
7
|
}
|
|
13
8
|
/**
|
|
14
9
|
* Get an interable list of props currently on the server
|
|
15
|
-
* @
|
|
16
|
-
* @static
|
|
17
|
-
* @returns {IterableIterator<Prop>} Iterable list of Props.
|
|
10
|
+
* @returns Iterable list of Props.
|
|
18
11
|
*/
|
|
19
12
|
static *AllProps() {
|
|
20
13
|
for (const prop of GetAllObjects()) {
|
|
21
14
|
yield new Prop(prop);
|
|
22
15
|
}
|
|
23
16
|
}
|
|
24
|
-
/**
|
|
25
|
-
* @public
|
|
26
|
-
* @static
|
|
27
|
-
* @param {number} netId
|
|
28
|
-
* @returns {Prop}
|
|
29
|
-
*/
|
|
30
17
|
static fromNetworkId(netId) {
|
|
31
18
|
return new Prop(NetworkGetEntityFromNetworkId(netId));
|
|
32
19
|
}
|
|
33
|
-
/**
|
|
34
|
-
* @public
|
|
35
|
-
* @static
|
|
36
|
-
* @param {number} handle
|
|
37
|
-
* @returns {Prop}
|
|
38
|
-
*/
|
|
39
20
|
static fromHandle(handle) {
|
|
40
21
|
return new Prop(handle);
|
|
41
22
|
}
|