Hooks called by Stamina

Summary

Hooks

Lets plugins keep a player's stamina from draining.
Lets plugins keep a player's stamina from regenerating.
Called when a player starts running and their stamina begins to drain.
Called when a player stops running and their stamina stops draining.
Lets plugins scale how fast a running player's stamina drains.
Lets plugins scale how fast a player's stamina regenerates.

Hooks

PlayerShouldStaminaDrain(target)

server plugins/stamina/plugin/sv_hooks.lua:313

Lets plugins keep a player's stamina from draining. Called on the server before stamina is taken from a player who is alive and neither noclipping nor in observer mode: on every drain tick of a running player, five times a second, when a jump costs stamina and from Stamina:drain.

Parameters

  • target Player The player whose stamina is about to drain

Returns

  • Boolean Return false to keep the stamina as it is

Called from

Call sites

PlayerShouldStaminaRegenerate(target)

server plugins/stamina/plugin/sv_hooks.lua:327

Lets plugins keep a player's stamina from regenerating. Called on the server on every regeneration tick of a player whose stamina is not full, five times a second.

Parameters

  • target Player The player whose stamina is about to regenerate

Returns

  • Boolean Return false to keep the stamina as it is

Called from

Call sites

PlayerStartRunning(target)

server plugins/stamina/plugin/sv_hooks.lua:376

Called when a player starts running and their stamina begins to drain. The hook is run on the server and then on the client of the player.

Parameters

  • target Player The player who started running

Called from

Call sites

PlayerStopRunning(target)

server plugins/stamina/plugin/sv_hooks.lua:414

Called when a player stops running and their stamina stops draining. Regeneration only starts once the regeneration delay has passed. The hook is run on the server and then on the client of the player.

Parameters

  • target Player The player who stopped running

Called from

Call sites

StaminaAdjustDrainScale(target)

server plugins/stamina/plugin/sv_hooks.lua:93

Lets plugins scale how fast a running player's stamina drains. Called on every drain tick, five times a second.

Parameters

  • target Player The player who is running

Returns

  • Number Multiplier of the drain rate; 1 when nothing is returned

Called from

  • get_drain_amount

Call sites

StaminaAdjustRegenScale(target)

server plugins/stamina/plugin/sv_hooks.lua:115

Lets plugins scale how fast a player's stamina regenerates. Called on every regeneration tick, five times a second.

Parameters

  • target Player The player who is recovering

Returns

  • Number Multiplier of the regeneration rate; 1 when nothing is returned

Called from

  • get_regen_amount

Call sites

Defined in