NoneM
Tebex
  • Resources
    • no-base
      • Supported Resources
      • Configuration
        • Player
          • Controls
          • Actions
        • Inventory
        • Interact (Target)
        • Alerts
          • Notification
          • Indicators
    • no-alerts
      • Exports & Events
      • Notification Usage
      • Indicator Usage
    • no-chains
      • Configuration
      • Exports & Events
    • no-contextmenu
      • Exports
      • Contextmenu Usage
      • Input Menu Usage
    • no-elevators
      • Configuration
        • Elevator Creator
        • Scene Creator
        • Floor Creator
        • Door Selector
        • Icons
      • Restrictions
        • Elevator Restriction
        • Floor Restriction
    • no-gameplaycam
      • Configuration
      • Exports & Events
    • no-housing
      • Configuration
        • Buildings
          • Adding IPL Building
          • Adding Shell Building
          • Adding Building Interaction
        • Real Estate
        • Commands
        • Furniture Interactions
        • Garage
      • House Editor
        • Creating Houses
        • Editing & Removing Existing Houses
      • Furniture Editor
        • Editing Furnitures
        • Editing Furniture Categories
      • Access Sharing
      • Exports & Events
    • no-mop
      • Configuration
        • Client
        • How to disable pollution for interiors?
        • Use with commands
      • Exports & Events
    • no-newspaper
      • Configuration
        • Registering Papers
      • Exports & Events
    • no-payphone
      • Configuration
      • Integration
        • VOIP Integration
        • Phone Integration
    • no-polaroid
      • Configuration
      • Exports & Events
    • no-rappel
      • Configuration
      • Exports & Events
    • no-spy
      • Configuration
        • Client
        • Commands
      • Exports & Events
    • no-torture
      • Configuration
      • Exports & Events
    • no-trains
      • Configuration
      • Exports & Events
    • no-vehicles
      • Configuration
        • Anchor
        • Cruise
        • Indicator
        • Roll
        • Seat Belt
        • Siren Lights
        • Siren Sounds
      • Exports & Events
Powered by GitBook
On this page
  1. Resources
  2. no-elevators
  3. Restrictions

Elevator Restriction

An elevator-level restriction disables all floors of the elevator if the condition evaluates to false. This type of restriction ensures that users are entirely restricted from using the elevator.

You can find all of the examples in no-elevators/restrictions/examples folder.

Example


local API = exports["no-elevators"]

local function isAdmin(source)
    return IsPlayerAceAllowed(source, "elevators.admin")
end

--In these examples:
-- "admin" refers to the elevator ID.
-- {"admin", "admin2", "admin3"} applies the restriction to multiple elevators.
-- isAdmin serves as the controller function, returning true or false.

-- Apply restriction to a single elevator
---@param elevatorIds table<string> | string
---@param controller fun -> boolean
API:AddElevatorRestriction("admin", isAdmin)

-- Apply restriction to multiple elevators
---@param elevatorIds table<string> | string
---@param controller fun -> boolean
API:AddElevatorRestriction({"admin", "admin2", "admin3"}, isAdmin)
PreviousRestrictionsNextFloor Restriction

Last updated 5 months ago