Skip to Content

bz_eAllowSpawn

This event is called every time before a player spawns.

By setting allow to false, the player will be kicked when they try to spawn; this can be prevented by setting kickPlayer to false as well. It's recommended you let the player know why they're not allowed to spawn.

Regarding the message attribute in V2, players will only be notified of this once to prevent spamming them. If you would like players to be notified of this again, you will need to manually use bz_setPlayerSpawnable to set a player's spawnable status to false.

Data Object Type

2.4.4 bz_AllowSpawnData_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_AllowSpawnData_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

This value is the player ID for the joining player.

bz_eTeamType team

The team the player belongs to.

bool handled

Whether or not the plugin will be handling the respawn or not.

bool allow

Set to false if the player should not be allowed to spawn.

bool kickPlayer

Set to false to prevent kicking the player for not being allowed to spawn. (available since V2 of the event)

bz_ApiString kickReason

The logged reason the player is being kicked if kickPlayer is true. (available since V2 of the event)

bz_ApiString message

The message sent to the player that is not allowed to spawn if allow is false; this message is only sent to each player once. (available since V2 of the event)

double eventTime

The server time the event occurred (in seconds.)

Plug-in Usage

There are no plug-ins in the official distribution that make use of this event. Browse the Plug-in Releases forum for plug-ins which may make 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_AllowSpawnData_V2* dataObject = (bz_AllowSpawnData_V2*)eventData;

// Data
// ---
// (int)          playerID - This value is the player ID for the joining player.
// (bz_eTeamType) team - The team the player belongs to.
// (bool)         handled - Whether or not the plugin will be handling the respawn or not.
// (bool)         allow - Set to false if the player should not be allowed to spawn.
// (bool)         kickPlayer - Set to false to prevent kicking the player for not being allowed to spawn.
// (bz_ApiString) kickReason - The logged reason the player is being kicked if `kickPlayer` is true.
// (bz_ApiString) message - The message sent to the player that is not allowed to spawn if `allow` is false; this message is only sent to each player once.
// (double)       eventTime - The server time the event occurred (in seconds.)

Other Player Spawns Events

Back to bzfs API Events

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

Give us Feedback Edit this Page