cw.TargetPlayerText classclient
Defines the client-side cw.TargetPlayerText library, the lines of text drawn under the name of the player the
local player is looking at.
The list is cleared every frame, so lines are added with cw.TargetPlayerText:Add from the GetTargetPlayerText
hook.
Summary
Methods
Adds a line of text under the name of the player the local player is looking at.
Destroy(uniqueID)client
Removes a line of target player text.
Get(uniqueID)client
Returns a line of target player text.
Methods
cw.TargetPlayerText:Add(uniqueID, text, color, scale)
client gamemodes/catwork/gamemode/core/libraries/cl_targetplayertext.lua:28Adds a line of text under the name of the player the local player is looking at.
The list is cleared every frame, so call this from the GetTargetPlayerText
hook, which receives the target player.
function PLUGIN:GetTargetPlayerText(player, targetPlayerText)
if player:GetNetVar('Tied') then
targetPlayerText:Add('TIED', 'They have been tied up.', Color(255, 100, 100))
end
end
Parameters
- uniqueID String Unique ID of the line
- text String Text of the line
- color Color optional, defaults to
nilColor of the text; white whennil - scale Number optional, defaults to
nilScale of the text; drawn at normal size whennil
cw.TargetPlayerText:Destroy(uniqueID)
client gamemodes/catwork/gamemode/core/libraries/cl_targetplayertext.lua:52Removes a line of target player text.
Call this from the DestroyTargetPlayerText hook.
Parameters
- uniqueID String Unique ID of the line
cw.TargetPlayerText:Get(uniqueID)
client gamemodes/catwork/gamemode/core/libraries/cl_targetplayertext.lua:40Returns a line of target player text.
Parameters
- uniqueID String Unique ID of the line
Returns
- Map The line (
uniqueID,text,color,scale), ornilif there is none