Hooks called by Catwork

Summary

Hooks

Called when entity outlines should be added; outlines the entity whose entity menu is open.
Called when GMod shows a notification; passes it to the base gamemode unless it is a #Hint_ hint.
Called to add ammo types that are saved with the character; adds the HL2 ammo types.
Called to adjust the final view table from GM:CalcView; does nothing by default.
Called to check whether the Catwork crosshair is drawn; never by default.
Called before the main menu is opened or closed with the scoreboard key; always allows it.
Called to sort the characters within a faction on the character screen; sorts them by name.
Called when the chat box is closed; does nothing by default.
Called when a key is typed in the chat box; up and down cycle through the remembered messages.
Called when the chat box text has changed; does nothing by default.
Called when chat box text has been sent; remembers the last 25 messages for the up and down keys.
Called for each config key once the config has initialized, from GM:Initialize.
Called when a ConVar created with cw.core:CreateConVar has changed.
Called when the directory is rebuilt; lists help only for the commands the local player has the flags for.
Called when Catwork has initialized, at the end of GM:Initialize.
Called after Catwork has processed the map entities in GM:InitPostEntity; does nothing by default.
Called when the Catwork database has connected; loads the ban list with cw.bans:Load.
Called when the Catwork database connection fails; reports it with cw.database:Error.
Called after the HUD bars are collected, so bars can be removed; does nothing by default.
Called after the player info text is collected, so lines can be removed; does nothing by default.
Called after the target player text is collected, so lines can be removed; does nothing by default.
Called just before a player dies.
Called when the local player's crosshair should be drawn; draws five small dots.
Called when the local player's vignette should be drawn.
Called to draw a looked at player's status below their target ID; shows that they are deceased.
Called when an entity fires bullets; overridden to do nothing.
Called when a player picks an option from an entity's menu.
Called when an entity takes damage; Catwork's central damage handler.
Called each tick when the HUD bars are collected; does nothing by default.
Called to get how long the character loading screen lasts; 8 seconds.
Called to get the tooltip of a character in the character menu.
Called when the cinematic intro info is needed; uses the schema's author, name and description.
Called when a piece of information about a door is needed for its 3D2D text.
Called to get who is holding an entity.
Called when an entity's menu options are needed.
Called to get the fall damage a player takes.
Called to get which faction group a character is shown under on the character screen; uses its faction.
Called each frame to check whether the character screen is visible.
Called to position the local player's crosshair; with use_free_aiming it follows where the weapon actually aims.
Called to fill a new character's starting inventory.
Called to get a player's default model, from cw.class:GetAppropriateModel for their team.
Called to get a player's default skin, from cw.class:GetAppropriateModel for their team.
Called to get the name a player is listed under in the door access menu; uses their name.
Called when the local player's info text (shown in the F1 menu) is needed.
Called to get the scoreboard group a player is listed under; uses their team name.
Called when the admin options for a player on the scoreboard are needed.
Called to get the text under a player's name on the scoreboard.
Called to get the progress bar shown in the middle of the screen.
Called to get the text shown in the middle of the screen; shows a notice while the character is banned.
Called to get a player's status lines for the admin ESP.
Called to get how far away a player's target ID text stays visible; 4096 units by default.
Called to get the name drawn on a recognised player's target ID; uses their name.
Called when the text below a looked at player's name is needed.
Called to adjust a weapon's lowered view model pose; does nothing by default.
Called every half second; every 3 seconds it fades timed attribute boosts and removes expired ones.
Called when the foreground HUD should be painted.
Called when an item entity has been destroyed by damage, before it explodes; does nothing by default.
Called when an item entity has taken damage, before its health drops; does nothing by default.
Called when an item's data changes, to pick who receives the update.
Called when an item's network data has been updated; runs the item's OnNetworkDataUpdated.
Called when the local player entity has been created.
Called when the main menu is closed; runs OnMenuClosed on each menu panel and closes tooltips and Derma menus.
Called when the main menu's items should be added.
Called after the main menu's items are added, so they can be removed; does nothing by default.
Called when the main menu is opened; runs OnMenuOpened on each menu panel that has it.
Called when the next wages payout is scheduled, to change the interval; does nothing by default.
Called before a notification from the server is shown, to adjust it; shows every notification.
Called when an attribute is progressed, before the amount is applied.
Called about once a second for every initialized player, after GM:PlayerThink.
Called once a second on the server, from the cw.OneSecondTimer timer.
Called when a hook errors; shows the hook error notice on the HUD for 3 seconds.
Called before an item entity's target ID is drawn; return false to stop the default draw.
Called when a player's inventory is being saved, to add items that are not in it.
Called when a player fires bullets, to adjust the bullet table in place; does nothing by default.
Called to adjust an item shown in the business menu; does nothing by default.
Called when a player creates a character, to adjust or refuse the new character; does nothing by default.
Called before a character is sent to the character menu, to adjust how it is shown.
Called for each of a player's characters as they are loaded into the character menu; does nothing by default.
Called to adjust the model shown for a class in the classes menu; does nothing by default.
Called to adjust the local player's colour modification; does nothing by default.
Called when a player dies, to adjust their respawn time; does nothing by default.
Called for each weapon a dead player drops, to adjust how it is dropped.
Called to adjust the local player's headbob.
Called to adjust the functions offered for an item in the inventory; does nothing by default.
Called to adjust the local player's motion blur; does nothing by default.
Called after a player punches with cw_hands, to adjust the delay before the next punch; does nothing by default.
Called when a player spawns a prop that costs cash, to adjust the cost; does nothing by default.
Called when a player speaks on the radio, to choose who hears it; does nothing by default.
Called when a player's armor is set; keeps a ragdolled player's stored armor in sync.
Called before a player is given a weapon with Player:Give; return false to block it.
Called to check whether a player can join a class that is at its player limit; never by default.
Called to check whether a player can use a character in a faction that is at its player limit; never by default.
Called when a player attempts to change class with /SetClass; refuses during the class change cooldown.
Called when a player attempts to create a character.
Called when a player dies, to check whether everyone forgets their name; never by default.
Called when a player dies, to check whether they forget everyone they recognised; never by default.
Called when a player attempts to delete a character; allows it by default.
Called when a player attempts to destroy an item; always allows it.
Called when a player attempts to drop an item; always allows it.
Called when a player attempts to drop a weapon.
Called on each wages payout, to check whether a player earns wages; always allows it.
Called to check whether a player can fire their weapon; returning false delays the shot.
Called when a player kills another player, to check whether the killer gains a frag; always allows it.
Called when a player who has fallen over attempts to get up with /CharGetUp; always allows it.
Called to check whether a player can put an item in storage.
Called when a player attempts to holster a weapon back into their inventory.
Called when a player attempts to use, delete or otherwise act on one of their characters from the menu.
Called when a player attempts to own a door; refuses doors marked unownable.
Called when a punch with cw_hands hits an entity, to check whether it damages it; never does by default.
Called when a punch with cw_hands hits a player, to check whether it knocks them out.
Called when a player presses the quick raise key, to check whether they can toggle their weapon; always allows it.
Called when a player attempts to speak on the radio; always allows it.
Called when a player attempts to be ragdolled; always allows it.
Called when a dead player's ragdoll is about to be set to decay; always allows it.
Called to check whether a saved recognised name is restored when both players are on.
Called to check whether a recognised name may be saved with the character.
Called when a player attempts to say something in character.
Called when a player attempts to say something local out of character; always allows it.
Called when a player attempts to say something out of character; always allows it.
Called to check whether an admin local player sees the admin ESP; follows the cwAdminESP ConVar.
Called to check whether the local player sees a group of HUD bars.
Called to check whether an item is listed in the business menu; always lists it.
Called to check whether the local player sees the center hints; always shows them.
Called to check whether a class is listed in the classes menu; always lists it.
Called to check whether the local player sees the date and time; shown in the info menu.
Called to check whether the local player sees the top hints; always shows them.
Called to check whether the local player sees their limb damage.
Called to check whether the local player sees their player info text; shown in the info menu.
Called for every initialized player when an admin runs cwStatus, to get the status line shown for them.
Called to check whether the local player can see while unconscious; never by default, so the screen goes black.
Called when the target ID of an unrecognised player is drawn; draws the unrecognised name.
Called when a player who already has a character loaded attempts to switch to another.
Called to check whether a player can take an item out of storage.
Called when a player attempts to throw a punch with cw_hands; always allows it.
Called when a player attempts to unlock an entity with the keys; doors need door access, other entities are allowed.
Called when a player attempts to be unragdolled; always allows it.
Called when a player attempts to use a character.
Called when a player attempts to use a command, before argument and access checks; always allows it.
Called when a player presses use on a door, to check whether they can open it.
Called to check whether a player in a vehicle can use the entity they look at.
Called when a player attempts to use an item from their inventory.
Called to check whether a player can fire a weapon while it is lowered.
Called when a player attempts to view a door's menu; refuses doors marked unownable.
Called when the local player attempts to zoom with +zoom; always allows it.
Called after a player's cash has changed; syncs it with their open storage via cw.storage:SyncCash.
Called after a player has created a character, before it is added to the character menu; does nothing by default.
Called when a player's character has initialized, while it loads.
Called when a player's character has loaded.
Called when the local player's character screen is created; asks the server for the quiz status.
Called when a player's character has unloaded.
Called after a player's class has been set; saves the class name in the character data.
Called when the config has been sent to a player.
Called when a player's data has loaded.
Called after a player's initial data stream info has been sent.
Called when a player has used their death code, before it is taken; does nothing by default.
Called after a player deletes a character; does nothing by default.
Called after a player destroys an item; does nothing by default.
Called by cw.player:HasDoorAccess to check whether a player has an access level on a door.
Called by cw.player:HasFlags to check whether a player has a flag they do not hold themselves.
Called after recognition is worked out, to override whether a player recognises another.
Called after a player drops an item; does nothing by default.
Called after a player drops a weapon; saves the weapon's clip ammo on its item.
Called after a player has earned wages; does nothing by default.
Called when a player has been given flags.
Called when a player has had flags taken.
Called by Player:GetHoldingEntity to get the entity a player is holding.
Called after a player has been given a weapon.
Called after a player has put an item in storage; takes it off if it was worn as clothes or an accessory.
Called before positive wages are given to a player; return false to keep the cash from being given.
Called when a player's spawn weapons should be given; gives the weapons listed by their faction rank and faction.
Called once a second to regenerate a living player's health.
Called when a player's health is set.
Called after a player is given an item; syncs it with their open storage via cw.storage:SyncItem.
Called after a player has an item taken.
Called when a player's limb damage is healed; does nothing by default.
Called when the local player's limb damage is received from the server; does nothing by default.
Called when a player's limb damage is reset; does nothing by default.
Called when a player's limb takes damage; does nothing by default.
Called when a player's spawn weapons should be given.
Called after a player's model is changed with Player:SetModel, on both realms.
Called before a player is paid wages, to change the amount; does nothing by default.
Called after a player picks up an item entity; does nothing by default.
Called to choose the sound a player makes when they die; returns a random HL2 citizen pain line.
Called to choose the pain sound a player makes when hurt.
Called after a player has spoken on the radio; does nothing by default.
Called when a ragdolled player's ragdoll attempts to take damage.
Called after a player has been ragdolled; clears the fallen over flag.
Called when a player's character data is restored as the character loads.
Called when a player's (not character's) data is restored; makes sure Whitelisted exists.
Called after a player's property has been returned to their character; does nothing by default.
Called when a player's character data is about to be saved.
Called when a player's (not character's) data is about to be saved; drops an empty Whitelisted table.
Called to scale damage a player takes by hit group.
Called when a player picks a character menu action other than use or delete; does nothing by default.
Called when a player's initial data stream info should be sent; sends the shared tables and any colour mod override.
Called to set the local player's default colour modification when no override is active; does nothing by default.
Called when a player's model should be set; applies their default model and skin.
Called once a second, when health regeneration is enabled, to check whether a player regenerates.
Called to check whether a player appears in the door access menu; always shows them.
Called to check whether a player appears on the scoreboard; always shows them.
Called when a player would take damage; players in noclip take none.
Called every player think while a player has storage open, to check whether it should close.
Called when a player (or their ragdoll) takes damage that does not kill them.
Called every 0.15 seconds for every initialized player.
Called after a player has been unragdolled; clears the fallen over flag.
Called when a player attempts to use an entity; players who have fallen over cannot use anything.
Called when a player opens a door with use, just before it opens; does nothing by default.
Called after a player uses an item; does nothing by default.
Called when a player runs an inventory action that Catwork does not handle; does nothing by default.
Called after a player uses a command; does nothing by default.
Called just after the background blurs have been drawn.
Called just after a HUD bar is drawn; does nothing by default.
Called just after the date and time box is drawn in the info menu; does nothing by default.
Called just after the local player's information box is drawn; does nothing by default.
Called just before a HUD bar is drawn; does nothing by default.
Called just before the local player's information box is drawn in the info menu; does nothing by default.
Called just before a player would take damage; does nothing by default.
Called when Catwork data is saved.
Called to adjust a player's scoreboard entry; does nothing by default.
Called to sort the players within a class on the scoreboard.
Called to check whether the character menu can be created yet; waits while the intro is fading out.
Called to check whether the background blurs are drawn; always draws them.
Called to check whether the black character menu background is drawn; always draws it.
Called to check whether the character menu background blur is drawn; always draws it.
Called to check whether a looked at player's target ID is drawn; always draws it.
Called to check whether the local player's screen fades to black.

Hooks

Called when entity outlines should be added; outlines the entity whose entity menu is open.

Parameters

  • outlines Map The cw.outline library; call outlines:Add(entity, color)

Called from

Call sites

AddNotify(info.text, info.class, 10)

client gamemodes/catwork/gamemode/hooks/cl_nethooks.lua:379

Called when GMod shows a notification; passes it to the base gamemode unless it is a #Hint_ hint.

Parameters

  • text String The notification text
  • class Number The notification type (NOTIFY_*)
  • length Number How long it stays

Call sites

Called to add ammo types that are saved with the character; adds the HL2 ammo types.

Parameters

  • ammoTable Map Ammo types to check, as { [ammoType] = true }, modified in place

Called from

Call sites

No documentation available.

Arguments

  • chatbox

Called from

Call sites

AdjustCModelHandsInfo(model, info)

shared gamemodes/catwork/gamemode/core/libraries/sh_animation.lua:833

No documentation available.

Arguments

  • model
  • info

Called from

Call sites

AdjustMouseSensitivity(defaultSensitivity)

client gamemodes/catwork/gamemode/hooks/cl_hooks.lua:542

No documentation available.

Arguments

  • defaultSensitivity

Called from

Call sites

AdjustRollNumber(player, roll, number, (PVPMode and target) or nil)

shared gamemodes/catwork/gamemode/core/commands/sh_roll.lua:29

No documentation available.

Arguments

  • player
  • roll
  • number
  • (PVPMode and target) or nil

Called from

Call sites

No documentation available.

Arguments

  • groups

Called from

Call sites

CalcViewAdjustTable(view)

client gamemodes/catwork/gamemode/hooks/cl_hooks.lua:667

Called to adjust the final view table from GM:CalcView; does nothing by default.

Parameters

  • view Map The view table, with origin, angles and fov, modified in place

Called from

Call sites

CanDrawCrosshair(weapon)

client gamemodes/catwork/gamemode/hooks/cl_hooks.lua:2860

Called to check whether the Catwork crosshair is drawn; never by default.

Parameters

  • weapon Weapon The local player's active weapon

Returns

  • Boolean Whether the crosshair is drawn

Called from

Call sites

Called before the main menu is opened or closed with the scoreboard key; always allows it.

Returns

  • Boolean Whether the menu opens or closes

Called from

Call sites

No documentation available.

Arguments

  • self

Called from

Call sites

CharacterScreenSortFactionCharacters(k, a, b)

client gamemodes/catwork/gamemode/core/libraries/cl_character.lua:312

Called to sort the characters within a faction on the character screen; sorts them by name.

Parameters

  • faction String The faction name
  • a Map The first character's screen info
  • b Map The second character's screen info

Returns

  • Boolean Whether a comes before b

Call sites

ChatAddText(listeners, message)

shared gamemodes/catwork/gamemode/core/libraries/cl_chatbox.lua:72

No documentation available.

Arguments

  • listeners
  • message

Called from

Call sites

ChatboxAdjustMessageInfo(message, listeners)

server gamemodes/catwork/gamemode/core/libraries/sv_chatbox.lua:387

No documentation available.

Arguments

  • message
  • listeners

Called from

Call sites

ChatBoxClosed(chatbox.GetCurrentText())

client gamemodes/catwork/gamemode/core/libraries/cl_chatbox.lua:1305

Called when the chat box is closed; does nothing by default.

Parameters

  • textTyped String The text left in the chat box

Called from

Call sites

ChatboxEntryPaint(self, 0, 0, w, h)

client gamemodes/catwork/gamemode/core/libraries/cl_chatbox.lua:1136

No documentation available.

Arguments

  • self
  • 0
  • 0
  • w
  • h

Called from

Call sites

ChatBoxKeyCodeTyped(code, self:GetValue())

client gamemodes/catwork/gamemode/core/libraries/cl_chatbox.lua:1200

Called when a key is typed in the chat box; up and down cycle through the remembered messages.

Parameters

  • code Number The key code (KEY_*)
  • text String The current chat box text

Returns

  • String Text to replace the chat box contents with, or nil

Called from

Call sites

No documentation available.

Arguments

  • message

Called from

Call sites

ChatboxPlayerSay(player, message)

server gamemodes/catwork/gamemode/core/libraries/sv_chatbox.lua:553

No documentation available.

Arguments

  • player
  • message

Call sites

ChatboxPreProcess(messageData)

client gamemodes/catwork/gamemode/core/libraries/cl_chatbox.lua:632

No documentation available.

Arguments

  • messageData

Called from

Call sites

ChatBoxTextChanged(self.previousText or '', text)

client gamemodes/catwork/gamemode/core/libraries/cl_chatbox.lua:1174

Called when the chat box text has changed; does nothing by default.

Parameters

  • previousText String The previous text
  • newText String The new text

Called from

Call sites

Called when chat box text has been sent; remembers the last 25 messages for the up and down keys.

Parameters

  • text String The text sent

Called from

Call sites

ClockworkConfigChanged(self.key, self.data, previousValue, self.data.value)

shared gamemodes/catwork/gamemode/core/libraries/sh_config.lua:694

Called when a config value has changed.

Applies the change to connected players: gives or takes the physgun and toolgun when the p/t default flags change, shows or hides the group commands for use_own_group_system, resets OOC cooldowns for ooc_interval and updates movement for crouched_speed, jump_power, walk_speed and run_speed.

Parameters

  • key String The config key
  • data Map The config entry
  • previousValue Any The previous value
  • newValue Any The new value

Called from

Call sites

ClockworkConfigInitialized(k, v.value)

shared gamemodes/catwork/gamemode/core/libraries/sh_config.lua:728

Called for each config key once the config has initialized, from GM:Initialize.

Zeroes every item's cost when cash_enabled is off and turns off sv_alltalk when local_voice is on.

Parameters

  • key String The config key
  • value Any The config value

Called from

Call sites

ClockworkConVarChanged(conVar, previousValue, newValue)

shared gamemodes/catwork/gamemode/core/cl_kernel.lua:305

Called when a ConVar created with cw.core:CreateConVar has changed.

Sets sv_alltalk to 1 when the changed ConVar is local_voice and the new value is truthy.

Parameters

  • name String The ConVar name
  • previousValue String The previous value
  • newValue String The new value

Call sites

ClockworkDirectoryRebuilt(self)

client gamemodes/catwork/gamemode/core/derma/cl_directory.lua:179

Called when the directory is rebuilt; lists help only for the commands the local player has the flags for.

Parameters

  • panel Panel The directory panel

Called from

Call sites

Called when Catwork has initialized, at the end of GM:Initialize.

Hides the cash commands and zeroes prop and door costs when cash is disabled, hides the group commands when use_own_group_system is set, adds the gradient, schema logo and intro image materials to the download list, registers Catwork tools with gmod_tool and sets sv_maxrate to 80000.

Called from

Call sites

ClockworkInitPostEntity()

shared gamemodes/catwork/gamemode/hooks/cl_hooks.lua:1077

Called after Catwork has processed the map entities in GM:InitPostEntity; does nothing by default.

Called from

Call sites

No documentation available.

Arguments

  • v

Called from

Call sites

No documentation available.

Call sites

ClockworkLoadShared(CW_SCRIPT_SHARED)

client gamemodes/catwork/gamemode/shared.lua:180

No documentation available.

Arguments

  • CW_SCRIPT_SHARED

Call sites

ClockworkLog(text, unixTime)

server gamemodes/catwork/gamemode/core/sv_kernel.lua:891

No documentation available.

Arguments

  • text
  • unixTime

Called from

Call sites

ClockworkPostItemsInitialized(itemsTable)

shared gamemodes/catwork/gamemode/core/libraries/sh_item.lua:850

No documentation available.

Arguments

  • itemsTable

Called from

Call sites

ClockworkSaveShared(CW_SCRIPT_SHARED)

server gamemodes/catwork/gamemode/shared.lua:190

No documentation available.

Arguments

  • CW_SCRIPT_SHARED

Call sites

ClockworkSchemaLoaded()

shared gamemodes/catwork/gamemode/shared.lua:161

No documentation available.

Call sites

Called when the Catwork database has connected; loads the ban list with cw.bans:Load.

Called from

Call sites

DatabaseConnectionFailed(errorText)

server gamemodes/catwork/gamemode/core/libraries/sv_database.lua:1040

Called when the Catwork database connection fails; reports it with cw.database:Error.

Parameters

  • errText String The error message from the database module

Called from

Call sites

Called after the HUD bars are collected, so bars can be removed; does nothing by default.

Parameters

Called from

Call sites

DestroyPlayerInfoText(cw.PlayerInfoText)

client gamemodes/catwork/gamemode/hooks/cl_hooks.lua:953

Called after the player info text is collected, so lines can be removed; does nothing by default.

Parameters

Called from

Call sites

DestroyTargetPlayerText(entity, cw.TargetPlayerText)

client gamemodes/catwork/gamemode/hooks/cl_hooks.lua:1578

Called after the target player text is collected, so lines can be removed; does nothing by default.

Parameters

Called from

Call sites

DoPlayerDeath(player, attacker, damageInfo)

server gamemodes/catwork/gamemode/hooks/sv_hooks.lua:4276

Called just before a player dies.

Drops the player's weapons, clears action and drunkenness, turns the body into a knocked out ragdoll that decays after body_decay_time (600 seconds when that is 0), clears recognised names and the name when the death hooks allow, plays the death sound, strips weapons and ammo, adds a death and gives the killer a frag when PlayerCanGainFrag allows.

Parameters

  • player Player The player
  • attacker Entity The killer
  • damageInfo CTakeDamageInfo The fatal damage

Called from

Call sites

No documentation available.

Arguments

  • barInfo

Called from

Call sites

DrawPlayerCrosshair(info.x, info.y, info.color)

client gamemodes/catwork/gamemode/hooks/cl_hooks.lua:2869

Called when the local player's crosshair should be drawn; draws five small dots.

Parameters

  • x Number The crosshair x position
  • y Number The crosshair y position
  • color Color The crosshair colour

Returns

  • Boolean Stored in cw.CustomCrosshair; true when a custom crosshair was drawn

Called from

Call sites

DrawPlayerStatusExtra(entity, alpha, x, y)

client gamemodes/catwork/gamemode/hooks/cl_hooks.lua:1580

No documentation available.

Arguments

  • entity
  • alpha
  • x
  • y

Called from

Call sites

Called when the local player's vignette should be drawn.

The vignette darkens when something is above the player, checked once a second.

Called from

Call sites

DrawTargetPlayerStatus(entity, alpha, x, y)

client gamemodes/catwork/gamemode/hooks/cl_hooks.lua:1581

Called to draw a looked at player's status below their target ID; shows that they are deceased.

Parameters

  • target Player The player looked at
  • alpha Number The text alpha
  • x Number The text x position
  • y Number The text y position

Returns

  • Number The y position below what was drawn

Called from

Call sites

EntityFireBullets(self, bulletInfo)

shared gamemodes/catwork/gamemode/core/cl_kernel.lua:3418

Called when an entity fires bullets; overridden to do nothing.

Parameters

  • entity Entity The entity firing
  • bulletInfo Map The Bullet structure

Called from

Call sites

EntityHandleMenuOption(player, entity, option, arguments)

server gamemodes/catwork/gamemode/hooks/sv_nethooks.lua:98

Called when a player picks an option from an entity's menu.

Handles taking, using, examining and unloading ammo from cw_item entities (refusing to take, use or unload items dropped by another character, and running PlayerPickupItem), forwards other item options to the item's EntityHandleMenuOption, opens cw_belongings and cw_shipment storage, and takes cw_cash.

Parameters

  • player Player The player
  • entity Entity The entity
  • option String The option's display name
  • arguments String The option's argument, such as cw.itemTake

Call sites

EntityTakeDamage(ragdoll, damageInfo)

server gamemodes/catwork/gamemode/core/sv_kernel.lua:956

Called when an entity takes damage; Catwork's central damage handler.

Lets cw.core:DoEntityTakeDamageHook handle it first. With prop_kill_protection, damage from immune or held props is cancelled. Damage to players and player ragdolls is scaled by GM:ScaleDamageByHitGroup and applied through cw.core:CalculatePlayerDamage; fatal damage runs DoPlayerDeath and PlayerDeath, other damage runs PlayerTakeDamage, plays PlayerPlayPainSound and is logged. Ragdoll damage is filtered by PlayerRagdollCanTakeDamage. Plain ragdolls bleed and are disintegrated by combine balls, and crowbar damage to NPCs is quartered.

Parameters

  • entity Entity The damaged entity
  • damageInfo CTakeDamageInfo The damage

Called from

Call sites

No documentation available.

Called from

Call sites

No documentation available.

Arguments

  • self

Called from

Call sites

Called each tick when the HUD bars are collected; does nothing by default.

Parameters

  • bars Map The cw.bars library; add bars with its functions

Called from

Call sites

GetCharacterLoadingTime()

client gamemodes/catwork/gamemode/hooks/cl_hooks.lua:2583

Called to get how long the character loading screen lasts; 8 seconds.

Returns

  • Number The loading time in seconds

Called from

Call sites

GetCharacterPanelLabels(labels, self.customData)

client gamemodes/catwork/gamemode/core/derma/cl_character.lua:883

No documentation available.

Arguments

  • labels
  • self.customData

Called from

Call sites

GetCharacterPanelSequence(modelPanel.Entity, self.customData.charTable)

client gamemodes/catwork/gamemode/core/derma/cl_character.lua:922

No documentation available.

Arguments

  • modelPanel.Entity
  • self.customData.charTable

Called from

Call sites

GetCharacterPanelToolTip(self, self.customData.charTable)

client gamemodes/catwork/gamemode/core/derma/cl_character.lua:1109

Called to get the tooltip of a character in the character menu.

When there is more than one faction it shows how many players are in the character's faction and the faction's limit.

Parameters

  • panel Panel The character panel
  • character Map The character's screen info

Returns

  • String The tooltip, or nil for none

Called from

Call sites

GetCharacterPanelWeaponModel(self, self.customData.charTable)

client gamemodes/catwork/gamemode/core/derma/cl_character.lua:1106

No documentation available.

Arguments

  • self
  • self.customData.charTable

Called from

Call sites

Called when the cinematic intro info is needed; uses the schema's author, name and description.

Returns

  • Map credits, title and text of the intro

Called from

Call sites

GetCustomCharacterButtons(self.customData.charTable, buttonsList)

client gamemodes/catwork/gamemode/core/derma/cl_character.lua:944

No documentation available.

Arguments

  • self.customData.charTable
  • buttonsList

Called from

Call sites

GetCustomCharacterOptions(self.customData.charTable, options)

client gamemodes/catwork/gamemode/core/derma/cl_character.lua:1018

No documentation available.

Arguments

  • self.customData.charTable
  • options

Call sites

GetDoorInfo(entity, DOOR_INFO_NAME)

client gamemodes/catwork/gamemode/core/cl_kernel.lua:3026

Called when a piece of information about a door is needed for its 3D2D text.

For DOOR_INFO_NAME it returns the door's name or a default; for DOOR_INFO_TEXT its text, or whether it is unownable, can be bought or owned, or has been bought or owned (depending on door_cost). Hidden and false doors show nothing.

Parameters

  • door Entity The door
  • information Number What is needed, DOOR_INFO_NAME or DOOR_INFO_TEXT

Returns

  • String The text, or false to show nothing

Called from

Call sites

GetEntityBeingHeld(self)

server gamemodes/catwork/gamemode/core/sv_kernel.lua:1820

Called to get who is holding an entity.

Parameters

  • entity Entity The entity

Returns

  • Any The player holding it with a gravity or physics gun, or whether a player holds it with use

Called from

Call sites

GetEntityMenuOptions(entity, options)

client gamemodes/catwork/gamemode/core/cl_kernel.lua:548

Called when an entity's menu options are needed.

Adds use (when the item has OnUse), take and examine options for cw_item entities plus the item's own GetEntityMenuOptions, open for cw_belongings and cw_shipment, and take for cw_cash. The values are sent to the server's GM:EntityHandleMenuOption.

Parameters

  • entity Entity The entity
  • options Map Option names mapped to their argument strings, modified in place

Called from

Call sites

GetFallDamage(player, velocity)

server gamemodes/catwork/gamemode/core/sv_kernel.lua:976

Called to get the fall damage a player takes.

Damage grows above 464 units/s and is scaled by scale_fall_damage. With wood_breaks_fall, landing on a wooden physics prop breaks it and cuts the damage to a quarter. Falls dealing more than 30 damage make the player fall over.

Parameters

  • player Player The falling player
  • velocity Number The fall speed

Returns

  • Number The damage to deal

Called from

Call sites

GetModelSelectSequence(modelPanel.Entity, model)

client gamemodes/catwork/gamemode/core/derma/cl_character.lua:258

No documentation available.

Arguments

  • modelPanel.Entity
  • model

Called from

Call sites

GetModelSelectWeaponModel(model)

client gamemodes/catwork/gamemode/core/derma/cl_character.lua:255

No documentation available.

Arguments

  • model

Called from

Call sites

GetPersuasionChoices(self.customChoices)

shared gamemodes/catwork/gamemode/core/derma/cl_character.lua:2051

No documentation available.

Arguments

  • self.customChoices

Called from

Call sites

GetPlayerCharacterScreenFaction(v)

client gamemodes/catwork/gamemode/core/libraries/cl_character.lua:304

Called to get which faction group a character is shown under on the character screen; uses its faction.

Parameters

  • character Map The character's screen info

Returns

  • String The faction name

Called from

Call sites

GetPlayerCharacterScreenVisible(panel)

client gamemodes/catwork/gamemode/hooks/cl_hooks.lua:1090

Called each frame to check whether the character screen is visible.

When the quiz is enabled, it stays hidden until the quiz is completed.

Parameters

  • panel Panel The character menu

Returns

  • Boolean Whether the character screen is visible

Called from

Call sites

GetPlayerCrosshairInfo(info)

client gamemodes/catwork/gamemode/hooks/cl_hooks.lua:2867

Called to position the local player's crosshair; with use_free_aiming it follows where the weapon actually aims.

Parameters

  • info Map color, x and y of the crosshair, modified in place

Called from

Call sites

GetPlayerDefaultInventory(player, character, character.inventory)

server gamemodes/catwork/gamemode/core/libraries/sv_player.lua:3721

Called to fill a new character's starting inventory.

Adds the items in the character's faction startingInv table ({ [uniqueID] = amount }).

Parameters

  • player Player The player creating the character
  • character Character The character being created
  • inventory Inventory The inventory to add items to

Called from

Call sites

Called to get a player's default model, from cw.class:GetAppropriateModel for their team.

Parameters

  • player Player The player to get the model for

Returns

  • String The default model path

Called from

Call sites

Called to get a player's default skin, from cw.class:GetAppropriateModel for their team.

Parameters

  • player Player The player to get the skin for

Returns

  • Number The default skin

Called from

Call sites

GetPlayerDoorAccessName(v, door, owner)

client gamemodes/catwork/gamemode/core/derma/cl_door.lua:180

Called to get the name a player is listed under in the door access menu; uses their name.

Parameters

  • player Player The player listed
  • door Entity The door
  • owner Player The door's owner

Returns

  • String The name shown

Called from

Call sites

GetPlayerInfoText(cw.PlayerInfoText)

client gamemodes/catwork/gamemode/hooks/cl_hooks.lua:952

Called when the local player's info text (shown in the F1 menu) is needed.

Adds cash and wages when cash is enabled, and the player's name and class as sub text.

Parameters

  • playerInfoText Map cw.PlayerInfoText; call its Add(id, text) and AddSub(id, text, priority)

Called from

Call sites

GetPlayerPhysDescOverride(player, physDesc)

shared gamemodes/catwork/gamemode/core/libraries/cl_player.lua:584

No documentation available.

Arguments

  • player
  • physDesc

Called from

Call sites

Called to get the scoreboard group a player is listed under; uses their team name.

Parameters

  • player Player The player

Returns

  • String The group name

Called from

Call sites

GetPlayerScoreboardOptions(info.player, options)

client gamemodes/catwork/gamemode/core/derma/cl_scoreboard.lua:218

Called when the admin options for a player on the scoreboard are needed.

Adds ban, kick, flag, name, item, user group, demote and whitelist options for the commands the local player has access to. Each option runs the matching command, asking for text first where the command needs it.

Parameters

  • player Player The player the options act on
  • options Map Option names mapped to callbacks, or to nested option maps for submenus
  • menu Panel Unused; the callers do not pass it

Call sites

GetPlayerScoreboardText(info.player)

client gamemodes/catwork/gamemode/core/derma/cl_scoreboard.lua:180

Called to get the text under a player's name on the scoreboard.

Shows the physical description (cut to 64 characters) of recognised players and a generic line for others.

Parameters

  • player Player The player

Returns

  • String The text

Called from

Call sites

GetPostProgressBarInfo()

client gamemodes/catwork/gamemode/hooks/cl_hooks.lua:1205

No documentation available.

Called from

Call sites

Called to get the progress bar shown in the middle of the screen.

Shows locking and unlocking progress, getting up progress while ragdolled, and the get up prompt while fallen over when PlayerCanGetUp allows. Nothing is shown while waiting to respawn.

Returns

  • Map text, percentage, flash, isBlocky and blocksAmt of the bar, or nil for no bar

Called from

Call sites

Called to get the text shown in the middle of the screen; shows a notice while the character is banned.

Returns

  • Map title, text and alpha of the text, or nil to show nothing

Called from

Call sites

GetStatusInfo(v, statusInfo)

client gamemodes/catwork/gamemode/core/cl_kernel.lua:1359

Called to get a player's status lines for the admin ESP.

Adds the player's current action (locking, unlocking, getting up, dead or another action) and whether they have fallen over.

Parameters

  • player Player The player
  • text List<String> The status lines, added to in place

Called from

Call sites

GetTargetPlayerFadeDistance(entity)

client gamemodes/catwork/gamemode/hooks/cl_hooks.lua:1490

Called to get how far away a player's target ID text stays visible; 4096 units by default.

Parameters

  • player Player The player looked at

Returns

  • Number The fade distance

Called from

Call sites

GetTargetPlayerName(entity)

client gamemodes/catwork/gamemode/hooks/cl_hooks.lua:1518

Called to get the name drawn on a recognised player's target ID; uses their name.

Parameters

  • player Player The player looked at

Returns

  • String The name, which may contain newlines

Called from

Call sites

GetTargetPlayerText(entity, cw.TargetPlayerText)

client gamemodes/catwork/gamemode/hooks/cl_hooks.lua:1577

Called when the text below a looked at player's name is needed.

Adds the wrapped physical description of recognised players, or a prompt to look at them for unrecognised living players.

Parameters

  • player Player The player looked at
  • targetPlayerText Map cw.TargetPlayerText; call its Add(id, text)

Called from

Call sites

GetWeaponLoweredViewInfo(itemTable, weapon, viewInfo)

client gamemodes/catwork/gamemode/hooks/cl_hooks.lua:724

Called to adjust a weapon's lowered view model pose; does nothing by default.

Parameters

  • itemTable Item The weapon's item, or nil
  • weapon Weapon The weapon
  • viewInfo Map origin (Vector) and angles (Angle) of the lowered pose, which can be changed

Called from

Call sites

Called every half second; every 3 seconds it fades timed attribute boosts and removes expired ones.

Call sites

HUDPaintCharacterLoading(math.Clamp((255 / cw.CharacterLoadingDelay) * (cw.CharacterLoadingFinishTime - c…)

client gamemodes/catwork/gamemode/hooks/cl_hooks.lua:2713

No documentation available.

Arguments

  • math.Clamp((255 / cw.CharacterLoadingDelay) * (cw.CharacterLoadingFinishTime - c…

Called from

Call sites

HUDPaintCharacterSelection()

client gamemodes/catwork/gamemode/hooks/cl_hooks.lua:2573

No documentation available.

Called from

Call sites

HUDPaintEntityTargetID(ent, { alpha = alpha, x = x, y = y })

client gamemodes/catwork/gamemode/hooks/cl_hooks.lua:1618

No documentation available.

Arguments

  • ent
  • { alpha = alpha, x = x, y = y }

Called from

Call sites

Called when the foreground HUD should be painted.

Draws the hook error notice, the fallen over and underwater blur, the progress bar from GetProgressBarInfo (or GetPostProgressBarInfo), the admin ESP when PlayerCanSeeAdminESP allows, the GetScreenTextInfo text, the top bars and the death screen with the respawn countdown, then runs HUDPaintTopScreen.

Called from

Call sites

No documentation available.

Called from

Call sites

No documentation available.

Arguments

  • info

Called from

Call sites

Called when an item entity has been destroyed by damage, before it explodes; does nothing by default.

Parameters

  • itemEntity Entity The cw_item entity
  • itemTable Item The item

Called from

Call sites

No documentation available.

Arguments

  • itemTable
  • self

Called from

Call sites

ItemEntityTakeDamage(self, itemTable, damageInfo)

server gamemodes/catwork/gamemode/core/entities/entities/cw_item/init.lua:101

Called when an item entity has taken damage, before its health drops; does nothing by default.

Parameters

  • itemEntity Entity The cw_item entity
  • itemTable Item The item
  • damageInfo CTakeDamageInfo The damage, which can be changed

Returns

  • Boolean The return value is ignored

Called from

Call sites

No documentation available.

Arguments

  • itemTable
  • self

Called from

Call sites

ItemGetNetworkObservers(itemTable, info)

server gamemodes/catwork/gamemode/core/libraries/sh_item.lua:1064

Called when an item's data changes, to pick who receives the update.

Items with a world entity are sent to everyone; otherwise the players who carry the item, hold it as a weapon or have it in their open storage are added as observers.

Parameters

  • itemTable Item The item
  • info Map observers (a Map of player to player) and sendToAll, which can be changed

Returns

  • Boolean true to send the update to everyone

Called from

Call sites

ItemNetworkDataUpdated(itemTable, data.data)

client gamemodes/catwork/gamemode/core/libraries/sh_inventory.lua:482

Called when an item's network data has been updated; runs the item's OnNetworkDataUpdated.

Parameters

  • itemTable Item The item
  • newData Map The updated data fields

Call sites

No documentation available.

Call sites

Called when the local player entity has been created.

Watches the Clothes network variable to keep cw.ClothesData and the inventory up to date, and tells the server a second later with the LocalPlayerCreated message.

Called from

Call sites

ModifyWagesInterval(info)

server gamemodes/catwork/gamemode/hooks/sv_hooks.lua:1766

Called when the next wages payout is scheduled, to change the interval; does nothing by default.

Parameters

  • info Map Has interval, the seconds until the next payout, which can be changed

Called from

Call sites

NotificationAdjustInfo(info)

client gamemodes/catwork/gamemode/hooks/cl_nethooks.lua:378

Called before a notification from the server is shown, to adjust it; shows every notification.

Parameters

  • info Map text, class and sound of the notification, which can be changed

Returns

  • Boolean Whether the notification is shown

Call sites

OnAttributeProgress(player, attribute, amount)

server gamemodes/catwork/gamemode/core/libraries/sh_attributes.lua:45

Called when an attribute is progressed, before the amount is applied.

Catwork multiplies amount by the scale_attribute_progress config.

Parameters

  • player Player The player who progressed the attribute
  • attribute String The attribute's unique ID
  • amount Number The amount it is progressed by

Returns

  • Number The amount to progress the attribute by instead

Called from

Call sites

No documentation available.

Call sites

OnePlayerSecond(v, curTime, infoTable)

server gamemodes/catwork/gamemode/hooks/sv_hooks.lua:1832

Called about once a second for every initialized player, after GM:PlayerThink.

Handles attribute progress and boosts, networks the player's flags, model, name, cash and drunk level, networks or removes clothes, runs PlayerHealthRegenerate when health regeneration is enabled and PlayerShouldHealthRegenerate allows it and expires drunk entries. When cash is disabled it zeroes the character's cash and wages.

Parameters

  • player Player The player being updated
  • curTime Number The current CurTime()
  • infoTable Map The player's per-think info table (player.cwInfoTable); fields such as wages, runSpeed and inventoryWeight can be changed to affect the player

Called from

Call sites

Called once a second on the server, from the cw.OneSecondTimer timer.

Distributes hints every hint_interval and wages every wages_interval (adjustable through ModifyWagesInterval), advances the in-game clock every minute_time, runs PreSaveData, SaveData and PostSaveData every save_data_interval, and changes to the same map after 20 minutes with no players.

Call sites

OnHookError(name, bGamemode, a)

shared gamemodes/catwork/gamemode/core/libraries/sh_plugin.lua:724

Called when a hook errors; shows the hook error notice on the HUD for 3 seconds.

Parameters

  • name String The hook name
  • isGM Boolean Whether the error was in a gamemode hook
  • message String The error message

Called from

Call sites

No documentation available.

Arguments

  • sNewMap

Call sites

OnPlayerUserGroupSet(self, userGroup)

server gamemodes/catwork/gamemode/core/sv_kernel.lua:1990

No documentation available.

Arguments

  • self
  • userGroup

Called from

Call sites

PaintChatboxBackground(0, 0, w, h, self.alpha)

client gamemodes/catwork/gamemode/core/libraries/cl_chatbox.lua:1015

No documentation available.

Arguments

  • 0
  • 0
  • w
  • h
  • self.alpha

Called from

Call sites

PaintInfoMenuExtras(infoData)

client gamemodes/catwork/gamemode/core/cl_kernel.lua:1052

No documentation available.

Arguments

  • infoData

Called from

Call sites

PaintItemTargetID(x, y, alpha, itemTable)

client gamemodes/catwork/gamemode/core/entities/entities/cw_item/cl_init.lua:17

Called before an item entity's target ID is drawn; return false to stop the default draw.

Parameters

  • x Number The text x position
  • y Number The text y position
  • alpha Number The text alpha
  • itemTable Item The item

Returns

  • Boolean Whether the default target ID is drawn

Called from

Call sites

PlayerAddToSavedInventory(player, character, function(itemTable) cw.inventory:AddInstance(inventory, itemTable) end)

server gamemodes/catwork/gamemode/core/libraries/sv_player.lua:3865

Called when a player's inventory is being saved, to add items that are not in it.

Catwork adds the item of every weapon the player is holding, so equipped weapons are saved.

Parameters

  • player Player The player whose inventory is saved
  • character Character The character being saved
  • Callback Function Call with an Item to add it to the saved inventory

Called from

Call sites

PlayerAdjustBulletInfo(self, bulletInfo)

shared gamemodes/catwork/gamemode/core/cl_kernel.lua:3415

Called when a player fires bullets, to adjust the bullet table in place; does nothing by default.

Parameters

  • player Player The player firing
  • bulletInfo Map The Bullet structure passed to Entity:FireBullets

Called from

Call sites

PlayerAdjustBusinessItemTable(self.itemTable)

client gamemodes/catwork/gamemode/core/derma/cl_business.lua:219

Called to adjust an item shown in the business menu; does nothing by default.

Parameters

  • itemTable Item The item, which can be changed

Called from

Call sites

PlayerAdjustCharacterCreationInfo(player, info, data)

shared gamemodes/catwork/gamemode/core/libraries/cl_character.lua:193

Called when a player creates a character, to adjust or refuse the new character; does nothing by default.

Parameters

  • player Player The player
  • info Map The new character, which can be changed
  • data Map The data the client sent

Returns

  • Any false to refuse with a generic fault, or a fault string to refuse with that message

Called from

Call sites

PlayerAdjustCharacterScreenInfo(player, character, info)

server gamemodes/catwork/gamemode/core/libraries/sv_player.lua:3634

Called before a character is sent to the character menu, to adjust how it is shown.

Catwork uses the faction rank's model if it has one.

Parameters

  • player Player The player
  • character Character The character
  • info Map What the menu shows: name, model, banned, faction, characterID, details and so on

Called from

Call sites

PlayerAdjustCharacterTable(player, v)

server gamemodes/catwork/gamemode/hooks/sv_hooks.lua:1593

Called for each of a player's characters as they are loaded into the character menu; does nothing by default.

Parameters

  • player Player The player
  • character Character The character, which can be changed

Returns

  • Boolean true to delete the character instead of listing it

Call sites

PlayerAdjustClassModelInfo(self.classTable.index, info)

client gamemodes/catwork/gamemode/core/derma/cl_classes.lua:168

Called to adjust the model shown for a class in the classes menu; does nothing by default.

Parameters

  • class Number The class index
  • info Map model and skin, which can be changed

Called from

Call sites

PlayerAdjustColorModify(cw.ColorModify)

client gamemodes/catwork/gamemode/hooks/cl_hooks.lua:2329

Called to adjust the local player's colour modification; does nothing by default.

Parameters

  • colorModify Map The $pp_colour_* values, modified in place

Called from

Call sites

PlayerAdjustDeathInfo(player, info)

server gamemodes/catwork/gamemode/core/sv_kernel.lua:481

Called when a player dies, to adjust their respawn time; does nothing by default.

Parameters

  • player Player The player
  • info Map attacker, inflictor, damageInfo and spawnTime, which can be changed

Called from

Call sites

PlayerAdjustDropWeaponInfo(player, info)

server gamemodes/catwork/gamemode/core/libraries/sv_player.lua:3442

Called for each weapon a dead player drops, to adjust how it is dropped.

Parameters

  • player Player The player
  • info Map itemTable, position and angles of the dropped item, which can be changed

Returns

  • Boolean Whether the weapon item entity is created

Called from

Call sites

PlayerAdjustHeadbobInfo(info)

client gamemodes/catwork/gamemode/hooks/cl_hooks.lua:622

Called to adjust the local player's headbob.

Speeds up and strengthens the bob while walking and running, scaled by cwHeadbobScale, and sways it further the more drunk the player is.

Parameters

  • info Map speed, yaw and roll of the headbob, modified in place

Called from

Call sites

PlayerAdjustItemFunctions(itemTable, itemFunctions)

client gamemodes/catwork/gamemode/core/cl_kernel.lua:2158

Called to adjust the functions offered for an item in the inventory; does nothing by default.

Parameters

  • itemTable Item The item
  • itemFunctions List<Map> The functions, as { title = ..., name = ... } entries, modified in place

Called from

Call sites

PlayerAdjustItemMenu(itemTable, itemMenu, itemFunctions)

client gamemodes/catwork/gamemode/core/cl_kernel.lua:2202

No documentation available.

Arguments

  • itemTable
  • itemMenu
  • itemFunctions

Called from

Call sites

PlayerAdjustMaxSpace(self, space)

server gamemodes/catwork/gamemode/core/sv_kernel.lua:2061

No documentation available.

Arguments

  • self
  • space

Called from

Call sites

PlayerAdjustMaxWeight(self, weight)

server gamemodes/catwork/gamemode/core/sv_kernel.lua:2039

No documentation available.

Arguments

  • self
  • weight

Called from

Call sites

PlayerAdjustMotionBlurs(motionBlurs)

client gamemodes/catwork/gamemode/hooks/cl_hooks.lua:2330

Called to adjust the local player's motion blur; does nothing by default.

Parameters

  • motionBlurs Map enabled and blurTable (blur amounts by name, the lowest is used), modified in place

Called from

Call sites

PlayerAdjustNextPunchInfo(self:GetOwner(), info)

server gamemodes/catwork/gamemode/core/entities/weapons/cw_hands/shared.lua:173

Called after a player punches with cw_hands, to adjust the delay before the next punch; does nothing by default.

Parameters

  • player Player The player
  • info Map primaryFire and secondaryFire, the delays in seconds, which can be changed

Called from

Call sites

PlayerAdjustPropCostInfo(player, entity, info)

server gamemodes/catwork/gamemode/hooks/sv_hooks.lua:3209

Called when a player spawns a prop that costs cash, to adjust the cost; does nothing by default.

Parameters

  • player Player The player
  • entity Entity The prop
  • info Map cost and name (the reason shown for the payment), which can be changed

Called from

Call sites

PlayerAdjustRadioInfo(player, info)

server gamemodes/catwork/gamemode/core/libraries/sv_player.lua:1951

Called when a player speaks on the radio, to choose who hears it; does nothing by default.

Parameters

  • player Player The player
  • info Map text, noEavesdrop and listeners; add players to listeners to let them hear it

Called from

Call sites

PlayerArmorSet(self, armor, oldArmor)

server gamemodes/catwork/gamemode/core/sv_kernel.lua:1346

Called when a player's armor is set; keeps a ragdolled player's stored armor in sync.

Parameters

  • player Player The player
  • newArmor Number The new armor
  • oldArmor Number The previous armor

Called from

Call sites

PlayerAttributeUpdated(player, attributeTable, amount)

server gamemodes/catwork/gamemode/core/libraries/sh_attributes.lua:141

No documentation available.

Arguments

  • player
  • attributeTable
  • amount

Called from

Call sites

PlayerBanned(v, duration, reason)

server gamemodes/catwork/gamemode/core/libraries/sv_bans.lua:171

No documentation available.

Arguments

  • v
  • duration
  • reason

Called from

Call sites

PlayerBusinessRebuilt(self, categories)

client gamemodes/catwork/gamemode/core/derma/cl_business.lua:63

No documentation available.

Arguments

  • self
  • categories

Called from

Call sites

PlayerCanBeGivenWeapon(self, class, itemTable)

server gamemodes/catwork/gamemode/core/sv_kernel.lua:1165

Called before a player is given a weapon with Player:Give; return false to block it.

Parameters

  • player Player The player receiving the weapon
  • class String The weapon class
  • itemTable Item The weapon's item, or nil

Returns

  • Boolean Whether the weapon can be given

Called from

Call sites

PlayerCanBypassClassLimit(target, class.index)

shared gamemodes/catwork/gamemode/core/commands/sh_setclass.lua:57

Called to check whether a player can join a class that is at its player limit; never by default.

Parameters

  • player Player The player joining
  • class Number The class index

Returns

  • Boolean true to ignore the class limit

Called from

Call sites

PlayerCanBypassFactionLimit(player, character)

server gamemodes/catwork/gamemode/core/libraries/sv_player.lua:2232

Called to check whether a player can use a character in a faction that is at its player limit; never by default.

Parameters

  • player Player The player choosing the character
  • character Character The character being used

Returns

  • Boolean true to ignore the faction limit

Called from

Call sites

PlayerCanChangeClass(target, class)

shared gamemodes/catwork/gamemode/core/commands/sh_setclass.lua:71

Called when a player attempts to change class with /SetClass; refuses during the class change cooldown.

Parameters

  • player Player The player
  • class Class The class

Returns

  • Boolean Whether the class can be changed

Called from

Call sites

PlayerCanCreateCharacter(player, character, characterID)

server gamemodes/catwork/gamemode/core/libraries/sv_player.lua:3726

Called when a player attempts to create a character.

Catwork refuses while the quiz is enabled and not completed.

Parameters

  • player Player The player creating the character
  • character Character The new character's data
  • characterID Number The ID the character will get

Returns

  • Any false to refuse with a generic fault, a fault string to refuse with that message, or true to allow

Called from

Call sites

PlayerCanDeathClearName(player, attacker, damageInfo)

server gamemodes/catwork/gamemode/hooks/sv_hooks.lua:3889

Called when a player dies, to check whether everyone forgets their name; never by default.

Parameters

  • player Player The player who died
  • attacker Entity The killer
  • damageInfo CTakeDamageInfo The fatal damage

Returns

Called from

Call sites

PlayerCanDeathClearRecognisedNames(player, attacker, damageInfo)

server gamemodes/catwork/gamemode/hooks/sv_hooks.lua:3885

Called when a player dies, to check whether they forget everyone they recognised; never by default.

Parameters

  • player Player The player who died
  • attacker Entity The killer
  • damageInfo CTakeDamageInfo The fatal damage

Returns

  • Boolean true to clear the player's recognised names

Called from

Call sites

PlayerCanDeleteCharacter(player, character)

server gamemodes/catwork/gamemode/core/libraries/sv_player.lua:2178

Called when a player attempts to delete a character; allows it by default.

Parameters

  • player Player The player
  • character Character The character to delete

Returns

  • Any nil or true to allow; anything else refuses, and a string is shown as the reason

Called from

Call sites

PlayerCanDestroyItem(player, itemTable)

shared gamemodes/catwork/gamemode/core/commands/sh_invaction.lua:39

Called when a player attempts to destroy an item; always allows it.

Return false to block it.

Parameters

  • player Player The player
  • itemTable Item The item
  • bNoMsg Boolean Whether to skip notifying the player

Returns

  • Boolean Whether the item can be destroyed

Called from

Call sites

PlayerCanDropItem(player, itemTable, position)

shared gamemodes/catwork/gamemode/core/commands/sh_invaction.lua:46

Called when a player attempts to drop an item; always allows it.

Return false to block the drop.

Parameters

  • player Player The player
  • itemTable Item The item
  • bNoMsg Any Whether to skip notifying the player; the inventory command passes the drop position here

Returns

  • Boolean Whether the item can be dropped

Called from

Call sites

PlayerCanDropWeapon(player, itemTable, NULL, true)

shared gamemodes/catwork/gamemode/core/commands/sh_dropweapon.lua:25

Called when a player attempts to drop a weapon.

Spawn weapons cannot be dropped; otherwise the item's own CanDropWeapon decides when it has one.

Parameters

  • player Player The player
  • itemTable Item The weapon's item
  • weapon Weapon The weapon
  • bNoMsg Boolean Whether to skip notifying the player

Returns

  • Boolean Whether the weapon can be dropped

Called from

Call sites

PlayerCanEarnWagesCash(v, info.wages)

server gamemodes/catwork/gamemode/core/sv_kernel.lua:815

Called on each wages payout, to check whether a player earns wages; always allows it.

Parameters

  • player Player The player
  • cash Number The wages amount

Returns

  • Boolean Whether the player earns wages; PlayerEarnWagesCash only runs when allowed

Called from

Call sites

PlayerCanFireWeapon(player, bIsRaised, weapon, true)

server gamemodes/catwork/gamemode/core/sv_kernel.lua:520

Called to check whether a player can fire their weapon; returning false delays the shot.

Catwork blocks firing when the player lacks the stamina a melee weapon needs, is sprinting with sprint_lowers_weapon set, holds the weapon lowered and PlayerCanUseLoweredWeapon refuses, or is still on player.cwNextShootTime. With limb damage enabled, arm damage randomly stops the player from firing for a while.

Parameters

  • player Player The player firing
  • bIsRaised Boolean Whether the weapon is raised
  • weapon Weapon The weapon being fired
  • bIsSecondary Boolean optional, defaults to nil Whether this is the secondary attack

Returns

  • Boolean Whether the weapon can fire

Called from

Call sites

PlayerCanGainFrag(attacker, player)

server gamemodes/catwork/gamemode/hooks/sv_hooks.lua:3913

Called when a player kills another player, to check whether the killer gains a frag; always allows it.

Parameters

  • player Player The killer
  • victim Player The victim

Returns

  • Boolean Whether a frag is added

Called from

Call sites

Called when a player who has fallen over attempts to get up with /CharGetUp; always allows it.

On the client it is called without a player to decide whether to show the get up hint.

Parameters

  • player Player The player getting up

Returns

  • Boolean Whether the player can get up

Called from

Call sites

PlayerCanGiveToStorage(player, storageTable, itemTable)

server gamemodes/catwork/gamemode/core/libraries/sv_storage.lua:445

Called to check whether a player can put an item in storage.

Catwork always allows it and tags the item with the character's key and unique ID so other characters cannot take it back out.

Parameters

  • player Player The player storing the item
  • storageTable Map The open storage
  • itemTable Item The item being stored

Returns

  • Boolean Return false to block storing the item

Called from

Call sites

PlayerCanHolsterWeapon(player, itemTable, v, true, true)

shared gamemodes/catwork/gamemode/core/items/sh_grenade_base.lua:53

Called when a player attempts to holster a weapon back into their inventory.

Spawn weapons (from the faction or rank) cannot be holstered; otherwise the item's own CanHolsterWeapon decides when it has one.

Parameters

  • player Player The player
  • itemTable Item The weapon's item
  • weapon Weapon The weapon
  • bForce Boolean Whether the holster is forced
  • bNoMsg Boolean Whether to skip notifying the player

Returns

  • Boolean Whether the weapon can be holstered

Called from

Call sites

PlayerCanInteractCharacter(player, action, character)

server gamemodes/catwork/gamemode/hooks/sv_nethooks.lua:183

Called when a player attempts to use, delete or otherwise act on one of their characters from the menu.

Catwork refuses while the quiz is enabled and the player has not completed it. The caller only reads the first return value, so return the fault string itself to show it; false shows the generic CharFault_CannotInteract fault.

Parameters

  • player Player The player acting
  • action String The action, such as use or delete
  • character Character The character acted on

Returns

  • Any false or a fault string to refuse, anything else to allow

Call sites

PlayerCanKnockOnDoor(self:GetOwner(), trace.Entity)

server gamemodes/catwork/gamemode/core/entities/weapons/cw_hands/shared.lua:198

No documentation available.

Arguments

  • self:GetOwner()
  • trace.Entity

Called from

Call sites

PlayerCanOwnDoor(player, door)

server gamemodes/catwork/gamemode/hooks/sv_nethooks.lua:232

Called when a player attempts to own a door; refuses doors marked unownable.

Parameters

  • player Player The player
  • door Entity The door

Returns

  • Boolean Whether the door can be owned

Call sites

PlayerCanPunchEntity(self:GetOwner(), trace.Entity)

server gamemodes/catwork/gamemode/core/entities/weapons/cw_hands/shared.lua:140

Called when a punch with cw_hands hits an entity, to check whether it damages it; never does by default.

Parameters

  • player Player The player punching
  • entity Entity The entity hit

Returns

  • Boolean Whether the punch damages the entity

Called from

Call sites

PlayerCanPunchKnockout(self:GetOwner(), trace.Entity, trace)

server gamemodes/catwork/gamemode/core/entities/weapons/cw_hands/shared.lua:137

Called when a punch with cw_hands hits a player, to check whether it knocks them out.

Catwork allows it on head hits. A knockout ragdolls the target for 15 seconds and runs PlayerPunchKnockout.

Parameters

  • player Player The player punching
  • target Player The player hit
  • trace Map The punch trace result

Returns

  • Boolean true to knock the target out

Called from

Call sites

PlayerCanQuickRaise(player, player:GetActiveWeapon())

server gamemodes/catwork/gamemode/hooks/sv_hooks.lua:4502

Called when a player presses the quick raise key, to check whether they can toggle their weapon; always allows it.

Parameters

  • player Player The player raising their weapon
  • weapon Weapon The player's active weapon

Returns

  • Boolean Whether the weapon raise toggles

Called from

Call sites

PlayerCanRadio(player, info.text, listeners, eavesdroppers)

server gamemodes/catwork/gamemode/core/libraries/sv_player.lua:1975

Called when a player attempts to speak on the radio; always allows it.

Return false to block the message.

Parameters

  • player Player The player speaking
  • text String The message
  • listeners List<Player> Players who will hear it over the radio, can be changed
  • eavesdroppers List<Player> Players nearby who will overhear it, can be changed

Returns

  • Boolean Whether the message is sent

Called from

Call sites

PlayerCanRagdoll(player, state, delay, decay, player.cwRagdollTab)

server gamemodes/catwork/gamemode/core/libraries/sv_player.lua:3216

Called when a player attempts to be ragdolled; always allows it.

Parameters

  • player Player The player
  • state Number The ragdoll state (RAGDOLL_*)
  • delay Number Seconds until the player gets up, or nil
  • decay Number Seconds until the ragdoll decays, or nil
  • ragdoll Map The existing ragdoll table when changing state while ragdolled, otherwise nil

Returns

  • Boolean Whether the player is ragdolled

Called from

Call sites

PlayerCanRagdollDecay(player, ragdoll, decayTime)

server gamemodes/catwork/gamemode/core/libraries/sv_player.lua:3168

Called when a dead player's ragdoll is about to be set to decay; always allows it.

Parameters

  • player Player The player
  • ragdoll Entity The ragdoll
  • seconds Number The decay time

Returns

  • Boolean Whether the ragdoll decays

Called from

Call sites

PlayerCanRestoreRecognisedName(player, target)

server gamemodes/catwork/gamemode/core/libraries/sv_player.lua:2339

Called to check whether a saved recognised name is restored when both players are on.

When it does not return true the saved name is forgotten. Catwork allows it for anyone but the player themselves.

Parameters

  • player Player The player who recognised the target
  • target Player The player who was recognised

Returns

  • Boolean true to restore the name

Called from

Call sites

PlayerCanSaveRecognisedName(player, target)

server gamemodes/catwork/gamemode/core/libraries/sv_player.lua:2385

Called to check whether a recognised name may be saved with the character.

Only asked when save_recognised_names is enabled and a player recognises someone with RECOGNISE_SAVE; when it does not return true the recognition only lasts for the session (RECOGNISE_TOTAL). Catwork allows it for anyone but the player themselves.

Parameters

  • player Player The player recognising
  • target Player The player being recognised

Returns

  • Boolean true to save the name

Called from

Call sites

PlayerCanSayIC(player, message.text)

server gamemodes/catwork/gamemode/core/libraries/sv_chatbox.lua:611

Called when a player attempts to say something in character.

Dead or fallen over players cannot talk, unless they have a death code (for the death code prompt). Return false to block the message.

Parameters

  • player Player The player
  • text String The message

Returns

  • Boolean Whether the message is sent

Call sites

PlayerCanSayLOOC(player, message.text)

server gamemodes/catwork/gamemode/core/libraries/sv_chatbox.lua:598

Called when a player attempts to say something local out of character; always allows it.

Parameters

  • player Player The player
  • text String The message

Returns

  • Boolean Whether the message is sent

Call sites

PlayerCanSayOOC(player, message.text)

server gamemodes/catwork/gamemode/core/libraries/sv_chatbox.lua:585

Called when a player attempts to say something out of character; always allows it.

Parameters

  • player Player The player
  • text String The message

Returns

  • Boolean Whether the message is sent

Call sites

Called to check whether an admin local player sees the admin ESP; follows the cwAdminESP ConVar.

Returns

  • Boolean Whether the ESP is drawn

Called from

Call sites

Called to check whether the local player sees a group of HUD bars.

tab bars show in the info menu (when cwTopBars is off), top bars show while alive (when cwTopBars is on), and other groups always show.

Parameters

  • class String The bar group, such as top or tab

Returns

  • Boolean Whether the bars are drawn

Called from

Call sites

Called to check whether an item is listed in the business menu; always lists it.

Parameters

  • itemTable Item The item

Returns

  • Boolean Whether the item is listed

Called from

Call sites

PlayerCanSeeCenterHints()

client gamemodes/catwork/gamemode/core/cl_kernel.lua:1161

Called to check whether the local player sees the center hints; always shows them.

Returns

  • Boolean Whether the hints are drawn

Called from

Call sites

Called to check whether a class is listed in the classes menu; always lists it.

Parameters

  • class Class The class

Returns

  • Boolean Whether the class is listed

Called from

Call sites

Called to check whether the local player sees the date and time; shown in the info menu.

Returns

  • Boolean Whether the date and time are drawn

Called from

Call sites

Called to check whether the local player sees the top hints; always shows them.

Returns

  • Boolean Whether the hints are drawn

Called from

Call sites

PlayerCanSeeLimbDamage()

client gamemodes/catwork/gamemode/core/cl_kernel.lua:1088

Called to check whether the local player sees their limb damage.

It is shown in the info menu when limb_damage_system is enabled.

Returns

  • Boolean Whether the limb damage is drawn

Called from

Call sites

PlayerCanSeePlayerInfo()

client gamemodes/catwork/gamemode/core/cl_kernel.lua:1842

Called to check whether the local player sees their player info text; shown in the info menu.

Returns

  • Boolean Whether the player info is drawn

Called from

Call sites

PlayerCanSeeStatus(player, v)

server gamemodes/catwork/gamemode/core/sv_kernel.lua:2651

Called for every initialized player when an admin runs cwStatus, to get the status line shown for them.

Parameters

  • player Player The admin running the command
  • target Player The player listed

Returns

  • String The line to print (user ID, name
  • Steam name
  • Steam ID and IP), or nil to hide the player

Call sites

PlayerCanSeeUnconscious()

client gamemodes/catwork/gamemode/hooks/cl_hooks.lua:2515

Called to check whether the local player can see while unconscious; never by default, so the screen goes black.

Returns

  • Boolean Whether the player can see

Called from

Call sites

PlayerCanShowUnrecognised(entity, x, y, unrecognisedName, teamColor, alpha, flashAlpha)

client gamemodes/catwork/gamemode/hooks/cl_hooks.lua:1538

Called when the target ID of an unrecognised player is drawn; draws the unrecognised name.

GM:HUDDrawTargetID passes the arguments as (player, x, y, unrecognisedName, teamColor, alpha, flashAlpha), so from color onwards they are shifted by one compared to these names.

Parameters

  • player Player The player looked at
  • x Number The text x position
  • y Number The text y position
  • color String The unrecognised name (see above)
  • alpha Color The team colour (see above)
  • flashAlpha Number The text alpha (see above)

Returns

  • Any true to draw the unrecognised name, a string to draw that text instead, a number to draw nothing and continue at that y position

Called from

Call sites

PlayerCanSwitchCharacter(player, character)

server gamemodes/catwork/gamemode/core/libraries/sv_player.lua:2240

Called when a player who already has a character loaded attempts to switch to another.

Refuses while dead (unless the character menu was reset or the character is banned) and while knocked out.

Parameters

  • player Player The player
  • character Character The character to switch to

Returns

  • Any nil or true to allow; anything else refuses, and a string is shown as the reason

Called from

Call sites

PlayerCanTakeFromStorage(player, storageTable, itemTable)

server gamemodes/catwork/gamemode/core/libraries/sv_storage.lua:530

Called to check whether a player can take an item out of storage.

Refuses, with a notification and a log entry, when the item was stored by another character (see cw.entity:BelongsToAnotherCharacter); otherwise clears the item's owner tag.

Parameters

  • player Player The player taking the item
  • storageTable Map The open storage
  • itemTable Item The item being taken

Returns

  • Boolean Whether the item can be taken

Called from

Call sites

Called when a player attempts to throw a punch with cw_hands; always allows it.

Parameters

  • player Player The player punching

Returns

  • Boolean Whether the punch is thrown

Called from

Call sites

PlayerCanUnlockEntity(player, door)

server gamemodes/catwork/gamemode/core/libraries/sv_player.lua:1914

Called when a player attempts to unlock an entity with the keys; doors need door access, other entities are allowed.

Parameters

  • player Player The player
  • entity Entity The entity

Returns

  • Boolean Whether the entity can be unlocked

Called from

Call sites

PlayerCanUnragdoll(player, state, ragdollTable)

server gamemodes/catwork/gamemode/core/libraries/sv_player.lua:3343

Called when a player attempts to be unragdolled; always allows it.

Parameters

  • player Player The player
  • state Number The ragdoll state (RAGDOLL_*)
  • ragdoll Map The player's ragdoll table

Returns

  • Boolean Whether the player gets up

Called from

Call sites

PlayerCanUseCharacter(player, character)

server gamemodes/catwork/gamemode/core/libraries/sv_player.lua:2222

Called when a player attempts to use a character.

Refuses banned characters and characters whose faction or faction rank is at its playerLimit.

Parameters

  • player Player The player
  • character Character The character to use

Returns

  • Any nil or true to allow; anything else refuses, and a string is shown as the reason

Called from

Call sites

PlayerCanUseCommand(player, commandTable, arguments)

server gamemodes/catwork/gamemode/core/libraries/sh_command.lua:237

Called when a player attempts to use a command, before argument and access checks; always allows it.

Parameters

  • player Player The player
  • commandTable Command The command
  • arguments List<String> The command arguments

Returns

  • Boolean Whether the command runs

Called from

Call sites

PlayerCanUseDoor(player, trace.Entity)

server gamemodes/catwork/gamemode/hooks/sv_hooks.lua:4466

Called when a player presses use on a door, to check whether they can open it.

Owned doors need door access and false doors cannot be used. When allowed, PlayerUseDoor runs and the door is opened.

Parameters

  • player Player The player
  • door Entity The door

Returns

  • Boolean Whether the door opens

Called from

Call sites

PlayerCanUseEntityInVehicle(player, trace.Entity, vehicle)

server gamemodes/catwork/gamemode/hooks/sv_hooks.lua:2504

Called to check whether a player in a vehicle can use the entity they look at.

Allowed for doors and entities with UsableInVehicle set; while it returns true for the looked at entity, the use key does not exit the vehicle.

Parameters

  • player Player The player
  • entity Entity The entity looked at
  • vehicle Vehicle The player's vehicle

Returns

  • Boolean Whether the entity can be used

Called from

Call sites

PlayerCanUseItem(player, itemTable)

shared gamemodes/catwork/gamemode/core/commands/sh_invaction.lua:59

Called when a player attempts to use an item from their inventory.

Catwork refuses, with a notification unless bNoMsg is set, when the item is a weapon the player already has as a spawn weapon. Return false to block the use.

Parameters

  • player Player The player
  • itemTable Item The item
  • bNoMsg Boolean optional, defaults to nil Whether to skip notifying the player

Returns

  • Boolean Whether the item can be used

Called from

Call sites

PlayerCanUseLoweredWeapon(player, weapon, bIsSecondary)

server gamemodes/catwork/gamemode/hooks/sv_hooks.lua:468

Called to check whether a player can fire a weapon while it is lowered.

Allowed when the weapon, or its Primary/Secondary table, has NeverRaised set.

Parameters

  • player Player The player firing
  • weapon Weapon The lowered weapon
  • secondary Boolean Whether this is the secondary attack

Returns

  • Boolean Whether the lowered weapon can fire

Called from

Call sites

PlayerCanViewDoor(ply, entity)

server gamemodes/catwork/gamemode/hooks/sv_hooks.lua:4115

Called when a player attempts to view a door's menu; refuses doors marked unownable.

Parameters

  • player Player The player
  • door Entity The door

Returns

  • Boolean Whether the door menu opens

Called from

Call sites

Called when the local player attempts to zoom with +zoom; always allows it.

Returns

  • Boolean Whether the zoom bind runs

Called from

Call sites

PlayerCashUpdated(player, roundedAmount, reason, bNoMsg)

server gamemodes/catwork/gamemode/core/libraries/sv_player.lua:2730

Called after a player's cash has changed; syncs it with their open storage via cw.storage:SyncCash.

Parameters

  • player Player The player whose cash changed
  • amount Number The amount given (negative when taken)
  • reason String Why the cash changed, or nil
  • bNoMsg Boolean Whether the change should be silent

Called from

Call sites

PlayerCharacterCreated(player, character)

server gamemodes/catwork/gamemode/core/libraries/sv_player.lua:3741

Called after a player has created a character, before it is added to the character menu; does nothing by default.

Parameters

  • player Player The player
  • character Character The new character

Call sites

PlayerCharacterDataChanged(self, key, oldValue, value)

server gamemodes/catwork/gamemode/core/sv_kernel.lua:3132

No documentation available.

Arguments

  • self
  • key
  • oldValue
  • value

Called from

Call sites

PlayerCharacterInitialized(data)

shared gamemodes/catwork/gamemode/hooks/cl_nethooks.lua:61

Called when a player's character has initialized, while it loads.

Clears and resends the player's inventory, attributes and limb damage, assigns the default class when needed, queues the starter hints, sends CharacterInit to the client, and sets the faction rank (the default or lowest one, or SCN when the name contains SCN), applying the rank's class and model.

Parameters

  • player Player The player

Called from

Call sites

Called when a player's character has loaded.

Resets the player's per-character state and movement values, runs PlayerRestoreCharacterData and PlayerCharacterInitialized, restores recognised names and property, and marks the player initialized. Clears any stored OnNextLoad payload without running it, runs each item's OnRestorePlayerGear, gives the saved player flags and restores the saved class.

Parameters

  • player Player The player

Called from

Call sites

PlayerCharacterScreenCreated(cw.character.panel)

client gamemodes/catwork/gamemode/hooks/cl_hooks.lua:937

Called when the local player's character screen is created; asks the server for the quiz status.

The status is only requested when the quiz is enabled.

Parameters

  • panel Panel The character menu

Called from

Call sites

PlayerCharacterUnloaded(player)

server gamemodes/catwork/gamemode/core/libraries/sv_player.lua:3759

Called when a player's character has unloaded.

Schedules the character's property for removal, disables it, resets the ragdoll, closes storage and unassigns the team. When called by GM:PlayerDisconnected, returning true keeps the character from being saved.

Parameters

  • player Player The player

Called from

Call sites

PlayerClassSet(player, newClass, oldClass, noRespawn, addDelay, noModelChange)

server gamemodes/catwork/gamemode/core/libraries/sh_class.lua:336

Called after a player's class has been set; saves the class name in the character data.

Parameters

  • player Player The player
  • newClass Class The new class
  • oldClass Class The previous class
  • noRespawn Boolean Whether the player is not respawned
  • addDelay Boolean Whether a class change delay is added
  • noModelChange Boolean Whether the model is kept

Called from

Call sites

PlayerConfigInitialized(player)

server gamemodes/catwork/gamemode/core/libraries/sh_config.lua:439

Called when the config has been sent to a player.

Runs PlayerSendDataStreamInfo, then tells clients to start data streaming; bots skip straight to PlayerDataStreamInfoSent.

Parameters

  • player Player The player

Called from

Call sites

PlayerDataChanged(self, key, oldValue, value)

server gamemodes/catwork/gamemode/core/sv_kernel.lua:3152

No documentation available.

Arguments

  • self
  • key
  • oldValue
  • value

Called from

Call sites

PlayerDataLoaded(player)

server gamemodes/catwork/gamemode/hooks/sv_hooks.lua:1527

Called when a player's data has loaded.

Shows the Catwork intro once per player when clockwork_intro_enabled is set.

Parameters

  • player Player The player whose data loaded

Call sites

PlayerDataStreamInfoSent(player)

server gamemodes/catwork/gamemode/hooks/sv_hooks.lua:3689

Called after a player's initial data stream info has been sent.

Bots get a random faction, gender and model and load a character straight away. Real players have their data loaded (running PlayerDataLoaded), their whitelists sent and their characters added to the character menu. A character for which PlayerAdjustCharacterTable returns true is deleted instead.

Parameters

  • player Player The player the data was sent to

Called from

Call sites

PlayerDeath(player, inflictor, attacker, damageInfo)

server gamemodes/catwork/gamemode/hooks/sv_hooks.lua:4277

Called when a player dies.

Starts the respawn timer with cw.core:CalculateSpawnTime, disintegrates the ragdoll when killed by a combine ball, and logs the kill.

Parameters

  • player Player The player
  • inflictor Entity The inflictor
  • attacker Entity The killer
  • damageInfo CTakeDamageInfo The fatal damage, or nil

Called from

Call sites

PlayerDeathCodeUsed(player, commandTable, arguments)

server gamemodes/catwork/gamemode/core/libraries/sv_player.lua:1852

Called when a player has used their death code, before it is taken; does nothing by default.

Parameters

  • player Player The player
  • commandTable Command The command that used the death code
  • arguments List<String> The command arguments

Called from

Call sites

PlayerDeleteCharacter(player, character)

server gamemodes/catwork/gamemode/core/libraries/sv_player.lua:2155

Called after a player deletes a character; does nothing by default.

Parameters

  • player Player The player
  • character Character The deleted character

Called from

Call sites

PlayerDestroyItem(player, itemTable)

server gamemodes/catwork/gamemode/core/libraries/sh_item.lua:996

Called after a player destroys an item; does nothing by default.

Parameters

  • player Player The player who destroyed it
  • itemTable Item The item

Called from

Call sites

PlayerDoesHaveDoorAccess(player, doorParent, access, isAccurate)

server gamemodes/catwork/gamemode/core/libraries/sv_player.lua:2650

Called by cw.player:HasDoorAccess to check whether a player has an access level on a door.

The door's owner always has access; other characters need an entry in door.accessList.

Parameters

  • player Player The player
  • door Entity The door, or the door's parent when it has one
  • access Number The access level required (DOOR_ACCESS_*)
  • isAccurate Boolean true to require exactly that level instead of at least it

Returns

  • Boolean Whether the player has the access

Called from

Call sites

PlayerDoesHaveFlag(player, flag)

shared gamemodes/catwork/gamemode/core/libraries/cl_player.lua:656

Called by cw.player:HasFlags to check whether a player has a flag they do not hold themselves.

Catwork grants the flags in the default_flags config to everyone.

Parameters

  • player Player The player
  • flag String A single flag

Returns

  • Boolean true to grant the flag, false to deny it, nil to fall through

Called from

Call sites

PlayerDoesRecognisePlayer(player, target, status, isAccurate, realValue)

shared gamemodes/catwork/gamemode/core/libraries/cl_player.lua:529

Called after recognition is worked out, to override whether a player recognises another.

Catwork returns the computed value unchanged.

Parameters

  • player Player The player who may recognise the target
  • target Player The player who may be recognised
  • status Number The recognition level asked about (RECOGNISE_*)
  • isAccurate Boolean Whether the level must match exactly
  • realValue Boolean Whether the player recognises the target according to the saved names

Returns

  • Boolean Whether the player recognises the target

Called from

Call sites

No documentation available.

Arguments

  • player
  • door

Called from

Call sites

No documentation available.

Arguments

  • player
  • door

Called from

Call sites

PlayerDropItem(player, itemTable, position, entity)

server gamemodes/catwork/gamemode/core/libraries/sh_item.lua:965

Called after a player drops an item; does nothing by default.

Parameters

  • player Player The player who dropped it
  • itemTable Item The item
  • position Vector Where it was dropped
  • entity Entity The spawned item entity

Called from

Call sites

PlayerDropWeapon(player, itemTable, entity, weapon)

shared gamemodes/catwork/gamemode/core/commands/sh_dropweapon.lua:36

Called after a player drops a weapon; saves the weapon's clip ammo on its item.

Parameters

  • player Player The player who dropped it
  • itemTable Item The weapon's item
  • entity Entity The spawned item entity
  • weapon Weapon The weapon that was dropped

Called from

Call sites

PlayerEarnWagesCash(v, info.wages)

server gamemodes/catwork/gamemode/core/sv_kernel.lua:822

Called after a player has earned wages; does nothing by default.

Parameters

  • player Player The player
  • cash Number The wages amount

Called from

Call sites

PlayerFireWeapon(self, activeWeapon, CLIP_ONE, activeWeapon:GetPrimaryAmmoType())

server gamemodes/catwork/gamemode/core/sv_kernel.lua:1515

No documentation available.

Arguments

  • self
  • activeWeapon
  • CLIP_ONE
  • activeWeapon:GetPrimaryAmmoType()

Called from

Call sites

PlayerFlagsGiven(player, flag)

server gamemodes/catwork/gamemode/core/libraries/sv_player.lua:1440

Called when a player has been given flags.

Gives the physgun for p and the toolgun for t if the player is alive, and networks the player's flags.

Parameters

  • player Player The player given the flags
  • flags String The flags that were given

Called from

Call sites

PlayerFlagsTaken(player, flag)

server gamemodes/catwork/gamemode/core/libraries/sv_player.lua:1655

Called when a player has had flags taken.

Takes the physgun for p and the toolgun for t unless the player still has the flag (for example from the default flags), and networks the player's flags.

Parameters

  • player Player The player whose flags were taken
  • flags String The flags that were taken

Called from

Call sites

PlayerGetHoldingEntity(self)

server gamemodes/catwork/gamemode/core/sv_kernel.lua:2600

Called by Player:GetHoldingEntity to get the entity a player is holding.

Return an entity to override player.cwIsHoldingEnt.

Parameters

  • player Player The player

Returns

  • Entity The held entity, or nil to use the default

Called from

Call sites

PlayerGivenWeapon(self, class, itemTable)

server gamemodes/catwork/gamemode/core/sv_kernel.lua:1217

Called after a player has been given a weapon.

Rebuilds the inventory menu and attaches visible gear for weapon items: Throwable, Melee, Secondary (weight 2 or less) or Primary.

Parameters

  • player Player The player given the weapon
  • class String The weapon class
  • itemTable Item The weapon's item, or nil

Called from

Call sites

PlayerGiveToStorage(player, storageTable, itemTable)

server gamemodes/catwork/gamemode/core/libraries/sv_storage.lua:469

Called after a player has put an item in storage; takes it off if it was worn as clothes or an accessory.

Parameters

  • player Player The player who stored the item
  • storageTable Map The open storage
  • itemTable Item The stored item

Called from

Call sites

PlayerGiveWagesCash(v, info.wages, v:GetWagesName())

server gamemodes/catwork/gamemode/core/sv_kernel.lua:817

Called before positive wages are given to a player; return false to keep the cash from being given.

Parameters

  • player Player The player
  • cash Number The wages amount
  • wagesName String The name the wages are given under

Returns

  • Boolean Whether the cash is given

Called from

Call sites

PlayerGiveWeapons(player)

server gamemodes/catwork/gamemode/hooks/sv_hooks.lua:4078

Called when a player's spawn weapons should be given; gives the weapons listed by their faction rank and faction.

Parameters

  • player Player The player

Called from

Call sites

PlayerHealthRegenerate(player, player:Health(), player:GetMaxHealth())

server gamemodes/catwork/gamemode/hooks/sv_hooks.lua:155

Called once a second to regenerate a living player's health.

Heals 2 health every 5 seconds while above half health, otherwise every 10 seconds.

Parameters

  • player Player The player to heal
  • health Number The player's health
  • maxHealth Number The player's maximum health

Called from

Call sites

PlayerHealthSet(self, health, oldHealth)

server gamemodes/catwork/gamemode/core/sv_kernel.lua:1358

Called when a player's health is set.

Healing also heals limb damage by half the amount gained; reaching full health heals every limb and removes decals from the player and their ragdoll. Keeps a ragdolled player's stored health in sync.

Parameters

  • player Player The player
  • newHealth Number The new health
  • oldHealth Number The previous health

Called from

Call sites

PlayerHolsterWeapon(player, itemTable, v, true)

shared gamemodes/catwork/gamemode/core/items/sh_grenade_base.lua:55

No documentation available.

Arguments

  • player
  • itemTable
  • v
  • true

Called from

Call sites

PlayerInventoryRebuilt(self, categories)

client gamemodes/catwork/gamemode/core/derma/cl_inventory.lua:147

No documentation available.

Arguments

  • self
  • categories

Called from

Call sites

PlayerItemGiven(self, itemTable, bForce)

shared gamemodes/catwork/gamemode/core/libraries/sh_inventory.lua:472

Called after a player is given an item; syncs it with their open storage via cw.storage:SyncItem.

Parameters

  • player Player The player given the item
  • itemTable Item The item given
  • bForce Boolean Whether the item was forced into the inventory regardless of weight

Called from

Call sites

PlayerItemTaken(self, itemTable)

shared gamemodes/catwork/gamemode/core/libraries/sh_inventory.lua:507

Called after a player has an item taken.

Syncs the item with their open storage and takes it off if it was worn as clothes or an accessory.

Parameters

  • player Player The player the item was taken from
  • itemTable Item The item taken

Called from

Call sites

PlayerKnockOnDoor(self:GetOwner(), trace.Entity)

server gamemodes/catwork/gamemode/core/entities/weapons/cw_hands/shared.lua:204

No documentation available.

Arguments

  • self:GetOwner()
  • trace.Entity

Called from

Call sites

PlayerLimbDamageHealed(player, hitGroup, newAmount)

shared gamemodes/catwork/gamemode/core/libraries/sh_limb.lua:109

Called when a player's limb damage is healed; does nothing by default.

Parameters

  • player Player The healed player
  • hitGroup Number The hit group (HITGROUP_*)
  • amount Number The limb's new damage amount

Called from

Call sites

Called when the local player's limb damage is received from the server; does nothing by default.

Call sites

PlayerLimbDamageReset(player)

shared gamemodes/catwork/gamemode/core/libraries/sh_limb.lua:124

Called when a player's limb damage is reset; does nothing by default.

Parameters

  • player Player The player whose limb damage was reset

Called from

Call sites

PlayerLimbTakeDamage(player, hitGroup, newDamage)

shared gamemodes/catwork/gamemode/core/libraries/sh_limb.lua:66

Called when a player's limb takes damage; does nothing by default.

Parameters

  • player Player The hurt player
  • hitGroup Number The hit group (HITGROUP_*)
  • damage Number The damage taken

Called from

Call sites

Called when a player's spawn weapons should be given.

Gives the toolgun and physgun for the t and p flags (with the player's weapon colour when custom_weapon_color is set), the gravity gun, cw_hands and cw_keys when configured, and the class's weapons and ammo, then runs PlayerGiveWeapons and selects the hands.

Parameters

  • player Player The player

Call sites

PlayerModelChanged(player, sNewModel, sOldModel)

shared gamemodes/catwork/gamemode/core/sh_kernel.lua:1372

Called after a player's model is changed with Player:SetModel, on both realms.

Catwork caches the model's animation table from cw.animation:GetTable and stores it as player.cwAnimTable, which GM:TranslateActivity uses. On the client it also disables IK.

Parameters

  • player Player The player whose model changed
  • strNewModel String Path of the new model
  • strOldModel String Path of the previous model

Called from

Call sites

PlayerModifyWagesInfo(v, info)

server gamemodes/catwork/gamemode/core/sv_kernel.lua:813

Called before a player is paid wages, to change the amount; does nothing by default.

Parameters

  • player Player The player being paid
  • info Map Has wages, the amount to pay, which can be changed

Called from

Call sites

PlayerNameChanged(player, previousName, newName)

server gamemodes/catwork/gamemode/core/libraries/sv_player.lua:2528

No documentation available.

Arguments

  • player
  • previousName
  • newName

Called from

Call sites

PlayerNameCleared(player, status, isAccurate)

server gamemodes/catwork/gamemode/core/libraries/sv_player.lua:2482

No documentation available.

Arguments

  • player
  • status
  • isAccurate

Called from

Call sites

PlayerPickupItem(player, itemTable, entity, bQuickUse)

server gamemodes/catwork/gamemode/hooks/sv_hooks.lua:3059

Called after a player picks up an item entity; does nothing by default.

Parameters

  • player Player The player who picked it up
  • itemTable Item The item
  • itemEntity Entity The item entity that was picked up
  • bQuickUse Boolean Whether the item was used straight away instead of taken

Called from

Call sites

PlayerPlayDeathSound(player, player:GetGender())

server gamemodes/catwork/gamemode/hooks/sv_hooks.lua:3864

Called to choose the sound a player makes when they die; returns a random HL2 citizen pain line.

Parameters

  • player Player The dying player
  • gender String The player's gender

Returns

  • String The sound path, or nil for no sound

Called from

Call sites

PlayerPlayPainSound(player, player:GetGender(), damageInfo, lastHitGroup)

server gamemodes/catwork/gamemode/hooks/sv_hooks.lua:4282

Called to choose the pain sound a player makes when hurt.

Half of bullet hits play a hit group specific HL2 citizen line (head, gut, leg, arm, gear); everything else plays a random pain line.

Parameters

  • player Player The hurt player
  • gender String The player's gender, male or female
  • damageInfo CTakeDamageInfo The damage taken
  • hitGroup Number The hit group (HITGROUP_*)

Returns

  • String The sound path, or nil for no sound

Called from

Call sites

PlayerPreRebuildStorage(storagePanel)

client gamemodes/catwork/gamemode/core/derma/cl_storage.lua:75

No documentation available.

Arguments

  • storagePanel

Called from

Call sites

PlayerPropertyGiven(player, entity, networked, removeDelay)

server gamemodes/catwork/gamemode/core/libraries/sv_player.lua:950

No documentation available.

Arguments

  • player
  • entity
  • networked
  • removeDelay

Called from

Call sites

PlayerPropertyGivenOffline(key, uniqueID, entity, networked, removeDelay)

server gamemodes/catwork/gamemode/core/libraries/sv_player.lua:1003

No documentation available.

Arguments

  • key
  • uniqueID
  • entity
  • networked
  • removeDelay

Called from

Call sites

PlayerPropertyTaken(player, entity)

server gamemodes/catwork/gamemode/core/libraries/sv_player.lua:1067

No documentation available.

Arguments

  • player
  • entity

Called from

Call sites

PlayerPropertyTakenOffline(key, uniqueID, entity)

server gamemodes/catwork/gamemode/core/libraries/sv_player.lua:1040

No documentation available.

Arguments

  • key
  • uniqueID
  • entity

Called from

Call sites

PlayerPunchEntity(self:GetOwner(), trace.Entity)

server gamemodes/catwork/gamemode/core/entities/weapons/cw_hands/shared.lua:142

No documentation available.

Arguments

  • self:GetOwner()
  • trace.Entity

Called from

Call sites

PlayerPunchKnockout(self:GetOwner(), trace.Entity)

server gamemodes/catwork/gamemode/core/entities/weapons/cw_hands/shared.lua:139

No documentation available.

Arguments

  • self:GetOwner()
  • trace.Entity

Called from

Call sites

No documentation available.

Arguments

  • self:GetOwner()

Called from

Call sites

PlayerRadioUsed(player, info.text, listeners, eavesdroppers)

server gamemodes/catwork/gamemode/core/libraries/sv_player.lua:2001

Called after a player has spoken on the radio; does nothing by default.

Parameters

  • player Player The player
  • text String The message
  • listeners List<Player> Players who heard it over the radio
  • eavesdroppers List<Player> Players nearby who overheard it

Called from

Call sites

PlayerRagdollCanTakeDamage(player, entity, inflictor, attacker, hitGroup, damageInfo)

server gamemodes/catwork/gamemode/hooks/sv_hooks.lua:4323

Called when a ragdolled player's ragdoll attempts to take damage.

Damage from non-players is ignored while the ragdoll's immunity time has not passed.

Parameters

  • player Player The ragdolled player
  • ragdoll Entity The ragdoll
  • inflictor Entity The inflictor
  • attacker Entity The attacker
  • hitGroup Number The hit group (HITGROUP_*)
  • damageInfo CTakeDamageInfo The damage

Returns

  • Boolean Whether the damage is applied to the player

Called from

Call sites

PlayerRagdolled(player, state, player.cwRagdollTab)

server gamemodes/catwork/gamemode/core/libraries/sv_player.lua:3221

Called after a player has been ragdolled; clears the fallen over flag.

Parameters

  • player Player The player
  • state Number The ragdoll state (RAGDOLL_*)
  • ragdoll Map The player's ragdoll table

Called from

Call sites

PlayerRecognisedNamesCleared(player, status, isAccurate)

server gamemodes/catwork/gamemode/core/libraries/sv_player.lua:2463

No documentation available.

Arguments

  • player
  • status
  • isAccurate

Called from

Call sites

PlayerRestoreCharacterData(player, player:QueryCharacter('Data'))

server gamemodes/catwork/gamemode/hooks/sv_hooks.lua:3608

Called when a player's character data is restored as the character loads.

Cleans up the physical description and makes sure LimbData, Clothes and Accessories exist before passing the data to cw.player:RestoreCharacterData.

Parameters

  • player Player The player loading the character
  • data Map The character's saved data, modified in place

Called from

Call sites

PlayerRestoreData(player, player.cwData)

server gamemodes/catwork/gamemode/core/libraries/sv_player.lua:3963

Called when a player's (not character's) data is restored; makes sure Whitelisted exists.

Parameters

  • player Player The player
  • data Map The player's saved data, modified in place

Call sites

Called after a player's property has been returned to their character; does nothing by default.

Parameters

  • player Player The player

Called from

Call sites

PlayerSaveCharacterData(player, data)

server gamemodes/catwork/gamemode/core/libraries/sv_player.lua:3833

Called when a player's character data is about to be saved.

Saves attribute boosts when save_attribute_boosts is set, and health and armor when they are above 1.

Parameters

  • player Player The player whose character is saved
  • data Map The character data to save, modified in place

Called from

Call sites

Called when a player's (not character's) data is about to be saved; drops an empty Whitelisted table.

Parameters

  • player Player The player whose data is saved
  • data Map The player data to save, modified in place

Called from

Call sites

PlayerScaleDamageByHitGroup(player, attacker, hitGroup, damageInfo, baseDamage)

server gamemodes/catwork/gamemode/hooks/sv_hooks.lua:4631

Called to scale damage a player takes by hit group.

Catwork cuts damage from vehicles and from players in vehicles to a quarter.

Parameters

  • player Player The player taking damage
  • attacker Entity The attacker
  • hitGroup Number The hit group (HITGROUP_*)
  • damageInfo CTakeDamageInfo The damage to scale in place
  • baseDamage Number The damage before scaling

Called from

Call sites

PlayerSelectCustomCharacterOption(player, action, character)

server gamemodes/catwork/gamemode/hooks/sv_nethooks.lua:200

Called when a player picks a character menu action other than use or delete; does nothing by default.

Parameters

  • player Player The player
  • action String The action
  • character Character The character

Call sites

PlayerSendDataStreamInfo(player)

server gamemodes/catwork/gamemode/hooks/sv_hooks.lua:3680

Called when a player's initial data stream info should be sent; sends the shared tables and any colour mod override.

Parameters

  • player Player The player to send the data to

Called from

Call sites

PlayerSetDefaultColorModify(cw.ColorModify)

client gamemodes/catwork/gamemode/hooks/cl_hooks.lua:2326

Called to set the local player's default colour modification when no override is active; does nothing by default.

Parameters

  • colorModify Map The $pp_colour_* values, modified in place

Called from

Call sites

Called when a player's model should be set; applies their default model and skin.

Parameters

  • player Player The player

Called from

Call sites

PlayerShouldHealthRegenerate(player)

server gamemodes/catwork/gamemode/hooks/sv_hooks.lua:154

Called once a second, when health regeneration is enabled, to check whether a player regenerates.

Always allows it.

Parameters

  • player Player The player

Returns

  • Boolean Whether PlayerHealthRegenerate runs for the player

Called from

Call sites

PlayerShouldShowOnDoorAccessList(v, door, owner)

client gamemodes/catwork/gamemode/core/derma/cl_door.lua:179

Called to check whether a player appears in the door access menu; always shows them.

Parameters

  • player Player The player
  • door Entity The door
  • owner Player The door's owner

Returns

  • Boolean Whether the player is listed

Called from

Call sites

PlayerShouldShowOnScoreboard(v)

client gamemodes/catwork/gamemode/core/derma/cl_scoreboard.lua:46

Called to check whether a player appears on the scoreboard; always shows them.

Parameters

  • player Player The player

Returns

  • Boolean Whether the player is listed

Called from

Call sites

PlayerShouldTakeDamage(player, attacker, inflictor, damageInfo)

server gamemodes/catwork/gamemode/core/sv_kernel.lua:948

Called when a player would take damage; players in noclip take none.

Parameters

  • player Player The player
  • attacker Entity The attacker
  • inflictor Entity The inflictor
  • damageInfo CTakeDamageInfo The damage

Returns

  • Boolean Whether the damage is applied

Called from

Call sites

PlayerSkinChanged(self, skin)

server gamemodes/catwork/gamemode/core/sv_kernel.lua:1247

No documentation available.

Arguments

  • self
  • skin

Called from

Call sites

PlayerStorageRebuilt(storagePanel, categories)

client gamemodes/catwork/gamemode/core/derma/cl_storage.lua:156

No documentation available.

Arguments

  • storagePanel
  • categories

Called from

Call sites

PlayerStorageShouldClose(player, storageTable)

server gamemodes/catwork/gamemode/core/libraries/sv_storage.lua:16

Called every player think while a player has storage open, to check whether it should close.

Closes it when the player is ragdolled or dead, the storage entity is gone or out of storageTable.distance, or the storage's own ShouldClose callback returns true.

Parameters

  • player Player The player with storage open
  • storageTable Map The open storage

Returns

  • Boolean true to close the storage

Called from

Call sites

PlayerTakeDamage(player, inflictor, attacker, lastHitGroup, damageInfo)

server gamemodes/catwork/gamemode/hooks/sv_hooks.lua:4281

Called when a player (or their ragdoll) takes damage that does not kill them.

With limb damage stumbling enabled, a bullet to the legs while both legs are above 50 damage makes the player fall over for 8 seconds.

Parameters

  • player Player The player
  • inflictor Entity The inflictor
  • attacker Entity The attacker
  • hitGroup Number The hit group (HITGROUP_*)
  • damageInfo CTakeDamageInfo The damage

Returns

  • Boolean true to suppress the pain sound

Called from

Call sites

PlayerTakeFromStorage(player, storageTable, itemTable)

server gamemodes/catwork/gamemode/core/libraries/sv_storage.lua:547

No documentation available.

Arguments

  • player
  • storageTable
  • itemTable

Called from

Call sites

PlayerThink(v, curTime, infoTable)

server gamemodes/catwork/gamemode/hooks/sv_hooks.lua:1829

Called every 0.15 seconds for every initialized player.

GM:Tick resets infoTable to the defaults before calling this, so plugins can adjust it here. Catwork tracks how long the player has been underwater, keeps ragdolled players in observer movement, closes storage when PlayerStorageShouldClose says so, networks inventory weight, space and wages, slows the player for leg damage and when walking backwards, updates weapon raising and saves the active weapon item's clip ammo.

Parameters

  • player Player The player being updated
  • curTime Number The current CurTime()
  • infoTable Map The player's info table with inventoryWeight, inventorySpace, crouchedSpeed, jumpPower, walkSpeed, runSpeed, isRunning, isJumping and wages

Called from

Call sites

PlayerUnragdolled(player, state, ragdollTable)

server gamemodes/catwork/gamemode/core/libraries/sv_player.lua:3408

Called after a player has been unragdolled; clears the fallen over flag.

Parameters

  • player Player The player
  • state Number The ragdoll state (RAGDOLL_*)
  • ragdoll Map The player's ragdoll table

Called from

Call sites

Called when a player attempts to use an entity; players who have fallen over cannot use anything.

Parameters

  • player Player The player using the entity
  • entity Entity The entity being used

Returns

  • Boolean Whether the use is allowed

Called from

Call sites

PlayerUseDoor(player, trace.Entity)

server gamemodes/catwork/gamemode/hooks/sv_hooks.lua:4467

Called when a player opens a door with use, just before it opens; does nothing by default.

Parameters

  • player Player The player
  • door Entity The door

Called from

Call sites

PlayerUseItem(player, itemTable, itemEntity)

server gamemodes/catwork/gamemode/core/libraries/sh_item.lua:905

Called after a player uses an item; does nothing by default.

Parameters

  • player Player The player who used it
  • itemTable Item The item
  • itemEntity Entity The item entity it was used from, or nil when used from the inventory

Called from

Call sites

PlayerUseUnknownItemFunction(player, itemTable, itemAction)

shared gamemodes/catwork/gamemode/core/commands/sh_invaction.lua:63

Called when a player runs an inventory action that Catwork does not handle; does nothing by default.

Parameters

  • player Player The player
  • itemTable Item The item
  • itemFunction String The action name

Called from

Call sites

No documentation available.

Arguments

  • parsed

Called from

Call sites

PostCModelHandsSet(player, model, entity, info)

server gamemodes/catwork/gamemode/hooks/sv_hooks.lua:1194

No documentation available.

Arguments

  • player
  • model
  • entity
  • info

Called from

Call sites

PostCommandUsed(player, commandTable, arguments)

server gamemodes/catwork/gamemode/core/libraries/sh_command.lua:275

Called after a player uses a command; does nothing by default.

Parameters

  • player Player The player who used the command
  • command Command The command used
  • arguments List<String> The arguments given with the command, if any

Called from

Call sites

PostDrawBackgroundBlurs()

client gamemodes/catwork/gamemode/hooks/cl_hooks.lua:2731

Called just after the background blurs have been drawn.

Draws the selected faction's image on the character screen, the title box of a titled menu and the date and time.

Called from

Call sites

Called just after a HUD bar is drawn; does nothing by default.

Parameters

  • barInfo Map The bar's position, size, colour, text and progress

Returns

  • Boolean true to skip drawing the bar's text

Called from

Call sites

PostDrawDateTimeBox(info)

client gamemodes/catwork/gamemode/core/cl_kernel.lua:1085

Called just after the date and time box is drawn in the info menu; does nothing by default.

Parameters

  • info Map The box's x, y and width

Called from

Call sites

PostDrawPlayerInfo(boxInfo, information, subInformation)

client gamemodes/catwork/gamemode/core/cl_kernel.lua:1913

Called just after the local player's information box is drawn; does nothing by default.

Parameters

  • boxInfo Map The box position and size
  • information Map The player info text lines
  • subInformation Map The player info sub text lines

Called from

Call sites

PostPlayerGiveToStorage(player, storageTable, itemTable)

server gamemodes/catwork/gamemode/core/libraries/sv_storage.lua:501

No documentation available.

Arguments

  • player
  • storageTable
  • itemTable

Called from

Call sites

PostPlayerLightSpawn(player, weapons, ammo, false)

server gamemodes/catwork/gamemode/core/libraries/sv_player.lua:3546

No documentation available.

Arguments

  • player
  • weapons
  • ammo
  • false

Call sites

PostPlayerSpawn(player, player.cwLightSpawn, player.cwChangeClass, player.cwFirstSpawn)

server gamemodes/catwork/gamemode/hooks/sv_hooks.lua:1137

Called just after a player spawns, from GM:PlayerSpawn.

On the first spawn of a character it restores saved health, armor and attribute boosts; later spawns clear them from the character data. Sets the player's target name to their faction.

Parameters

  • player Player The player
  • lightSpawn Boolean Whether this was a light spawn
  • changeClass Boolean Whether the spawn is from a class change
  • firstSpawn Boolean Whether this is the character's first spawn

Called from

Call sites

PostPlayerTakeFromStorage(player, storageTable, itemTable)

server gamemodes/catwork/gamemode/core/libraries/sv_storage.lua:578

No documentation available.

Arguments

  • player
  • storageTable
  • itemTable

Called from

Call sites

No documentation available.

Called from

Call sites

No documentation available.

Arguments

  • messageData

Called from

Call sites

Called just before a HUD bar is drawn; does nothing by default.

Parameters

  • barInfo Map The bar's position, size, colour, text and progress

Returns

  • Boolean true to skip drawing the bar's background and fill

Called from

Call sites

PreDrawPlayerInfo(boxInfo, information, subInformation)

client gamemodes/catwork/gamemode/core/cl_kernel.lua:1889

Called just before the local player's information box is drawn in the info menu; does nothing by default.

Parameters

  • boxInfo Map The box position and size
  • information Map The player info text lines
  • subInformation Map The player info sub text lines

Returns

  • Boolean true to skip drawing the box

Called from

Call sites

No documentation available.

Arguments

  • self

Called from

Call sites

PrePlayerTakeDamage(player, attacker, inflictor, damageInfo)

server gamemodes/catwork/gamemode/core/sv_kernel.lua:946

Called just before a player would take damage; does nothing by default.

Parameters

  • player Player The player
  • attacker Entity The attacker
  • inflictor Entity The inflictor
  • damageInfo CTakeDamageInfo The damage

Called from

Call sites

No documentation available.

Called from

Call sites

No documentation available.

Arguments

  • self

Called from

Call sites

No documentation available.

Arguments

  • self

Called from

Call sites

Called when Catwork data is saved.

Saves every initialized player's character and, unless they follow the machine clock, the in-game time and date.

Called from

Call sites

ScoreboardAdjustPlayerInfo(info)

client gamemodes/catwork/gamemode/core/derma/cl_scoreboard.lua:182

Called to adjust a player's scoreboard entry; does nothing by default.

Parameters

  • info Map The entry, with player, text and the other fields the scoreboard shows

Called from

Call sites

ScoreboardSortClassPlayers(k, a, b)

client gamemodes/catwork/gamemode/core/derma/cl_scoreboard.lua:55

Called to sort the players within a class on the scoreboard.

Players the local player recognises come first, and recognised players are sorted by team.

Parameters

  • class String The class name
  • a Player The first player
  • b Player The second player

Returns

  • Boolean Whether a comes before b

Call sites

No documentation available.

Arguments

  • self

Called from

Call sites

ShouldCharacterMenuBeCreated()

client gamemodes/catwork/gamemode/hooks/cl_hooks.lua:930

Called to check whether the character menu can be created yet; waits while the intro is fading out.

Returns

  • Boolean Whether the character menu is created

Called from

Call sites

ShouldDrawBackgroundBlurs()

client gamemodes/catwork/gamemode/hooks/cl_hooks.lua:2606

Called to check whether the background blurs are drawn; always draws them.

Returns

  • Boolean Whether the blurs are drawn

Called from

Call sites

ShouldDrawCharacterBackground()

client gamemodes/catwork/gamemode/hooks/cl_hooks.lua:2569

Called to check whether the black character menu background is drawn; always draws it.

Returns

  • Boolean Whether the background is drawn

Called from

Call sites

ShouldDrawCharacterBackgroundBlur()

client gamemodes/catwork/gamemode/core/derma/cl_character.lua:516

Called to check whether the character menu background blur is drawn; always draws it.

Returns

  • Boolean Whether the blur is drawn

Called from

Call sites

ShouldDrawPlayerTargetID(entity)

client gamemodes/catwork/gamemode/hooks/cl_hooks.lua:1506

Called to check whether a looked at player's target ID is drawn; always draws it.

Parameters

  • player Player The player looked at

Returns

  • Boolean Whether the target ID is drawn

Called from

Call sites

ShouldPlayerScreenFadeBlack()

client gamemodes/catwork/gamemode/core/cl_kernel.lua:2713

Called to check whether the local player's screen fades to black.

Fades while dead or fallen over, unless PlayerCanSeeUnconscious allows seeing.

Returns

  • Boolean Whether the screen fades to black

Called from

Call sites

TimePassed(TIME_MINUTE)

server gamemodes/catwork/gamemode/core/sv_kernel.lua:744

No documentation available.

Arguments

  • TIME_MINUTE

Called from

Call sites

TopLevelPlayerBindPress(player, bind, bPress)

client gamemodes/catwork/gamemode/hooks/cl_hooks.lua:513

No documentation available.

Arguments

  • player
  • bind
  • bPress

Called from

Call sites

Defined in