Player class
Part of Recognize
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
Methods
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
nilname to know them by, the target's real name by default
Makes the player forget everyone their active character has stored.
Returns
- Number how many characters were forgotten
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
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
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
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