Recognition¶
This page documents hooks in the recognition category.
CharForceRecognized(ply, range)View Source
Purpose
Called after the recognition system force-recognizes nearby players for a speaker.
Category
Recognition
Realm
Server
Parameters
Player ply The player who triggered forced recognition.
string range The recognition range key that was used, such as `whisper`, `normal`, `talk`, or `yell`.
Example Usage
hook.Add("CharForceRecognized", "liaExampleCharForceRecognized", function(ply, range)
if not IsValid(ply) then return end
print(string.format("[MyModule] handled CharForceRecognized for %s", ply:Name()))
end)
GetDisplayedDescription(client, isHUD)View Source
Purpose
Allows modules to override the description shown for a player when recognition rules hide their normal description.
Category
Recognition
Realm
Client
Parameters
Player client The player whose description is being displayed.
boolean isHUD Whether the description is being requested for a HUD or world display instead of the scoreboard.
Returns
string|nil Return a replacement description string. Returning nil allows the default recognition-aware description logic to continue.
Example Usage
hook.Add("GetDisplayedDescription", "liaExampleGetDisplayedDescription", function(client, isHUD)
if isHUD and IsValid(client) and client:isStaffOnDuty() then
return "Staff member"
end
end)
IsCharFakeRecognized(character, id)View Source
Purpose
Allows modules to override whether one character should see a fake recognized name for another character.
Category
Recognition
Realm
Shared
Parameters
Character character The character whose fake recognition table is being checked.
number id The target character ID being tested.
Returns
boolean|nil Return true to force fake recognition or false to block it. Returning nil allows the default fake-name checks to continue.
Example Usage
hook.Add("IsCharFakeRecognized", "liaExampleIsCharFakeRecognized", function(character, id)
if character and character:getData("alwaysFakeRecognize") then
return true
end
end)
IsCharRecognized(character, id)View Source
Purpose
Allows modules to override whether one character should fully recognize another character.
Category
Recognition
Realm
Shared
Parameters
Character character The character whose recognition list is being checked.
number id The target character ID being tested.
Returns
boolean|nil Return true to force recognition or false to deny it. Returning nil allows the default recognition rules to continue.
Example Usage
hook.Add("IsCharRecognized", "liaExampleIsCharRecognized", function(character, id)
if character and character:getID() == id then
return true
end
end)
IsRecognizedChatType(chatType)View Source
Purpose
Lets code mark additional chat types as recognized chat for unknown-name masking.
Category
Recognition
Realm
Client
Parameters
string chatType The chat class unique ID being checked.
Returns
boolean|nil Return true to treat the chat type as recognition-sensitive.
Example Usage
hook.Add("IsRecognizedChatType", "liaExampleIsRecognizedChatType", function(chatType)
return true
end)
OnCharRecognized(ply)View Source
Purpose
Called after a player recognizes another character through the recognition system.
Category
Recognition
Realm
Shared
Parameters
Player ply The player whose recognition data was updated.
Example Usage
hook.Add("OnCharRecognized", "liaExampleOnCharRecognized", function(ply)
if not IsValid(ply) then return end
print(string.format("[MyModule] handled OnCharRecognized for %s", ply:Name()))
end)
ShouldAllowScoreboardOverride(client, var)View Source
Purpose
Determines whether scoreboard and voice UI should use recognition-safe replacements for a player's visible data.
Category
Recognition
Realm
Client
Parameters
Player client The player whose displayed information is being evaluated.
string var The specific field being checked, such as `name`, `model`, `desc`, or `classlogo`.
Returns
boolean|nil Return true to use the recognition override for that field, or false to keep the original value.
Example Usage
hook.Add("ShouldAllowScoreboardOverride", "liaExampleShouldAllowScoreboardOverride", function(client, var)
if var == "name" and client == LocalPlayer() then
return false
end
end)