Summary
Hooks
Hooks
cwGather:CanSpawnNode(position, class)
server gamemodes/cwhl2rp/plugins/gathering/plugin/sv_hooks.lua:45Implements hook CanSpawnNode
Called to check whether a node can spawn at a point; blocks it within 50 units of a node of the same class.
Parameters
- position Vector The spawn point's position
- class String The node's entity class
Returns
- Boolean Whether the node can spawn
Implements hook ClockworkInitPostEntity
Called after Catwork has loaded the map entities; loads the resource node spawn points.
Loads the resource node spawn points of the current map and makes each spawn as soon as possible.
The list is rebuilt without the gaps that removed points left in older data.
Implements hook OneSecond
Called every second; respawns resource nodes whose respawn delay has passed.
The nodes_respawn_delay config runs from the moment a point's node is found gone. The
point then spawns a new node when CanSpawnNode allows it, and is looked at again five
seconds later when it does not or the node cannot be created.
cwGather:PlayerBreaksWood(player, ent)
server gamemodes/cwhl2rp/plugins/gathering/plugin/sv_plugin.lua:84Gives a player wood for breaking a wooden prop.
Rolls once per 25 units of the prop's mass (1 to 5 rolls), each roll raised by the
player's Scavenger attribute, and drops a wooden_board or wooden_parts item at the
prop for good rolls. Progresses Scavenger by 5 to 25 depending on the mass.
Parameters
- player Player The player who broke the prop
- ent Entity The broken prop
hook.Add id: cwGather_wood
No documentation available.
Saves the resource node spawn points of the current map to the schema data.
Writes plugins/gather/<map>.
Spawns a resource node at a spawn point and remembers it as the point's node.
Wood points (data is 'wood') get a random model from cwGather.woodNodes. The node is
raised so its bottom rests on the point.
Parameters
- pointTable Map The spawn point, with
class,data,positionandangles
Returns
- Entity The node, or
nilwhen it could not be created