Summary
Hooks
Called when an entity takes damage; applies clothing protection to players.
Called when a player's character is unloaded; clears their bodygroup and skin clothing.
Called when a player gets up from a ragdoll; reapplies their clothing bodygroups and skin.
PostPlayerSpawn(player)server
Called after a player spawns; reapplies their clothing, as spawning resets the model and skin.
Hooks
PLUGIN:EntityTakeDamage(victim, dmg)
server gamemodes/cwhl2rp/plugins/clothes/plugin/sv_plugin.lua:178Implements hook EntityTakeDamage
Called when an entity takes damage; applies clothing protection to players.
Radiation-proof clothes block all damage but bullets, explosions and falls. Without a
clothes item, the summed protection of bodygroup and skin clothing, capped at 60,
reduces non-fall damage by that percentage.
Parameters
- victim Entity The damaged entity
- dmg CTakeDamageInfo The damage, scaled in place
PLUGIN:PlayerCharacterUnloaded(player)
server gamemodes/cwhl2rp/plugins/clothes/plugin/sv_plugin.lua:207Implements hook PlayerCharacterUnloaded
Called when a player's character is unloaded; clears their bodygroup and skin clothing.
Parameters
- player Player The player whose character was unloaded
PLUGIN:PlayerUnragdolled(player, state, ragdollTable)
server gamemodes/cwhl2rp/plugins/clothes/plugin/sv_plugin.lua:233Implements hook PlayerUnragdolled
Called when a player gets up from a ragdoll; reapplies their clothing bodygroups and skin.
Parameters
- player Player The player who got up
- state Number The ragdoll state, a
RAGDOLL_*value - ragdollTable Map The player's ragdoll data
Implements hook PostPlayerSpawn
Called after a player spawns; reapplies their clothing, as spawning resets the model and skin.
Parameters
- player Player The player who spawned