@nativewrappers/server 0.0.44

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/Events.d.ts ADDED
@@ -0,0 +1,16 @@
1
+ import { Player } from "./entities/Player";
2
+ export type NetEvent = (player: Player, ...args: any[]) => void;
3
+ export type LocalEvent = (...args: any[]) => void;
4
+ export declare class Events {
5
+ static cancel(): void;
6
+ static wasCanceled(): boolean;
7
+ static get InvokingResource(): string;
8
+ /**
9
+ * An onNet wrapper that properly converts the type into the correct type
10
+ */
11
+ static onNet: (eventName: string, event: NetEvent) => void;
12
+ /**
13
+ * An on wrapper that properly converts the classes
14
+ */
15
+ static on: (eventName: string, event: LocalEvent) => void;
16
+ }
package/Events.js ADDED
@@ -0,0 +1,79 @@
1
+ import { Ped, Prop, Vehicle, Entity } from "./entities";
2
+ import { Player } from "./entities/Player";
3
+ import { ClassTypes } from "../common/utils/ClassTypes";
4
+ import { Vector2, Vector3, Vector4 } from "./utils";
5
+ const getClassFromArguments = (...args) => {
6
+ const newArgs = [];
7
+ for (const arg of args) {
8
+ if (!arg.type) {
9
+ newArgs.push(arg);
10
+ continue;
11
+ }
12
+ switch (arg.type) {
13
+ case ClassTypes.Vector2: {
14
+ newArgs.push(Vector2.fromObject(arg));
15
+ continue;
16
+ }
17
+ case ClassTypes.Vector3: {
18
+ newArgs.push(Vector3.fromObject(arg));
19
+ continue;
20
+ }
21
+ case ClassTypes.Vector4: {
22
+ newArgs.push(Vector4.fromObject(arg));
23
+ continue;
24
+ }
25
+ case ClassTypes.Ped: {
26
+ newArgs.push(Ped.fromNetworkId(arg.handle));
27
+ continue;
28
+ }
29
+ case ClassTypes.Player: {
30
+ newArgs.push(new Player(arg.source));
31
+ continue;
32
+ }
33
+ case ClassTypes.Prop: {
34
+ newArgs.push(Prop.fromNetworkId(arg.handle));
35
+ continue;
36
+ }
37
+ case ClassTypes.Vehicle: {
38
+ newArgs.push(Vehicle.fromNetworkId(arg.netId));
39
+ continue;
40
+ }
41
+ case ClassTypes.Entity: {
42
+ newArgs.push(Entity.fromNetworkId(arg.netId));
43
+ continue;
44
+ }
45
+ default: {
46
+ newArgs.push(arg);
47
+ }
48
+ }
49
+ }
50
+ return newArgs;
51
+ };
52
+ export class Events {
53
+ static cancel() {
54
+ CancelEvent();
55
+ }
56
+ static wasCanceled() {
57
+ return WasEventCanceled();
58
+ }
59
+ static get InvokingResource() {
60
+ return GetInvokingResource();
61
+ }
62
+ /**
63
+ * An onNet wrapper that properly converts the type into the correct type
64
+ */
65
+ static onNet = (eventName, event) => {
66
+ onNet(eventName, (...args) => {
67
+ const ply = new Player(source);
68
+ event(ply, ...getClassFromArguments(...args));
69
+ });
70
+ };
71
+ /**
72
+ * An on wrapper that properly converts the classes
73
+ */
74
+ static on = (eventName, event) => {
75
+ on(eventName, (...args) => {
76
+ event(...getClassFromArguments(...args));
77
+ });
78
+ };
79
+ }
package/Game.d.ts ADDED
@@ -0,0 +1,25 @@
1
+ import { Player } from "./entities/Player";
2
+ export declare abstract class Game {
3
+ static hashCache: Map<string, number>;
4
+ /**
5
+ * Calculate the Jenkins One At A Time (joaat) has from the given string.
6
+ *
7
+ * @param input The input string to calculate the hash
8
+ */
9
+ static generateHash(input: string): number;
10
+ /**
11
+ * Gets how many milliseconds the game has been open this session
12
+ */
13
+ static get GameTime(): number;
14
+ static get GameBuild(): number;
15
+ static get GameName(): string;
16
+ static registerCommand(name: string, handler: (player: Player, args: any[]) => void, restricted?: boolean): void;
17
+ static get RegisteredCommands(): [{
18
+ name: string;
19
+ }];
20
+ /**
21
+ * Get an iterable list of players currently on the server.
22
+ * @returns Iterable list of Player objects.
23
+ */
24
+ static PlayerList(): IterableIterator<Player>;
25
+ }
package/Game.js ADDED
@@ -0,0 +1,55 @@
1
+ import { Player } from "./entities/Player";
2
+ export class Game {
3
+ // A map containing generated hashes.
4
+ static hashCache = new Map();
5
+ /**
6
+ * Calculate the Jenkins One At A Time (joaat) has from the given string.
7
+ *
8
+ * @param input The input string to calculate the hash
9
+ */
10
+ static generateHash(input) {
11
+ if (typeof input === "undefined") {
12
+ return 0;
13
+ }
14
+ const _hash = this.hashCache.get(input);
15
+ if (_hash)
16
+ return _hash;
17
+ const hash = GetHashKey(input);
18
+ this.hashCache.set(input, hash);
19
+ return hash;
20
+ }
21
+ /**
22
+ * Gets how many milliseconds the game has been open this session
23
+ */
24
+ static get GameTime() {
25
+ return GetGameTimer();
26
+ }
27
+ static get GameBuild() {
28
+ return GetGameBuildNumber();
29
+ }
30
+ static get GameName() {
31
+ return GetGameName();
32
+ }
33
+ static registerCommand(name,
34
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
35
+ handler, restricted = false) {
36
+ RegisterCommand(name,
37
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
38
+ (source, args) => {
39
+ const player = new Player(parseInt(source));
40
+ handler(player, args);
41
+ }, restricted);
42
+ }
43
+ static get RegisteredCommands() {
44
+ return GetRegisteredCommands();
45
+ }
46
+ /**
47
+ * Get an iterable list of players currently on the server.
48
+ * @returns Iterable list of Player objects.
49
+ */
50
+ static *PlayerList() {
51
+ for (const id of getPlayers()) {
52
+ yield new Player(id);
53
+ }
54
+ }
55
+ }
@@ -0,0 +1,3 @@
1
+ export interface StateBagChangeHandler<T> {
2
+ (bagName: string, key: string, value: T, reserved: number, replicated: boolean): void;
3
+ }
@@ -0,0 +1 @@
1
+ export {};
package/cfx/index.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ export { StateBagChangeHandler } from "./StateBagChangeHandler";
2
+ declare const _default: {
3
+ Entity: typeof Entity;
4
+ Player: typeof Player;
5
+ };
6
+ export default _default;
package/cfx/index.js ADDED
@@ -0,0 +1 @@
1
+ export default { Entity, Player };
@@ -0,0 +1,47 @@
1
+ import { ClassTypes } from "../../common/utils/ClassTypes";
2
+ import { eEntityType } from "../enum/eEntityType";
3
+ import { PopulationType } from "../enum/PopulationType";
4
+ import { Hash } from "../type/Hash";
5
+ import { Vector4 } from "../utils";
6
+ import { Vector3 } from "../utils";
7
+ export declare class BaseEntity {
8
+ protected handle: number;
9
+ protected type: ClassTypes;
10
+ constructor(handle: number);
11
+ static fromNetworkId(networkId: number): BaseEntity | null;
12
+ static fromStateBagName(stateBagName: string): BaseEntity | null;
13
+ get State(): StateBagInterface;
14
+ get Handle(): number;
15
+ get Owner(): number;
16
+ get FirstOwner(): number;
17
+ get Exists(): boolean;
18
+ /**
19
+ * @returns the entity that the calling entity is attached to, or null if
20
+ * there is none
21
+ */
22
+ get AttachedTo(): BaseEntity | null;
23
+ get Position(): Vector3;
24
+ get Heading(): number;
25
+ get PositionAndHeading(): Vector4;
26
+ get Health(): number;
27
+ get MaxHealth(): number;
28
+ get Model(): Hash;
29
+ get PopulationType(): PopulationType;
30
+ get Rotation(): Vector3;
31
+ get RotationVelocity(): Vector3;
32
+ get RoutingBucket(): number;
33
+ /**
34
+ * @returns The script that made the entity
35
+ */
36
+ get Script(): string;
37
+ get Speed(): number;
38
+ get Type(): eEntityType;
39
+ /**
40
+ * @returns the entitys velocity, if the entity is a ped it will return Vector3(0, 0, 0)
41
+ */
42
+ get Velocity(): Vector3;
43
+ get IsVisible(): boolean;
44
+ get NetworkId(): number;
45
+ get IsNoLongerNeeded(): boolean;
46
+ delete(): void;
47
+ }
@@ -0,0 +1,113 @@
1
+ import cfx from "../cfx";
2
+ import { ClassTypes } from "../../common/utils/ClassTypes";
3
+ import { Vector4 } from "../utils";
4
+ import { Vector3 } from "../utils";
5
+ export class BaseEntity {
6
+ handle;
7
+ type = ClassTypes.Entity;
8
+ constructor(handle) {
9
+ this.handle = handle;
10
+ }
11
+ static fromNetworkId(networkId) {
12
+ const ent = NetworkGetEntityFromNetworkId(networkId);
13
+ if (ent === 0)
14
+ return null;
15
+ return new BaseEntity(ent);
16
+ }
17
+ static fromStateBagName(stateBagName) {
18
+ const ent = GetEntityFromStateBagName(stateBagName);
19
+ if (ent === 0)
20
+ return null;
21
+ return new BaseEntity(ent);
22
+ }
23
+ get State() {
24
+ return cfx.Entity(this.handle).state;
25
+ }
26
+ get Handle() {
27
+ return this.handle;
28
+ }
29
+ get Owner() {
30
+ return NetworkGetEntityOwner(this.handle);
31
+ }
32
+ get FirstOwner() {
33
+ return NetworkGetFirstEntityOwner(this.handle);
34
+ }
35
+ get Exists() {
36
+ return this.handle !== 0 && DoesEntityExist(this.handle);
37
+ }
38
+ /**
39
+ * @returns the entity that the calling entity is attached to, or null if
40
+ * there is none
41
+ */
42
+ get AttachedTo() {
43
+ const ent = GetEntityAttachedTo(this.handle);
44
+ if (ent === 0)
45
+ return null;
46
+ return new BaseEntity(ent);
47
+ }
48
+ get Position() {
49
+ return Vector3.fromArray(GetEntityCoords(this.handle));
50
+ }
51
+ get Heading() {
52
+ return GetEntityHeading(this.handle);
53
+ }
54
+ get PositionAndHeading() {
55
+ return Vector4.fromArray([
56
+ ...GetEntityCoords(this.handle),
57
+ GetEntityHeading(this.handle),
58
+ ]);
59
+ }
60
+ get Health() {
61
+ return GetEntityHealth(this.handle);
62
+ }
63
+ get MaxHealth() {
64
+ return GetEntityMaxHealth(this.handle);
65
+ }
66
+ get Model() {
67
+ return GetEntityModel(this.handle);
68
+ }
69
+ get PopulationType() {
70
+ return GetEntityPopulationType(this.handle);
71
+ }
72
+ get Rotation() {
73
+ return Vector3.fromArray(GetEntityRotation(this.handle));
74
+ }
75
+ get RotationVelocity() {
76
+ return Vector3.fromArray(GetEntityRotationVelocity(this.handle));
77
+ }
78
+ get RoutingBucket() {
79
+ return GetEntityRoutingBucket(this.handle);
80
+ }
81
+ /**
82
+ * @returns The script that made the entity
83
+ */
84
+ get Script() {
85
+ return GetEntityScript(this.handle);
86
+ }
87
+ get Speed() {
88
+ return GetEntitySpeed(this.handle);
89
+ }
90
+ get Type() {
91
+ return GetEntityType(this.handle);
92
+ }
93
+ /**
94
+ * @returns the entitys velocity, if the entity is a ped it will return Vector3(0, 0, 0)
95
+ */
96
+ get Velocity() {
97
+ return Vector3.fromArray(GetEntityVelocity(this.handle));
98
+ }
99
+ get IsVisible() {
100
+ return IsEntityVisible(this.handle);
101
+ }
102
+ get NetworkId() {
103
+ return NetworkGetNetworkIdFromEntity(this.handle);
104
+ }
105
+ get IsNoLongerNeeded() {
106
+ return HasEntityBeenMarkedAsNoLongerNeeded(this.handle);
107
+ }
108
+ delete() {
109
+ if (this.Exists) {
110
+ DeleteEntity(this.handle);
111
+ }
112
+ }
113
+ }
@@ -0,0 +1,6 @@
1
+ import { BaseEntity } from "./BaseEntity";
2
+ export declare class Entity extends BaseEntity {
3
+ constructor(handle: number);
4
+ static fromNetworkId(netId: number): Entity;
5
+ static fromHandle(handle: number): Entity;
6
+ }
@@ -0,0 +1,12 @@
1
+ import { BaseEntity } from "./BaseEntity";
2
+ export class Entity extends BaseEntity {
3
+ constructor(handle) {
4
+ super(handle);
5
+ }
6
+ static fromNetworkId(netId) {
7
+ return new Entity(NetworkGetEntityFromNetworkId(netId));
8
+ }
9
+ static fromHandle(handle) {
10
+ return new Entity(handle);
11
+ }
12
+ }
@@ -0,0 +1,32 @@
1
+ import { ClassTypes } from "../../common/utils/ClassTypes";
2
+ import { Hash } from "../type/Hash";
3
+ import { BaseEntity } from "./BaseEntity";
4
+ import { Vehicle } from "./Vehicle";
5
+ export declare class Ped extends BaseEntity {
6
+ protected type: ClassTypes;
7
+ constructor(handle: number);
8
+ /**
9
+ * Get an interable list of peds currently on the server
10
+ * @returns Iterable list of Peds.
11
+ */
12
+ static AllPeds(): IterableIterator<Ped>;
13
+ static fromNetworkId(netId: number): Ped | null;
14
+ static fromStateBagName(stateBagName: string): Ped | null;
15
+ static fromSource(source: number): Ped;
16
+ get Armour(): number;
17
+ get CauseOfDeath(): Hash;
18
+ get DesiredHeading(): number;
19
+ get MaxHealth(): number;
20
+ get TaskCommand(): Hash;
21
+ get TaskStage(): number;
22
+ get LastSourceOfDamage(): number;
23
+ get DeathCause(): Hash;
24
+ get Weapon(): Hash;
25
+ /**
26
+ * @returns the current vehicle the ped is in, or null if it doesn't exist
27
+ */
28
+ get CurrentVehicle(): Vehicle | null;
29
+ get LastVehicle(): Vehicle | null;
30
+ get IsPlayer(): boolean;
31
+ getSpecificTaskType(index: number): number;
32
+ }
@@ -0,0 +1,81 @@
1
+ import { ClassTypes } from "../../common/utils/ClassTypes";
2
+ import { BaseEntity } from "./BaseEntity";
3
+ import { Vehicle } from "./Vehicle";
4
+ export class Ped extends BaseEntity {
5
+ type = ClassTypes.Ped;
6
+ constructor(handle) {
7
+ super(handle);
8
+ }
9
+ /**
10
+ * Get an interable list of peds currently on the server
11
+ * @returns Iterable list of Peds.
12
+ */
13
+ static *AllPeds() {
14
+ for (const pedId of GetAllPeds()) {
15
+ yield new Ped(pedId);
16
+ }
17
+ }
18
+ static fromNetworkId(netId) {
19
+ const ent = NetworkGetEntityFromNetworkId(netId);
20
+ if (ent === 0)
21
+ return null;
22
+ return new Ped(ent);
23
+ }
24
+ static fromStateBagName(stateBagName) {
25
+ const handle = GetEntityFromStateBagName(stateBagName);
26
+ if (handle === 0)
27
+ return null;
28
+ return new Ped(handle);
29
+ }
30
+ static fromSource(source) {
31
+ return new Ped(GetPlayerPed(source));
32
+ }
33
+ get Armour() {
34
+ return GetPedArmour(this.handle);
35
+ }
36
+ get CauseOfDeath() {
37
+ return GetPedCauseOfDeath(this.handle);
38
+ }
39
+ get DesiredHeading() {
40
+ return GetPedDesiredHeading(this.handle);
41
+ }
42
+ get MaxHealth() {
43
+ return GetPedMaxHealth(this.handle);
44
+ }
45
+ get TaskCommand() {
46
+ return GetPedScriptTaskCommand(this.handle);
47
+ }
48
+ get TaskStage() {
49
+ return GetPedScriptTaskStage(this.handle);
50
+ }
51
+ get LastSourceOfDamage() {
52
+ return GetPedSourceOfDamage(this.handle);
53
+ }
54
+ get DeathCause() {
55
+ return GetPedCauseOfDeath(this.handle);
56
+ }
57
+ get Weapon() {
58
+ return GetSelectedPedWeapon(this.handle);
59
+ }
60
+ /**
61
+ * @returns the current vehicle the ped is in, or null if it doesn't exist
62
+ */
63
+ get CurrentVehicle() {
64
+ const vehicle = GetVehiclePedIsIn(this.handle, false);
65
+ if (vehicle === 0)
66
+ return null;
67
+ return new Vehicle(vehicle);
68
+ }
69
+ get LastVehicle() {
70
+ const vehicle = GetVehiclePedIsIn(this.handle, false);
71
+ if (vehicle === 0)
72
+ return null;
73
+ return new Vehicle(GetVehiclePedIsIn(this.handle, true));
74
+ }
75
+ get IsPlayer() {
76
+ return IsPedAPlayer(this.handle);
77
+ }
78
+ getSpecificTaskType(index) {
79
+ return GetPedSpecificTaskType(this.handle, index);
80
+ }
81
+ }
@@ -0,0 +1,63 @@
1
+ import { ClassTypes } from "../../common/utils/ClassTypes";
2
+ import { Vector3 } from "../utils";
3
+ import { Ped } from "./Ped";
4
+ export declare class Player {
5
+ private readonly source;
6
+ protected type: ClassTypes;
7
+ constructor(source: number);
8
+ /**
9
+ * Get an interable list of players currently on the server
10
+ * @returns Iterable list of Players.
11
+ */
12
+ static AllPlayers(): IterableIterator<Player>;
13
+ get Exists(): boolean;
14
+ get Source(): number;
15
+ get State(): StateBagInterface;
16
+ /**
17
+ * Returns the player source casted as a string
18
+ */
19
+ get Src(): string;
20
+ get Ped(): Ped;
21
+ get Tokens(): string[];
22
+ get Identifiers(): string[];
23
+ get Endpoint(): string;
24
+ get CamerRotation(): Vector3;
25
+ /**
26
+ * Returns the time since the last player UDP message
27
+ */
28
+ get LastMessage(): number;
29
+ get MaxArmour(): number;
30
+ get MaxHealth(): number;
31
+ get MeleeModifier(): number;
32
+ /**
33
+ * @returns the players name
34
+ */
35
+ get Name(): string;
36
+ /**
37
+ * @returns the players name with any color code unicode, etc removed, this can lead to there being no name at all
38
+ */
39
+ filteredName(): string;
40
+ /**
41
+ * @returns the players round trip ping
42
+ */
43
+ get Ping(): number;
44
+ /**
45
+ * @returns the current routhing bucket the player is in, default is 0
46
+ */
47
+ get RoutingBucket(): number;
48
+ get Team(): number;
49
+ get WantedPosition(): Vector3;
50
+ get WantedLevel(): number;
51
+ get IsEvadingWanted(): boolean;
52
+ get WeaponDamageModifier(): number;
53
+ get WeaponDefenseModifier(): number;
54
+ get WeaponDefenseModifier2(): number;
55
+ get AirDragMultiplier(): number;
56
+ get IsUsingSuperJump(): boolean;
57
+ get IsMuted(): boolean;
58
+ set IsMuted(isMuted: boolean);
59
+ isAceAllowed(object: string): boolean;
60
+ timeInPersuit(lastPursuit?: boolean): number;
61
+ drop(reason?: string): void;
62
+ emit(eventName: string, ...args: any[]): void;
63
+ }
@@ -0,0 +1,136 @@
1
+ import cfx from "../cfx";
2
+ import { ClassTypes } from "../../common/utils/ClassTypes";
3
+ import { cleanPlayerName } from "../utils";
4
+ import { Vector3 } from "../utils";
5
+ import { Ped } from "./Ped";
6
+ export class Player {
7
+ source;
8
+ type = ClassTypes.Player;
9
+ constructor(source) {
10
+ this.source = source;
11
+ }
12
+ /**
13
+ * Get an interable list of players currently on the server
14
+ * @returns Iterable list of Players.
15
+ */
16
+ static *AllPlayers() {
17
+ const num = GetNumPlayerIndices();
18
+ for (let i = 0; i < num; i++) {
19
+ yield new Player(parseInt(GetPlayerFromIndex(i)));
20
+ }
21
+ }
22
+ get Exists() {
23
+ return this.source !== 0;
24
+ }
25
+ get Source() {
26
+ return this.source;
27
+ }
28
+ get State() {
29
+ return cfx.Player(this.source).state;
30
+ }
31
+ /**
32
+ * Returns the player source casted as a string
33
+ */
34
+ get Src() {
35
+ return this.source;
36
+ }
37
+ get Ped() {
38
+ return new Ped(GetPlayerPed(this.Src));
39
+ }
40
+ get Tokens() {
41
+ return getPlayerTokens(this.source);
42
+ }
43
+ get Identifiers() {
44
+ return getPlayerIdentifiers(this.source);
45
+ }
46
+ get Endpoint() {
47
+ return GetPlayerEndpoint(this.Src);
48
+ }
49
+ get CamerRotation() {
50
+ return Vector3.fromArray(GetPlayerCameraRotation(this.Src));
51
+ }
52
+ /**
53
+ * Returns the time since the last player UDP message
54
+ */
55
+ get LastMessage() {
56
+ return GetPlayerLastMsg(this.Src);
57
+ }
58
+ get MaxArmour() {
59
+ return GetPlayerMaxArmour(this.Src);
60
+ }
61
+ get MaxHealth() {
62
+ return GetPlayerMaxHealth(this.Src);
63
+ }
64
+ get MeleeModifier() {
65
+ return GetPlayerMeleeWeaponDamageModifier(this.Src);
66
+ }
67
+ /**
68
+ * @returns the players name
69
+ */
70
+ get Name() {
71
+ return GetPlayerName(this.Src);
72
+ }
73
+ /**
74
+ * @returns the players name with any color code unicode, etc removed, this can lead to there being no name at all
75
+ */
76
+ filteredName() {
77
+ return cleanPlayerName(this.Name);
78
+ }
79
+ /**
80
+ * @returns the players round trip ping
81
+ */
82
+ get Ping() {
83
+ return GetPlayerPing(this.Src);
84
+ }
85
+ /**
86
+ * @returns the current routhing bucket the player is in, default is 0
87
+ */
88
+ get RoutingBucket() {
89
+ return GetPlayerRoutingBucket(this.Src);
90
+ }
91
+ get Team() {
92
+ return GetPlayerTeam(this.Src);
93
+ }
94
+ get WantedPosition() {
95
+ return Vector3.fromArray(GetPlayerWantedCentrePosition(this.Src));
96
+ }
97
+ get WantedLevel() {
98
+ return GetPlayerWantedLevel(this.Src);
99
+ }
100
+ get IsEvadingWanted() {
101
+ return IsPlayerEvadingWantedLevel(this.Src);
102
+ }
103
+ get WeaponDamageModifier() {
104
+ return GetPlayerWeaponDamageModifier(this.Src);
105
+ }
106
+ get WeaponDefenseModifier() {
107
+ return GetPlayerWeaponDefenseModifier(this.Src);
108
+ }
109
+ get WeaponDefenseModifier2() {
110
+ return GetPlayerWeaponDefenseModifier_2(this.Src);
111
+ }
112
+ get AirDragMultiplier() {
113
+ return GetAirDragMultiplierForPlayersVehicle(this.Src);
114
+ }
115
+ get IsUsingSuperJump() {
116
+ return IsPlayerUsingSuperJump(this.Src);
117
+ }
118
+ get IsMuted() {
119
+ return MumbleIsPlayerMuted(this.source);
120
+ }
121
+ set IsMuted(isMuted) {
122
+ MumbleSetPlayerMuted(this.source, isMuted);
123
+ }
124
+ isAceAllowed(object) {
125
+ return IsPlayerAceAllowed(this.Src, object);
126
+ }
127
+ timeInPersuit(lastPursuit = false) {
128
+ return GetPlayerTimeInPursuit(this.Src, lastPursuit);
129
+ }
130
+ drop(reason = "No reason specified") {
131
+ DropPlayer(this.Src, reason);
132
+ }
133
+ emit(eventName, ...args) {
134
+ TriggerClientEvent(eventName, this.source, ...args);
135
+ }
136
+ }