Shared definition of the cw_notepad entity of the Notepad plugin, with the networked bool that is true once the
notepad has text.
Summary
Methods
Draw()client
Draws the notepad's model.
Explode()server
Plays the effect and sound of the notepad being destroyed.
Draws the notepad's name and whether it is written or blank when looked at.
Initialize()server
Sets the clipboard model and physics and gives the notepad 25 health.
OnTakeDamage(damageInfo)server
Subtracts the damage from the notepad's health and destroys it at 0.
SetText(text)server
Sets the notepad's text and marks it as written.
SetupDataTables()shared
Sets up the networked bool 0 (
note), which is true once the notepad has text.UpdateTransmitState()server
Returns
TRANSMIT_ALWAYS, so the notepad is networked to every client.Methods
ENT:Draw()
client gamemodes/cwhl2rp/plugins/notepad/plugin/entities/entities/cw_notepad/cl_init.lua:21Draws the notepad's model.
ENT:Explode()
server gamemodes/cwhl2rp/plugins/notepad/plugin/entities/entities/cw_notepad/init.lua:38Plays the effect and sound of the notepad being destroyed.
ENT:HUDPaintTargetID(x, y, alpha)
client gamemodes/cwhl2rp/plugins/notepad/plugin/entities/entities/cw_notepad/cl_init.lua:7Draws the notepad's name and whether it is written or blank when looked at.
Parameters
- x
- y
- alpha
ENT:Initialize()
server gamemodes/cwhl2rp/plugins/notepad/plugin/entities/entities/cw_notepad/init.lua:13Sets the clipboard model and physics and gives the notepad 25 health.
ENT:OnTakeDamage(damageInfo)
server gamemodes/cwhl2rp/plugins/notepad/plugin/entities/entities/cw_notepad/init.lua:51Subtracts the damage from the notepad's health and destroys it at 0.
Parameters
- damageInfo
ENT:SetText(text)
server gamemodes/cwhl2rp/plugins/notepad/plugin/entities/entities/cw_notepad/init.lua:65Sets the notepad's text and marks it as written.
The text's CRC becomes the notepad's uniqueID, which clients use to cache it. Does
nothing when text is nil.
Parameters
- text String The new text
ENT:SetupDataTables()
shared gamemodes/cwhl2rp/plugins/notepad/plugin/entities/entities/cw_notepad/shared.lua:13Sets up the networked bool 0 (note), which is true once the notepad has text.
ENT:UpdateTransmitState()
server gamemodes/cwhl2rp/plugins/notepad/plugin/entities/entities/cw_notepad/init.lua:33Returns TRANSMIT_ALWAYS, so the notepad is networked to every client.
Returns
- Number
TRANSMIT_ALWAYS