FivePD API
Interfaces

IEventService

Provides utility methods to trigger events on the client.

Methods

TriggerEventWithoutCallback

Triggers an event for the specified player or if null selects a random player on the server.

Parameters

NameTypeDescription
playerPlayerThe player to trigger the event for.
eventNamestringThe event name.
argsparams object[]The arguments of the event.

TriggerEvent

Triggers an event for the specified player or if null selects a random player on the server.

Parameters

NameTypeDescription
playerPlayerThe player to trigger the event for.
eventNamestringThe event name.
callbackAction<string>A callback function which is invoked when the event returns.
argsparams object[]The arguments of the event.

TriggerEventAsync

Triggers an event for the specified player or if null selects a random player on the server. Same as the normal but awaitable for the returned value.

Parameters

NameTypeDescription
playerPlayerThe player to trigger the event for.
eventNamestringThe event name.
argsparams object[]The arguments of the event.

Returns

NameType
Task<string>A representing the asynchronous operation.

TriggerEventStrictWithoutCallback

Triggers an event for the specified player.

Parameters

NameTypeDescription
playerPlayerThe player to trigger the event for.
eventNamestringThe event name.
argsparams object[]The arguments of the event.

TriggerEventStrict

Triggers an event for the specified player.

Parameters

NameTypeDescription
playerPlayerThe player to trigger the event for.
eventNamestringThe event name.
callbackAction<string>A callback function which is invoked when the event returns.
argsparams object[]The arguments of the event.

TriggerEventStrictAsync

Triggers an event for the specified player. Same as the normal but awaitable for the returned value.

Parameters

NameTypeDescription
playerPlayerThe player to trigger the event for.
eventNamestringThe event name.
argsparams object[]The arguments of the event.

Returns

NameType
Task<string>A representing the asynchronous operation.