Player methods of the Recognize plugin: checking who a player recognizes and under which name, and, on the server, making their character remember and forget others. What the active character of a player has stored is networked to that player alone as the private 'fl_recognizes' variable, a Map of character IDs to the names they are known by, so a client only knows the recognitions of the local player.

Summary

Methods

Makes the player recognize a target by a name, updating the stored and networked recognizes.
Makes the player forget everyone their active character has stored.
Returns the name the active character of the player has stored for the character of a target.
Checks whether the player knows a target by their real name.
Checks whether the player recognizes a target.
Makes the player forget a target, deleting the stored recognize.

Methods

Player:add_recognize(target, name)

server plugins/recognize/plugin/lib/meta/sh_player.lua:76

Makes the player recognize a target by a name, updating the stored and networked recognizes.

Parameters

  • target Player player to recognize
  • name String optional, defaults to nil name to know them by, the target's real name by default

Player:clear_recognizes()

server plugins/recognize/plugin/lib/meta/sh_player.lua:134

Makes the player forget everyone their active character has stored.

Returns

  • Number how many characters were forgotten

Player:get_recognize(target)

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

Returns the name the active character of the player has stored for the character of a target. Unlike Player:recognizes this only looks at what the character remembers, which is what Player:remove_recognize makes it forget.

Parameters

  • target Player player to check

Returns

  • String the stored name, nil if the character has not stored the target

Player:knows_real_name(target)

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

Checks whether the player knows a target by their real name.

Parameters

  • target Player player to check

Returns

  • Boolean whether the target is known by their real name

Player:recognizes(target)

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

Checks whether the player recognizes a target. Players always recognize themselves, bots and others while noclipping, everyone is recognized while the recognition system is off, and the PlayerRecognizeTarget hook can override the result.

Parameters

  • target Player player to check

Returns

  • Boolean whether the target is recognized
  • String name they are known by

Player:remove_recognize(target)

server plugins/recognize/plugin/lib/meta/sh_player.lua:118

Makes the player forget a target, deleting the stored recognize.

Parameters

  • target Player player to forget

Returns

  • Boolean whether the character of the player had the target stored

Defined in