Skip to Content

bz_ePlayerDieEvent

This event is called each time a tank is killed.

The killerID attribute can changed by a plug-in to reassign the credit for a kill. This is useful when a world weapon is shot on behalf of a player and the kills belong to a player. Be careful, any number of plug-ins can reassign kills so be sure to only reassign kills under clear conditions for your plugin.

The bz_ePlayerDeathFinalizedEvent is fired after all plug-ins after finished reassigning any kills.

Data Object Type

2.4.10 bz_PlayerDieEventData_V2

Deprecated Types

These data object types have been deprecated in favor of more recent versions, which contain more or corrected information.

  • 2.4.0 bz_PlayerDieEventData_V1

Parameters

These are the values accessible in the bz_EventData variable that's made available in the Event method.

Data Type Name Description
int playerID

ID of the player who was killed.

bz_eTeamType team

The team the killed player was on.

int killerID

The owner of the shot that killed the player, or BZ_SERVER for server side kills

bz_eTeamType killerTeam

The team the owner of the shot was on.

bz_ApiString flagKilledWith

The flag name the owner of the shot had when the shot was fired.

int flagHeldWhenKilled

The ID of the flag the victim was holding when they died. (available since V2 of the event)

int shotID

The shot ID that killed the player, if the player was not killed by a shot, the id will be -1.

bz_PlayerUpdateState state

The state record for the killed player at the time of the event

double eventTime

Time of the event on the server.

Plug-in Usage

Here's a list of plug-ins part of the official distribution that makes use of this event:

Plug-in Example

This block of code can be used to get started when implementing the Event() function of your plug-in.

bz_PlayerDieEventData_V2* dataObject = (bz_PlayerDieEventData_V2*)eventData;

// Data
// ---
// (int)          playerID - ID of the player who was killed.
// (bz_eTeamType) team - The team the killed player was on.
// (int)          killerID - The owner of the shot that killed the player, or BZ_SERVER for server side kills
// (bz_eTeamType) killerTeam - The team the owner of the shot was on.
// (bz_ApiString) flagKilledWith - The flag name the owner of the shot had when the shot was fired.
// (int)          flagHeldWhenKilled - The ID of the flag the victim was holding when they died.
// (int)          shotID - The shot ID that killed the player, if the player was not killed by a shot, the id will be -1.
// (bz_PlayerUpdateState) state - The state record for the killed player at the time of the event
// (double)       eventTime - Time of the event on the server.

Other Player Events

Back to bzfs API Events

This content is maintained on GitHub. We welcome any feedback and improvements!

Give us Feedback Edit this Page