Skip to content

Commit

Permalink
Merge branch 'ragempcommunity:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Kopraa authored Oct 15, 2023
2 parents aebf9ae + 89044a3 commit 5771c83
Show file tree
Hide file tree
Showing 8 changed files with 118 additions and 95 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<a href="https://discord.com/invite/tChBaeu" target="__blank"><img alt="Discord Server" src="https://img.shields.io/discord/183979885788659713?label=discord&color=7289da"></a>
</p>

Remember to 🌟 this Github if you πŸ’– it.
Remember to 🌟 this GitHub if you πŸ’– it.

### πŸ“₯ Installation

Expand Down Expand Up @@ -187,7 +187,7 @@ To contribute to this repository, feel free to create a new fork of the reposito
1. Fork / Clone and select the `main` branch.
2. Create a new branch in your fork.
3. Make your changes.
4. Commit your changes, and push them.
4. Commit your changes and push them.
5. Submit a Pull Request [here](https://github.com/ragempcommunity/ragemp-types/pulls)!

## πŸŽ‰ Thanks
Expand All @@ -197,4 +197,5 @@ To contribute to this repository, feel free to create a new fork of the reposito

## πŸ“‹ License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
This project is licensed under the MIT License β€” see the [LICENSE](LICENSE) file for details.

8 changes: 4 additions & 4 deletions packages/cef/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ interface Mp {

interface EventMpPool {
/**
* This function calls registered Remote Prodecure Call (RPC) from browser to client-side and expects a callback.
* This function calls registered Remote Procedure Call (RPC) from browser to client-side and expects a callback.
*
* @param eventName Client name event you want to call.
* @param args Data you want to send to client.
* @param procName
* @param args Data you want to send to the client.
* @returns Returns a promise
*
* @example
Expand All @@ -25,7 +25,7 @@ interface EventMpPool {
/**
* Adds browser event that can be called from client side
* @param name Event name
* @param args Event arguments
* @param callback
*/
add(name: string, callback: (...args: any[]) => void) : void;
add(names: { [name: string]: (...args: any[]) => void }): void;
Expand Down
6 changes: 3 additions & 3 deletions packages/client/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Remember to 🌟 this Github if you πŸ’– it.
Remember to 🌟 this GitHub if you πŸ’– it.

> This package contains types definitions for RAGE:MP client-side module.
Expand Down Expand Up @@ -43,7 +43,7 @@ To contribute to this repository, feel free to create a new fork of the reposito
1. Fork / Clone and select the `main` branch.
2. Create a new branch in your fork.
3. Make your changes.
4. Commit your changes, and push them.
4. Commit your changes and push them.
5. Submit a Pull Request [here](https://github.com/ragempcommunity/ragemp-types/pulls)!

## πŸŽ‰ Thanks
Expand All @@ -52,4 +52,4 @@ To contribute to this repository, feel free to create a new fork of the reposito

## πŸ“‹ License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
This project is licensed under the MIT License β€” see the [LICENSE](LICENSE) file for details.
4 changes: 2 additions & 2 deletions packages/client/enums/causeOfDeath.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ declare namespace RageEnums.CausesOfDeath {
const enum Key {
WEAPON_ELECTRIC_FENCE = 'weapon_electric_fence',
WEAPON_HIT_BY_WATER_CANNON = 'weapon_hit_by_water_cannon',
/** Death from world after exiting (or being exited from) vehicle (high speed exit/flying out of windscreen) */
/** Death from the world after exiting (or being exited from) vehicle (high-speed exit/flying out of windshield) */
WEAPON_RAMMED_BY_CAR = 'weapon_rammed_by_car',
WEAPON_RUN_OVER_BY_CAR = 'weapon_run_over_by_car',
WEAPON_FALL = 'weapon_fall',
Expand Down Expand Up @@ -143,7 +143,7 @@ declare namespace RageEnums.CausesOfDeath {
const enum Hex {
WEAPON_ELECTRIC_FENCE = 0x92bd4ebb,
WEAPON_HIT_BY_WATER_CANNON = 0xcc34325e,
/** Death from world after exiting (or being exited from) vehicle (high speed exit/flying out of windscreen) */
/** Death from the world after exiting (or being exited from) vehicle (high-speed exit/flying out of windshield) */
WEAPON_RAMMED_BY_CAR = 0x7fc7d7a,
WEAPON_RUN_OVER_BY_CAR = 0xa36d413e,
WEAPON_FALL = 0xcdc174b0,
Expand Down
2 changes: 1 addition & 1 deletion packages/client/game/vehicle.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ declare interface GameVehicleUnk {

declare interface GameVehicle extends GameVehicleLegacy {
/**
* Lets you disable the default engine behaviour (when you enter a vehicle, the player automatically turns on the engine). Setting this to false will stop the player from turning the engine on.
* Lets you disable the default engine behavior (when you enter a vehicle, the player automatically turns on the engine). Setting this to false will stop the player from turning the engine on.
*
* **NOTE**: It is best to set the config flag: [PED_FLAG_STOP_ENGINE_TURNING](https://wiki.rage.mp/index.php?title=Player_Config_Flags) - to ensure the player doesn't attempt to turn the engine resulting in a strange animation.
*/
Expand Down
64 changes: 33 additions & 31 deletions packages/client/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,9 @@ declare class Vector3 {
toArray(): Array3d;

/**
* Normalized copy of a Vector3- one that has the same direction but with a magnitude of 1.
* Normalized copy of a Vector3 that has the same direction but with a magnitude of 1.
*
* @returns Normalized copy of a Vector3- one that has the same direction but with a magnitude of 1.
* @returns Normalized copy of a Vector3 that has the same direction but with a magnitude of 1.
*/
unit(): Vector3;
}
Expand Down Expand Up @@ -355,7 +355,7 @@ declare interface StorageMp {
*
* Data is saved in <path to RAGEMP>/client_resources/<server ip>/.storage
*
* Thus it is wiped when player deletes client folder.
* Thus, it is wiped when player deletes client folder.
*/
data: { [key: string]: any };

Expand Down Expand Up @@ -541,8 +541,7 @@ declare class EntityMp {
};
getRoll(): number;
/**
* @param {number} - Int (specifies which axis rotates before the other axis in a certain order)
*
* @param rotationOrder
* Rotation Orders
* <pre>
* 0: ZYX
Expand Down Expand Up @@ -646,7 +645,7 @@ declare class EntityMp {
setIsTargetPriority(p0: boolean, p1: number): void;
setLights(toggle: boolean): void;
/**
* Loads collision grid for an entity spawned outside of a player's loaded area. This allows peds to execute tasks rather than sit dormant because of a lack of a physics grid.
* Loads collision grid for an entity spawned outside a player's loaded area. This allows peds to execute tasks rather than sit dormant because of a lack of a physics grid.
*
* Certainly not the main usage of this native but when set to true for a Vehicle, it will prevent the vehicle to explode if it is spawned far away from the player.
Expand Down Expand Up @@ -704,7 +703,7 @@ declare class EntityMpPool<T> {
public readonly streamed: T[];

/**
* Gets or sets the maximum amount of streamed entities of a given pool
* Gets or sets the maximum number of streamed entities of a given pool
*/
public maxStreamed: number;

Expand Down Expand Up @@ -734,14 +733,15 @@ declare class EntityMpPool<T> {
* This is important to know, because the client-side entity.id may be different to the entity.id server-side.
*
* @param remoteId Entity remote ID (entity.remoteId)
* @returns An entity with the selected remote ID from a pool, or undefined if entity with this remote ID does not exists.
* @returns An entity with the selected remote ID from a pool,
* or undefined if entity with this remote ID does not exist.
*/
public atRemoteId(remoteId: number): T;

/**
* Used for check, exists entity with ID in pool or not.
*
* @param entity Entity ID or the entity itself, what you wanna check in pool.
* @param entity Entity ID or the entity itself, what you want to check in pool.
*/
public exists(entity: T | number): boolean;

Expand All @@ -753,9 +753,11 @@ declare class EntityMpPool<T> {
public forEach(callingFunction: (entity: T) => void): void;

/**
* Used for calling a function for each element in a pool, but only if it in range of position.
* Used for calling a function for each element in a pool, but only if it is in range of the given position.
*
* @param callingFunction Function, what will be called.
* @param {Vector3} position The position to check range against.
* @param {number} range The range within which the elements should be considered in range of the position.
* @param {function} callingFunction The function that will be called for each element in range.
*/
public forEachInRange(position: Vector3, range: number, callingFunction: (entity: T) => void): void;
public forEachInRange(position: Vector3, range: number, dimension: number, callingFunction: (entity: T) => void): void;
Expand Down Expand Up @@ -822,7 +824,7 @@ declare interface GuiMp {
*
* Accessible in CEF via screenshots:// scheme. (Will be available in 0.4)
*
* You can also use http://screenshots/name.png as a fetcher for your screen shot in CEF
* You can also use http://screenshots/name.png as a fetcher for your screenshot in CEF
*
* @param name Screenshot name
* @param type Type of screenshot (0 - JPG, 1 - PNG, 2 - BMP)
Expand Down Expand Up @@ -2225,7 +2227,7 @@ declare interface PedMpBase extends EntityMp {
declare interface PedMp extends PedMpBase {
spawnPosition: Vector3;
/**
* Returns the player set as the peds controller.
* Returns the player set as the ped's controller.
*/
readonly controller: PlayerMp;

Expand Down Expand Up @@ -2835,32 +2837,32 @@ declare interface VehicleMp extends EntityMp {
* @params wheelId - use 255 to apply all wheel
* @params value
*
*
* @returns void
*/
setWheelCamber(wheelId: number, value: number): void;

/**
* @params wheelId - use 255 to apply all wheel
*
*
* @returns number
*/
getWheelTrackWidth(wheelId: number): number;

/**
* @params wheelId - use 255 to apply all wheel
* @params value
*
*
* @returns void
*/
setWheelTrackWidth(wheelId: number, value: number): void;

/**
* @params wheelId
*
*
* @returns number
*/
getWheelHeight(wheelId: number): number;
Expand All @@ -2869,15 +2871,15 @@ declare interface VehicleMp extends EntityMp {
* @params wheelId - use 255 to apply all wheel
* @params value
*
*
* @returns void
*/
setWheelHeight(wheelId: number, value: number): void;

/**
* @params wheelId
*
*
* @returns number
*/
getTyreWidth(wheelId: number): number;
Expand All @@ -2886,15 +2888,15 @@ declare interface VehicleMp extends EntityMp {
* @params wheelId - use 255 to apply all wheel
* @params value
*
*
* @returns void
*/
setTyreWidth(wheelId: number, value: number): void;

/**
* @params wheelId
*
*
* @returns number
*/
getTyreRadius(wheelId: number): number;
Expand All @@ -2903,15 +2905,15 @@ declare interface VehicleMp extends EntityMp {
* @params wheelId - use 255 to apply all wheel
* @params value
*
*
* @returns void
*/
setTyreRadius(wheelId: number, value: number): void;

/**
* @params wheelId
*
*
* @returns number
*/
getRimRadius(wheelId: number): number;
Expand All @@ -2920,45 +2922,45 @@ declare interface VehicleMp extends EntityMp {
* @params wheelId - use 255 to apply all wheel
* @params value
*
*
* @returns void
*/
setRimRadius(wheelId: number, value: number): void;

/**
*
*
* @returns number
*/
getWheelRadius(): number;

/**
* @params value
*
*
* @returns void
*/
setWheelRadius(value: number): void;

/**
*
*
* @returns number
*/
getWheelWidth(): number;

/**
* @params value
*
*
* @returns void
*/
setWheelWidth(value: number): void;

/**
* @params height
*
*
* @returns void
*/
setSuspensionHeight(height: number): void;
Expand Down Expand Up @@ -3493,4 +3495,4 @@ declare interface Mp {
Vector3: typeof Vector3;
}

declare const mp: Mp;
declare const mp: Mp;
10 changes: 5 additions & 5 deletions packages/server/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Remember to 🌟 this Github if you πŸ’– it.
Remember to 🌟 this GitHub if you πŸ’– it.

> This package contains types definitions for RAGE:MP server-side module.
Expand Down Expand Up @@ -40,7 +40,7 @@ pnpm add -D @ragempcommunity/types-server

### To extend a Mp object, there are 2 ways:

1. By extend the prototype of the object:
1. By extending the prototype of the object:

```ts
mp.Player.prototype.myMethod = function myMethod() {
Expand Down Expand Up @@ -68,7 +68,7 @@ declare global {
export {};
```

2. By extend the object itself:
2. By extending the object itself:

```ts
mp.events.add('playerReady', (player) => {
Expand Down Expand Up @@ -102,7 +102,7 @@ To contribute to this repository, feel free to create a new fork of the reposito
1. Fork / Clone and select the `main` branch.
2. Create a new branch in your fork.
3. Make your changes.
4. Commit your changes, and push them.
4. Commit your changes and push them.
5. Submit a Pull Request [here](https://github.com/ragempcommunity/ragemp-types/pulls)!

## πŸŽ‰ Thanks
Expand All @@ -111,4 +111,4 @@ To contribute to this repository, feel free to create a new fork of the reposito

## πŸ“‹ License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
This project is licensed under the MIT License β€” see the [LICENSE](LICENSE) file for details.
Loading

0 comments on commit 5771c83

Please sign in to comment.