Hooks hooksserver
Part of Containers
Hooks called by Containers
Summary
Hooks
Hooks
Called on the server when a container prop is removed from a running server. It is run for every removed prop with a container model, whether it held anything or not. The prop is still valid at this point and its inventory is not registered anymore; its items are dropped on the ground or destroyed on the next tick. It is not run when the map unloads or is cleaned up.
Parameters
- entity Entity The container prop that is being removed
- spilled Boolean true if the items are dropped on the ground, false if they are destroyed
Called from
Call sites
No documentation available.
Call sites
Called on the server before a container is opened for a player who has asked for it, and once more after they have entered its password. The entity is a container within reach of the player at this point.
Parameters
- actor Player The player who wants to open the container
- entity Entity The container prop
Returns
- Boolean Return false to keep the container closed for the player
- String Error phrase to notify the player with
Called from
Call sites
PlayerEnteredContainerPassword(actor, entity, correct)
server plugins/containers/plugin/sv_plugin.lua:455Called on the server when a player has entered the password of a container, before the container is opened or the player is told that the password is wrong.
Parameters
- actor Player The player who entered the password
- entity Entity The container prop
- correct Boolean Whether the password was right; also true if the password of the container was removed while the player was typing
Called from
submit_password
Call sites
Called on the server when a container is opened for a player, after its inventory has been created or found and its opening sound played, right before the inventory is shown to the player.
Parameters
- entity Entity the container prop; its inventory is entity.inventory
- actor Player the player the container is opened for
Called from
Call sites
Called on the server when a player is about to be asked for the password of a container that they may otherwise open.
Parameters
- actor Player The player who wants to open the container
- entity Entity The container prop
Returns
- Boolean Return false to open the container for the player without the password