Shared definition of the cw_combinelock entity (print name Combine Lock), a spawnable anim entity with its smoke charge, flash and locked data table variables and the ENT:IsLocked getter.

Summary

Methods

Starts the 12 second smoke charge that busts the lock's rotating doors open.
Blocks every toolgun action on the lock.
Draw()client
Draws the lock model.
Plays one random Combine button sound from the lock and each of its doors.
Explode()server
Plays an explosion effect and impact sound at the lock.
Returns the lock's access level.
Returns the Combine rank required by the lock.
Sets up the lock model, physics, 800 health and the status light sprite.
Returns whether the lock is locked.
Lock()server
Locks and closes the lock's doors and plays a random button sound.
Plays the explosion and unlocks the lock's doors.
Subtracts the damage from the lock's health and starts the smoke charge when it reaches 0.
Sets the access level a non-Combine player needs a matching combine_lock_access_* item for.
Sets the Combine rank that Schema:PlayerHasCombineLockAccess checks for this lock.
Attaches the lock to a door, together with its double door partner if it has one.
Flashes the status light red and plays the denied sound.
Sets the color the status light shows while the lock is locked.
Declares the smoke charge time, flash time and locked state data table variables.
Think()server
Keeps the doors locked or unlocked, updates the status light and keeps the lock frozen.
Toggle()server
Locks the lock when it is unlocked and unlocks it when it is locked.
Toggles the lock if the player has access, or flashes it red if they do not.
Unlock()server
Unlocks the lock's doors and plays a random button sound.
Always transmits the lock to every client.
Toggles the lock with access checks when a player uses it while looking at it.

Methods

Starts the 12 second smoke charge that busts the lock's rotating doors open.

Does nothing while a charge is already counting down. When the timer ends, each prop_door_rotating is busted down with Schema:BustDownDoor and a smoke effect plays at the lock.

Parameters

  • force Vector Force applied to the busted doors

Blocks every toolgun action on the lock.

Parameters

  • player
  • trace
  • tool

Returns

  • Boolean Always false

Draws the lock model.

Plays one random Combine button sound from the lock and each of its doors.

Plays an explosion effect and impact sound at the lock.

Returns the lock's access level.

Returns

Returns the Combine rank required by the lock.

Returns

  • String The rank, or nil

Sets up the lock model, physics, 800 health and the status light sprite.

Returns whether the lock is locked.

Returns

  • Boolean Whether the lock is locked

Locks and closes the lock's doors and plays a random button sound.

Plays the explosion and unlocks the lock's doors.

Subtracts the damage from the lock's health and starts the smoke charge when it reaches 0.

Parameters

  • damageInfo

Sets the access level a non-Combine player needs a matching combine_lock_access_* item for.

Parameters

  • int Number The access level

Sets the Combine rank that Schema:PlayerHasCombineLockAccess checks for this lock.

Parameters

  • str String The rank, or nil to let every Combine use the lock

Attaches the lock to a door, together with its double door partner if it has one.

A partner is a door of the same class, model and skin 90 to 100 units away at the same height with a different angle. The lock is removed with the door, and each locked door's combineLock field is set to the lock.

Parameters

  • entity Entity The door to lock

Flashes the status light red and plays the denied sound.

Parameters

  • duration Number How long the light flashes, in seconds

Sets the color the status light shows while the lock is locked.

Parameters

  • color Color Light color, or nil for the default orange

Declares the smoke charge time, flash time and locked state data table variables.

Keeps the doors locked or unlocked, updates the status light and keeps the lock frozen.

Removes the lock, which explodes in ENT:OnRemove, when its door is gone. With the combine_lock_overrides config enabled, the lock state is forced onto its doors every think. The light flashes red with a beep while a smoke charge counts down, is red during an access denied flash, orange (or the override color) when locked and green when unlocked.

Locks the lock when it is unlocked and unlocks it when it is locked.

Toggles the lock if the player has access, or flashes it red if they do not.

Does nothing within 3 seconds of the last use, during a flash or while a smoke charge is counting down. Access is checked with Schema:PlayerHasCombineLockAccess; admin faction players always have it.

Parameters

  • activator Player The player using the lock

Unlocks the lock's doors and plays a random button sound.

Always transmits the lock to every client.

Toggles the lock with access checks when a player uses it while looking at it.

Parameters

  • activator
  • caller

Defined in