FivePD API
Interfaces

IUnitManagerService

A service for managing units.

Methods

GetPlayerUnit

Gets the unit of the specified player.

Parameters

NameTypeDescription
playerFPlayerA player.

Returns

NameType
UnitThe unit of the player.

AddPlayerToUnit

Adds the player to the given unit.

Parameters

NameTypeDescription
playerFPlayerA player.
unitUnitA unit.

RemovePlayerFromUnit

Removes a player from their unit.

Parameters

NameTypeDescription
playerFPlayerA player.

EnablePanicMode

Enables panic mode for the given unit.

Parameters

NameTypeDescription
unitUnitThe unit.

DisablePanicMode

Disables panic mode for the given unit.

Parameters

NameTypeDescription
unitUnitThe unit.

CreateUnit

Parameters

NameTypeDescription
callsignstringThe callsign of the player.
playerFPlayerA player to add by default.

Returns

NameType
UnitThe created unit.

CreateUnit

Creates a unit with the specified callsign and player.

Parameters

NameTypeDescription
callsignstringThe callsign of the player.
playersIEnumerable<FPlayer>The players to add by default.

Returns

NameType
UnitThe created unit.

Events

OnUnitCreated

Invoked when a unit is created.

Type: EventHandler<Unit>

OnUnitRemoved

Invoked when a unit is removed.

Type: EventHandler<Unit>

OnPlayerJoinedUnit

Invoked when a player joined a unit.

Type: EventHandler<UnitPlayerEventArgs>

OnPlayerLeftUnit

Invoked when a player left a unit.

Type: EventHandler<UnitPlayerEventArgs>

OnPanicModeEnabled

Invoked when a unit has enabled the panic mode.

Type: EventHandler<Unit>

OnPanicModeDisabled

Invoked when a unit has disabled the panic mode.

Type: EventHandler<Unit>