Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added 'binded' for EventMpPool #72

Merged
merged 1 commit into from
Mar 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 20 additions & 15 deletions packages/server/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -332,20 +332,20 @@ declare class EntityMpPool<T> {
*/
public getClosest(position: Vector3, limit: number): T[];

/**
* Gets the closest set of entities to a position in the defined dimension.
*
* @param position Vector3
* @param dimension The Dimension
* @param limit Limit of results
* @returns Array of entities sorted by distance to given position
*
* @example
* ```
* const [closestVehicle] = mp.vehicles.getClosestInDimension(player.position, player.dimension, 1);
* closestVehicle.locked = true;
* ```
*/
/**
* Gets the closest set of entities to a position in the defined dimension.
*
* @param position Vector3
* @param dimension The Dimension
* @param limit Limit of results
* @returns Array of entities sorted by distance to given position
*
* @example
* ```
* const [closestVehicle] = mp.vehicles.getClosestInDimension(player.position, player.dimension, 1);
* closestVehicle.locked = true;
* ```
*/
public getClosestInDimension(position: Vector3, dimension: number, limit: number): T[];

/**
Expand Down Expand Up @@ -1309,7 +1309,7 @@ declare interface EventMpThis {
declare interface IServerEvents {
entityCreated: (entity: EntityMp) => void;
/*
* @deprecated Broken/Removed in RageMP 1.1 DP1
* @deprecated Broken/Removed in RageMP 1.1 DP1
*/
entityDestroyed: (entity: EntityMp) => void;
entityModelChange: (entity: EntityMp, oldModel: number) => void;
Expand Down Expand Up @@ -1438,6 +1438,11 @@ declare class EventMpPool {
public remove(eventName: string, callback?: (...args: any[]) => void): void;
public remove(eventNames: string[]): void;

/**
* Returns a list of binded events.
*/
readonly binded: { [key: string]: Function }[]

/**
* Resets the whole event manager.
*/
Expand Down