Elevator Restriction
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)
Last updated