Hooks called by Recognize

Summary

Hooks

Asks whether a player may forget another player of their own accord.
Asks whether a player may learn the name that another player introduces themselves under.
Lets plugins make a player recognize another one regardless of what the character of the player has stored, for example because both belong to the same organization.

Hooks

PlayerCanForget(actor, target)

server plugins/recognize/plugin/sv_plugin.lua:345

Asks whether a player may forget another player of their own accord. Called on the server when a player picks the forget option for someone their character has stored. Not called when staff or a death make a character forget.

Parameters

  • actor Player the player who wants to forget
  • target Player the player who would be forgotten

Returns

  • Boolean return false to keep the actor from forgetting the target

Called from

Call sites

PlayerCanRecognize(actor, listener)

server plugins/recognize/plugin/sv_plugin.lua:300

Asks whether a player may learn the name that another player introduces themselves under. Called on the server for every player an introduction reaches, the one who introduces themselves included. The Recognize plugin refuses it for that player and, if the recog_must_see config is on, for players who have no clear line of sight to them.

Parameters

  • actor Player the player who introduces themselves
  • target Player the player who would learn the name

Returns

  • Boolean return false to keep the target from learning the name

Called from

Call sites

PlayerRecognizeTarget(self, target)

shared plugins/recognize/plugin/lib/meta/sh_player.lua:33

Lets plugins make a player recognize another one regardless of what the character of the player has stored, for example because both belong to the same organization. Called on both realms whenever Player:recognizes is asked about two different players, unless the recognition system is off.

Parameters

  • viewer Player the player who may recognize the target
  • target Player the player who may be recognized

Returns

  • Boolean return true to make the viewer recognize the target
  • String the name the viewer knows the target by; their real name when it is left out

Called from

Call sites

Defined in