Shared definition of the cw_garbage entity: its entity fields and its networked index variable.
Summary
Methods
Blocks every tool on the pile.
Draw()client
Draws the pile's model.
Initialize()shared
Picks a random garbage model and sets up the pile's physics, colliding only with the world.
Stops the pile from moving unless a player holds it or it is constrained.
SetupDataTables()shared
Sets up the networked int 0 (
index).Think()client
Does nothing on the client.
UpdateTransmitState()server
Returns
TRANSMIT_ALWAYS, so the pile is networked to every client.Use(activator, caller)server
Starts searching the pile when a crouching, untied player or one holding a push broom uses it.
Methods
ENT:CanTool(player, trace, tool)
server gamemodes/cwhl2rp/plugins/garbage/plugin/entities/entities/cw_garbage/init.lua:103Blocks every tool on the pile.
Parameters
- player
- trace
- tool
Returns
- Boolean Always
false
ENT:Draw()
client gamemodes/cwhl2rp/plugins/garbage/plugin/entities/entities/cw_garbage/cl_init.lua:6Draws the pile's model.
ENT:Initialize()
shared gamemodes/cwhl2rp/plugins/garbage/plugin/entities/entities/cw_garbage/init.lua:31On the server
Picks a random garbage model and sets up the pile's physics, colliding only with the world.
On the client
Does nothing on the client.
Defined in
ENT:PhysicsUpdate(physicsObject)
server gamemodes/cwhl2rp/plugins/garbage/plugin/entities/entities/cw_garbage/init.lua:56Stops the pile from moving unless a player holds it or it is constrained.
Parameters
- physicsObject
ENT:SetupDataTables()
shared gamemodes/cwhl2rp/plugins/garbage/plugin/entities/entities/cw_garbage/shared.lua:13Sets up the networked int 0 (index).
ENT:Think()
client gamemodes/cwhl2rp/plugins/garbage/plugin/entities/entities/cw_garbage/cl_init.lua:15Does nothing on the client.
ENT:UpdateTransmitState()
server gamemodes/cwhl2rp/plugins/garbage/plugin/entities/entities/cw_garbage/init.lua:51Returns TRANSMIT_ALWAYS, so the pile is networked to every client.
Returns
- Number
TRANSMIT_ALWAYS
ENT:Use(activator, caller)
server gamemodes/cwhl2rp/plugins/garbage/plugin/entities/entities/cw_garbage/init.lua:67Starts searching the pile when a crouching, untied player or one holding a push broom uses it.
The search takes GetGarbageTime seconds within 192 units and runs PlayerTakeGarbage
once the pile has been removed. Standing players are told to crouch.
Parameters
- activator
- caller