Skip to Content

bz_eSlashCommandEvent

This event is called each time a player sends a slash command.

If sourceChannel value is between 0 and 243, then the slash command was sent to a player ID. Otherwise, constants are available for determining the target channel of the slash command:

  • BZ_PUBLICCHAT
  • BZ_ADMINCHAT
  • BZ_ROGUECHAT
  • BZ_REDCHAT
  • BZ_GREENCHAT
  • BZ_BLUECHAT
  • BZ_PURPLECHAT
  • BZ_OBSERVERCHAT
  • BZ_RABBITCHAT
  • BZ_HUNTERCHAT

Data Object Type

2.4.14 bz_SlashCommandEventData_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_SlashCommandEventData_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 from

The player who sent the slash command

bz_ApiString message

The full text of the chat message for the slash command, containing the command and all associated parameters

int sourceChannel

The channel ID of where the slash command was sent to. (available since V2 of the event)

double eventTime

The local server time of the event

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_SlashCommandEventData_V2* dataObject = (bz_SlashCommandEventData_V2*)eventData;

// Data
// ---
// (int)          from - The player who sent the slash command
// (bz_ApiString) message - The full text of the chat message for the slash command, containing the command and all associated parameters
// (int)          sourceChannel - The channel ID of where the slash command was sent to.
// (double)       eventTime - The local server time of the event

Other Slash Commands Events

Back to bzfs API Events

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

Give us Feedback Edit this Page