Hooks called by RolePlay Commands

Summary

Hooks

Lets plugins replace the name a player is shown under in the local OOC chat, for example to keep the members of a faction anonymous.
Lets plugins adjust a roll made with the roll command, for example to add a situational bonus.
Decides whether a player may say something in character.
Decides whether a player may use the out of character chats.

Hooks

ChatboxGetMessageColor(actor, text, team_chat)

server plugins/rpcommands/plugin/sv_plugin.lua:179

No documentation available.

Arguments

  • actor
  • text
  • team_chat

Called from

Call sites

ChatboxGetPlayerColor(actor, text, team_chat)

server plugins/rpcommands/plugin/sv_plugin.lua:177

No documentation available.

Arguments

  • actor
  • text
  • team_chat

Called from

Call sites

ChatboxGetPlayerIcon(actor, text, team_chat)

server plugins/rpcommands/plugin/sv_plugin.lua:174

No documentation available.

Arguments

  • actor
  • text
  • team_chat

Called from

Call sites

GetPlayerOOCName(actor)

server plugins/rpcommands/plugin/sv_plugin.lua:235

Lets plugins replace the name a player is shown under in the local OOC chat, for example to keep the members of a faction anonymous. Called on the server for every message a player sends to the LOOC chat; by default the line shows the name of the player's character.

Parameters

  • actor Player the player who writes

Returns

  • String the name to show instead

Called from

Call sites

PlayerAdjustRoll(roller, roll_data)

shared plugins/rpcommands/plugin/commands/sh_roll.lua:95

Lets plugins adjust a roll made with the roll command, for example to add a situational bonus. Called on the server once for every roll: once for a plain roll, and for a versus roll once for the player who ran the command and once for their opponent. Every handler can change the roll, so return nothing.

Parameters

  • roller Player the player the roll is for
  • roll_data Map the roll: result (Map the result of Dice.roll; change its total in place, a total that is not a number is put back), formula (String the formula that was rolled, or the ID of the stat or the skill) and opponent (Player the other player of a versus roll, nil for a plain roll)

Called from

  • adjust_roll

Call sites

PlayerCanSayIC(actor, text)

server plugins/rpcommands/plugin/sv_plugin.lua:120

Decides whether a player may say something in character. Called on the server for every phrase that is about to become in character speech or an action, which includes the me, whisper and yell commands; out of character chat does not ask it.

Parameters

  • actor Player the speaker
  • text String the phrase as it was typed, with its markup: *action*, (whisper) and yell!!

Returns

  • Boolean return false to refuse the phrase (the handler should tell the player why), true to allow it even for a dead or knocked out player. When nothing is returned, players who are dead or knocked out are refused

Called from

Call sites

PlayerCanUseOOC(actor, kind, text)

server plugins/rpcommands/plugin/sv_plugin.lua:91

Decides whether a player may use the out of character chats. Called on the server before a message is sent to the OOC or the LOOC chat, ahead of the cooldown check. The plugin's own handler refuses players with an OOC mute, who are told how long it still lasts; any other handler that refuses should tell the player why.

Parameters

  • actor Player the player who writes
  • kind String 'ooc' for the chat that everyone reads, 'looc' for the local one
  • text String the message without its prefix

Returns

  • Boolean return false to refuse the message

Called from

Call sites

Defined in