FivePD API
Interfaces

IEntityService

Responsible for various entity management related tasks.

Methods

SpawnPedAsync

Spawns a ped via RPC natives.

Parameters

NameTypeDescription
modeluintA ped model for the ped to use.
locationVector3A location where the ped will spawn.
headingfloatThe heading the ped will use.
clearAreaboolA boolean value representing whether the area should be cleared.

Returns

NameType
Task<FPed>The spawned ped.

SpawnVehicleAsync

Spawns a vehicle directly on the server.

Parameters

NameTypeDescription
modeluintA ped model for the ped to use.
locationVector3A location where the ped will spawn.
headingfloatThe heading the ped will use.
clearAreaboolA boolean value representing whether the area should be cleared.

Returns

NameType
Task<FVehicle>The spawned vehicle.

SpawnPropAsync

Spawns a prop (object) via RPC natives.

Parameters

NameTypeDescription
modelintA model for the prop to use.
locationVector3A location where the prop will spawn.
clearAreaboolA boolean value representing whether the area should be cleared.

Returns

NameType
Task<Prop>The spawned prop.

GetAllPeds

Gets all peds.

Returns

NameType
List<Ped>A list of all peds.

GetAllFPeds

Gets all peds.

Returns

NameType
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

NameTypeDescription
entityEntityThe entity to use.
rangefloatThe range to use.

Returns

NameType
PedThe 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

NameTypeDescription
entityEntityThe entity to use.
rangefloatThe range to use.

Returns

NameType
FPedThe closest ped.

GetPedsInRangeOfPosition

Gets all peds in range of the specified position.

Parameters

NameTypeDescription
posVector3The position to use.
rangefloatThe range to use.

Returns

NameType
List<Ped>The peds.

GetPedsInRangeOfEntity

Gets all peds in range of the specified entity.

Parameters

NameTypeDescription
entityEntityThe entity to use.
rangefloatThe range to use.

Returns

NameType
List<Ped>The peds.

GetAllVehicles

Gets all vehicles.

Returns

NameType
List<Vehicle>A list of all vehicles.

GetAllFVehicles

Gets all vehicles.

Returns

NameType
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

NameTypeDescription
entityEntityThe entity to use.
rangefloatThe range to use.

Returns

NameType
VehicleThe 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

NameTypeDescription
entityEntityThe entity to use.
rangefloatThe range to use.

Returns

NameType
FVehicleThe closest vehicle.

GetVehiclesInRangeOfPosition

Gets all vehicles in range of the specified position.

Parameters

NameTypeDescription
posVector3The position to use.
rangefloatThe range to use.

Returns

NameType
List<Vehicle>The vehicles.

GetVehiclesInRangeOfEntity

Gets all vehicles in range of the specified entity.

Parameters

NameTypeDescription
entityEntityThe entity to use.
rangefloatThe range to use.

Returns

NameType
List<Vehicle>The vehicles.

GetClosestEntityToPlayerAsync

Gets the closest entity to a player. !! Use this if you need generated data for the closest entity.

Parameters

NameTypeDescription
playerPlayerThe player to use.

Returns

NameType
Task<T>The closest entity.

ClearArea

Deletes all vehicles and peds within the specified radius of the specified entity.

Parameters

NameTypeDescription
posVector3The position to use.
radiusfloatThe radius to use.