pma-locals 1.0.7 → 1.0.8
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/index.d.ts +2 -1
- package/dist/index.js +6 -3
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -17,10 +17,11 @@ interface PedConfig {
|
|
|
17
17
|
coords: Vector3;
|
|
18
18
|
heading: number;
|
|
19
19
|
spawnDistance: number;
|
|
20
|
+
collisions?: boolean;
|
|
20
21
|
animation?: Animation;
|
|
21
22
|
propData?: Props;
|
|
22
23
|
}
|
|
23
|
-
declare function registerPed(modelName: string, coords: Vector3, heading: number, spawnDistance?: number, animation?: Animation, propData?: Props): void;
|
|
24
|
+
declare function registerPed(modelName: string, coords: Vector3, heading: number, spawnDistance?: number, collisions?: boolean, animation?: Animation, propData?: Props): void;
|
|
24
25
|
declare function processSpawning(playerPos: Vector3): Promise<void>;
|
|
25
26
|
declare function cleanupPeds(): void;
|
|
26
27
|
|
package/dist/index.js
CHANGED
|
@@ -3,12 +3,13 @@ import { createPed, Model, IkControlFlags, createProp } from '@nativewrappers/re
|
|
|
3
3
|
// client/ped-handler.ts
|
|
4
4
|
var pedConfigs = [];
|
|
5
5
|
var activePeds = /* @__PURE__ */ new Map();
|
|
6
|
-
function registerPed(modelName, coords, heading, spawnDistance = 100, animation, propData) {
|
|
6
|
+
function registerPed(modelName, coords, heading, spawnDistance = 100, collisions, animation, propData) {
|
|
7
7
|
pedConfigs.push({
|
|
8
8
|
modelName,
|
|
9
9
|
coords,
|
|
10
10
|
heading,
|
|
11
11
|
spawnDistance,
|
|
12
|
+
collisions,
|
|
12
13
|
animation,
|
|
13
14
|
propData
|
|
14
15
|
});
|
|
@@ -40,7 +41,9 @@ async function spawnPed(config, key) {
|
|
|
40
41
|
SetRandomOutfitVariation(ped.Handle, true);
|
|
41
42
|
ped.IsPositionFrozen = true;
|
|
42
43
|
SetEntityInvincible(ped.Handle, true);
|
|
43
|
-
|
|
44
|
+
if (config.collisions) {
|
|
45
|
+
SetEntityCollision(ped.Handle, false, false);
|
|
46
|
+
}
|
|
44
47
|
SetBlockingOfNonTemporaryEvents(ped.Handle, true);
|
|
45
48
|
if (config.heading) {
|
|
46
49
|
ped.Heading = config.heading;
|
|
@@ -59,7 +62,7 @@ async function spawnPed(config, key) {
|
|
|
59
62
|
}
|
|
60
63
|
let prop = null;
|
|
61
64
|
if (config.propData) {
|
|
62
|
-
prop = await createProp(new Model(config.propData.model), ped.Position, 0,
|
|
65
|
+
prop = await createProp(new Model(config.propData.model), ped.Position, 0, false, true);
|
|
63
66
|
if (prop) {
|
|
64
67
|
AttachEntityToEntity(
|
|
65
68
|
prop.Handle,
|