Skip to content

Compatibility

This page documents hooks in the compatibility category.


AdjustPACPartData(wearer, id, data)View Source

Purpose

Allows plugins or modules to modify a PAC part data table before it is attached to a wearer.

Category

Compatibility

Realm

Client

Parameters

Player wearer The player who will receive the PAC part.

string id The PAC part identifier being adjusted.

table data The mutable PAC part data table.

Returns

table|nil Return a replacement PAC part data table to override the adjusted result. Returning nil allows the default behavior to continue.

Example Usage

  hook.Add("AdjustPACPartData", "liaExampleAdjustPACPartData", function(wearer, id, data)
      data.selfillum = 1
      return data
  end)

AttachPart(client, id)View Source

Purpose

Runs when a tracked PAC part should be attached to a player clientside.

Category

Compatibility

Realm

Client

Parameters

Player client The player receiving the PAC part.

string id The PAC part identifier being attached.

Example Usage

  hook.Add("AttachPart", "liaExampleAttachPart", function(client, id)
      print("Attaching PAC part", id, "to", client)
  end)

DrawPlayerRagdoll(entity)View Source

Purpose

Runs during ragdoll rendering so PAC outfits can be transferred from players to their ragdolls.

Category

Compatibility

Realm

Client

Parameters

Entity entity The ragdoll entity being drawn.

Example Usage

  hook.Add("DrawPlayerRagdoll", "liaExampleDrawPlayerRagdoll", function(entity)
      entity:SetRenderMode(RENDERMODE_NORMAL)
  end)

GetAdjustedPartData(wearer, id)View Source

Purpose

Allows plugins or modules to provide the final PAC part data table used for attachment.

Category

Compatibility

Realm

Client

Parameters

Player wearer The player who will receive the PAC part.

string id The PAC part identifier being resolved.

Returns

table|nil Return a PAC part data table to override the attachment payload. Returning nil allows the default behavior to continue.

Example Usage

  hook.Add("GetAdjustedPartData", "liaExampleGetAdjustedPartData", function(wearer, id)
      if id == "visor" then
          return {
              classname = "model",
              model = "models/props_junk/TrafficCone001a.mdl"
          }
      end
  end)

GetPlayTime(client)View Source

Purpose

Allows compatibility layers to provide playtime values from external admin systems.

Category

Compatibility

Realm

Server

Parameters

Player client The player whose playtime is being queried.

Returns

number|nil Return the player's playtime in seconds to override the default lookup. Returning nil allows the default behavior to continue.

Example Usage

  hook.Add("GetPlayTime", "liaExampleGetPlayTime", function(client)
      return 3600
  end)

OnPAC3PartTransfered(part)View Source

Purpose

Runs before an active PAC part is transferred from a player to that player's ragdoll.

Category

Compatibility

Realm

Client

Parameters

table part The PAC part object being transferred.

Example Usage

  hook.Add("OnPAC3PartTransfered", "liaExampleOnPAC3PartTransfered", function(part)
      print("Transferred PAC part", part.ClassName or "unknown")
  end)

OnPlayerObserve(client, state)View Source

Purpose

Runs when a player enters or leaves observer mode so PAC parts can be reset or rebuilt.

Category

Compatibility

Realm

Client

Parameters

Player client The player whose observer state changed.

boolean state Whether the player entered observer mode.

Example Usage

  hook.Add("OnPlayerObserve", "liaExampleOnPlayerObservePAC", function(client, state)
      print("Observer state changed", state)
  end)

RemovePart(client, id)View Source

Purpose

Runs when a tracked PAC part should be detached from a player clientside.

Category

Compatibility

Realm

Client

Parameters

Player client The player losing the PAC part.

string id The PAC part identifier being removed.

Example Usage

  hook.Add("RemovePart", "liaExampleRemovePart", function(client, id)
      print("Removing PAC part", id, "from", client)
  end)

SetupPACDataFromItems()View Source

Purpose

Runs after modules initialize so PAC item definitions can register their attachment data.

Category

Compatibility

Realm

Client

Example Usage

  hook.Add("SetupPACDataFromItems", "liaExampleSetupPACDataFromItems", function()
      print("PAC item data setup requested")
  end)

TryViewModel(entity)View Source

Purpose

Allows plugins or modules to replace the entity used by PAC event checks that inspect the local view model.

Category

Compatibility

Realm

Client

Parameters

Entity entity The entity being evaluated for PAC event processing.

Returns

Entity|nil Return an entity to override the PAC event target. Returning nil allows the default behavior to continue.

Example Usage

  hook.Add("TryViewModel", "liaExampleTryViewModel", function(entity)
      return entity
  end)