-
Notifications
You must be signed in to change notification settings - Fork 8
Callout lifecycle
Invoked when the player (presses Y
) accepts the callout.
You must also initialize the default values by calling this.InitBlip()
.
Example:
public async override Task OnAccept()
{
this.InitBlip();
...
}
Invoked when an AssignedPlayer
gets in range of the callout. This can be either the player, who originally accepted the callout, or someone else, who is responding to a callout backup request.
The player's ped (who triggered OnStart) will be passed along.
Note: base.OnStart(player)
must be called to remove the default blip and mark the callout as Started
.
Example:
public override void OnStart(Ped player)
{
base.OnStart(player); // pass the player
...
}
Invoked when the player requests backup.
The backup code will be passed along, which can be either 1
, 2
, 3
, 99
Invoked when someone accepts the callout backup request.
The player's ped will be passed along.
Invoked when someone stops responding to the callout backup request.
The player's ped will be passed along.
Invoked when the player presses the Code 4
button, but before clearing entities.
This can be useful if you are storing your entities in objects ( because FivePD might not be able to clear them ), so you can manually remove spawned entities, blips, etc that.
Note: Always check for null
.
Example:
internal class MyEntityStorage
{
public Ped ped;
public Blip blip;
}
MyEntityStorage storage; // Spawn and store your entities
...
public override void OnCancelBefore()
{
if(storage != null)
{
ped?.MarkAsNoLongerNeeded();
blip?.Delete();
}
}
Invoked after clearing the callout, after OnCancelBefore()
.