Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
Kopraa committed Apr 7, 2024
2 parents 5f5afc9 + 8b40e8e commit 9a613a5
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 23 deletions.
29 changes: 21 additions & 8 deletions packages/client/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1081,14 +1081,7 @@ declare interface BrowserMp {

declare interface BrowserMpPool extends EntityMpPool<BrowserMp> {
'new'(url: string): BrowserMp;

/**
* Can be used with drawSprite using given texture dictionary, name and height scale multiplier (example 3D CEF with render target)
* @param url URL of the website
* @param width Width in pixels
* @param height Height in pixels
*/
'newHeadless'(url: string, width: number, height: number): BrowserMp;
newHeadless(url: string, width: number, height: number): BrowserMp;
}

declare interface CheckpointMp extends EntityMp {
Expand Down Expand Up @@ -1690,6 +1683,7 @@ declare interface PedMpBase extends EntityMp {
setCanBeKnockedOffVehicle(state: number): void;
setCanBeShotInVehicle(toggle: boolean): void;
setCanBeTargetedWhenInjured(toggle: boolean): void;
setCanLosePropsOnDamage(enable: boolean, p0: number): void;
setCanBeTargetedWithoutLos(toggle: boolean): void;
setCanBeTargetted(toggle: boolean): void;
setCanBeTargettedByPlayer(player: Handle, toggle: boolean): void;
Expand Down Expand Up @@ -2996,6 +2990,25 @@ declare interface VehicleMp extends EntityMp {
*/
setSuspensionHeight(height: number): void;

/**
*
* Available on 11_test_1102_eXzHpHrWd2UfgUhdau6PDVJ88GG5aQY3 branch
*/

breakOffWheel(wheelId: number, deleteMapObject: boolean): void;
fixWheel(wheelId: number): void;
isWheelBrokenOff(wheelId: number): boolean;

// Use vehicle.isBumperBrokenOff() to get current state
breakOffBumper(front: boolean, deleteMapObject: boolean): void;
fixBumper(front: boolean): void;

// Forces remote vehicles broken wheels map object removal
deleteBrokenWheelObjects: boolean;
// Forces remote vehicles generic broken parts map object removal, i.e. parts not specified separately
deleteBrokenPartObjects: boolean;
// Forces remote vehicles broken vehicle door map object removal
deleteBrokenDoorObjects: boolean;
}

declare interface VehicleMpPool extends EntityMpPool<VehicleMp> {
Expand Down
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

0 comments on commit 9a613a5

Please sign in to comment.