IEntityService
Responsible for various entity management related tasks.
Methods
SpawnPedAsync
Spawns a ped via RPC natives.
Parameters
| Name | Type | Description |
|---|---|---|
| model | uint | A ped model for the ped to use. |
| location | Vector3 | A location where the ped will spawn. |
| heading | float | The heading the ped will use. |
| clearArea | bool | A boolean value representing whether the area should be cleared. |
Returns
| Name | Type |
|---|---|
| Task<FPed> | The spawned ped. |
SpawnVehicleAsync
Spawns a vehicle directly on the server.
Parameters
| Name | Type | Description |
|---|---|---|
| model | uint | A ped model for the ped to use. |
| location | Vector3 | A location where the ped will spawn. |
| heading | float | The heading the ped will use. |
| clearArea | bool | A boolean value representing whether the area should be cleared. |
Returns
| Name | Type |
|---|---|
| Task<FVehicle> | The spawned vehicle. |
SpawnPropAsync
Spawns a prop (object) via RPC natives.
Parameters
| Name | Type | Description |
|---|---|---|
| model | int | A model for the prop to use. |
| location | Vector3 | A location where the prop will spawn. |
| clearArea | bool | A boolean value representing whether the area should be cleared. |
Returns
| Name | Type |
|---|---|
| Task<Prop> | The spawned prop. |
GetAllPeds
Gets all peds.
Returns
| Name | Type |
|---|---|
| List<Ped> | A list of all peds. |
GetAllFPeds
Gets all peds.
Returns
| Name | Type |
|---|---|
| List<FPed> | A list of all peds. |
GetClosestPedToEntity
Gets the closest ped to the specified entity. !! Use this if you do not need generated data for the closest ped.
Parameters
| Name | Type | Description |
|---|---|---|
| entity | Entity | The entity to use. |
| range | float | The range to use. |
Returns
| Name | Type |
|---|---|
| Ped | The closest ped. |
GetClosestFPedToEntity
Gets the closest ped to the specified entity. !! Use this if you do not need generated data for the closest ped.
Parameters
| Name | Type | Description |
|---|---|---|
| entity | Entity | The entity to use. |
| range | float | The range to use. |
Returns
| Name | Type |
|---|---|
| FPed | The closest ped. |
GetPedsInRangeOfPosition
Gets all peds in range of the specified position.
Parameters
| Name | Type | Description |
|---|---|---|
| pos | Vector3 | The position to use. |
| range | float | The range to use. |
Returns
| Name | Type |
|---|---|
| List<Ped> | The peds. |
GetPedsInRangeOfEntity
Gets all peds in range of the specified entity.
Parameters
| Name | Type | Description |
|---|---|---|
| entity | Entity | The entity to use. |
| range | float | The range to use. |
Returns
| Name | Type |
|---|---|
| List<Ped> | The peds. |
GetAllVehicles
Gets all vehicles.
Returns
| Name | Type |
|---|---|
| List<Vehicle> | A list of all vehicles. |
GetAllFVehicles
Gets all vehicles.
Returns
| Name | Type |
|---|---|
| List<FVehicle> | A list of all vehicles. |
GetClosestVehicleToEntity
Gets the closest vehicle to the specified entity. !! Use this if you do not need generated data for the closest vehicle.
Parameters
| Name | Type | Description |
|---|---|---|
| entity | Entity | The entity to use. |
| range | float | The range to use. |
Returns
| Name | Type |
|---|---|
| Vehicle | The closest vehicle. |
GetClosestFVehicleToEntity
Gets the closest vehicle to the specified entity. !! Use this if you do not need generated data for the closest vehicle.
Parameters
| Name | Type | Description |
|---|---|---|
| entity | Entity | The entity to use. |
| range | float | The range to use. |
Returns
| Name | Type |
|---|---|
| FVehicle | The closest vehicle. |
GetVehiclesInRangeOfPosition
Gets all vehicles in range of the specified position.
Parameters
| Name | Type | Description |
|---|---|---|
| pos | Vector3 | The position to use. |
| range | float | The range to use. |
Returns
| Name | Type |
|---|---|
| List<Vehicle> | The vehicles. |
GetVehiclesInRangeOfEntity
Gets all vehicles in range of the specified entity.
Parameters
| Name | Type | Description |
|---|---|---|
| entity | Entity | The entity to use. |
| range | float | The range to use. |
Returns
| Name | Type |
|---|---|
| List<Vehicle> | The vehicles. |
GetClosestEntityToPlayerAsync
Gets the closest entity to a player. !! Use this if you need generated data for the closest entity.
Parameters
| Name | Type | Description |
|---|---|---|
| player | Player | The player to use. |
Returns
| Name | Type |
|---|---|
| Task<T> | The closest entity. |
ClearArea
Deletes all vehicles and peds within the specified radius of the specified entity.
Parameters
| Name | Type | Description |
|---|---|---|
| pos | Vector3 | The position to use. |
| radius | float | The radius to use. |