Skip to content

MKevas/ox_doorlock

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ox Doorlock

Door management resource, with compatibility for ox_core, qb-core, and es_extended.
Successor to nui_doorlock with less scuff and more stuff.

Dependencies

Doors are stored in a database for ease-of-use and to allow data to be easily cleared or shared.

ox_lib (v2.3.0 or higher)

Used for some UI elements (i.e. notifications, progress circle, input), and cache.

Used with lockpicks and the doorlock command.

Usage

Use the doorlock command to open the UI and enter the settings for your new door.
Once you confirm, you can use qtarget to select the entity (or entities) to use.

You can use edit as an argument for doorlock to add qtarget options to modify or delete an existing door.

More information and screenshots later..

API

  • Get data for door
local mrpd_locker_rooms = exports.ox_doorlock:getDoor(1)
local mrpd_locker_rooms = exports.ox_doorlock:getDoorFromName('mrpd locker rooms')
  • Lock a door from the server
TriggerEvent('ox_doorlock:setState', mrpd_locker_rooms.id, 1)
  • Listen for event when door is toggled
AddEventHandler('ox_doorlock:stateChanged', function(source, doorId, state, usedItem)
    if usedItem == 'trainticket' then
        local xPlayer = ESX.GetPlayerFromId(source)
        xPlayer.removeInventoryItem(usedItem, 1)
    end
end)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 49.5%
  • Lua 46.3%
  • CSS 1.6%
  • HTML 1.4%
  • JavaScript 1.2%