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

Floor Restriction

A floor-level restriction limits access to specific floors of an elevator or elevators. If the restriction check returns false, the specified floors become inaccessible while others remain accessible.

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 this example:
-- admin, admin2, admin3, and admin4 are elevator IDs.
-- Each floor list (e.g., {1, 2, 3} or 1) defines the restricted floors by their index.
-- isAdmin determines whether the user has access.

---@param floors table<string, table<number> | number>
---@param controller fun -> boolean
API:AddFloorRestriction({
    admin = {1, 2, 3},
    admin2 = {1, 2, 3},
    admin3 = {1, 2, 3},
    admin4 = 1
}, isAdmin)

------------------------------------------------------------------------------------------------------------

--In this example:
-- "admin2" is the elevator ID.
-- 1 or {2, 3, 4} specifies the restricted floors by their index.
-- isAdmin determines whether the user has access.

---@param elevatorId string
---@param floors table<number> | number
---@param controller fun -> boolean
API:AddFloorRestriction("admin2", 1, isAdmin)
API:AddFloorRestriction("admin2", {2, 3, 4}, isAdmin)

PreviousElevator RestrictionNextno-gameplaycam

Last updated 5 months ago