Summary

Hooks

Returns whether a player can open a Combine lock.

Hooks

Schema:ApplyCombineLock(entity, position, angles, access, rank, color)

server gamemodes/cwhl2rp/plugins/combinelocks/plugin/sv_schema.lua:50

Spawns a frozen cw_combinelock parented to a door.

local lock = Schema:ApplyCombineLock(door, trace, trace.HitNormal:Angle(), 2)

Parameters

  • entity Entity The door
  • position Vector optional, defaults to nil The lock's position; a trace Map instead places it at the standard offset on a prop_door_rotating, pushed 4 units out along HitNormal
  • angles Angle optional, defaults to nil The lock's angles
  • access Number optional, defaults to nil The lock's access level, 1 to 4
  • rank List<String> optional, defaults to nil Combine ranks the lock is closed to
  • color Color optional, defaults to nil The lock's light colour

Returns

  • Entity The new lock, or nil when it could not be created

Schema:PlayerHasCombineLockAccess(client, access, rank)

server gamemodes/cwhl2rp/plugins/combinelocks/plugin/sv_schema.lua:20

Returns whether a player can open a Combine lock.

Combine players have access unless their rank is one the lock is restricted for. Other players need the combine_lock_access_<access> card or the combine_lock_access_x card.

Parameters

  • client Player The player to check
  • access Number The lock's access level, 1 to 4
  • rank List<String> optional, defaults to nil Combine ranks the lock is closed to, as set with /SetCombineLockRank

Returns

  • Boolean Whether the player has access

Defined in