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.
Removes a line of target player text.
Returns a line of target player text.

Methods

cw.TargetPlayerText:Add(uniqueID, text, color, scale)

client gamemodes/catwork/gamemode/core/libraries/cl_targetplayertext.lua:28

Adds 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 nil Color of the text; white when nil
  • scale Number optional, defaults to nil Scale of the text; drawn at normal size when nil

cw.TargetPlayerText:Destroy(uniqueID)

client gamemodes/catwork/gamemode/core/libraries/cl_targetplayertext.lua:52

Removes a line of target player text.

Call this from the DestroyTargetPlayerText hook.

Parameters

  • uniqueID String Unique ID of the line

Returns a line of target player text.

Parameters

  • uniqueID String Unique ID of the line

Returns

  • Map The line (uniqueID, text, color, scale), or nil if there is none

Defined in