Giter Site home page Giter Site logo

newfivem-143 / ox_doorlock Goto Github PK

View Code? Open in Web Editor NEW

This project forked from overextended/ox_doorlock

0.0 0.0 0.0 822 KB

Door management for ox, qb, and esx.

Home Page: https://overextended.dev/ox_doorlock

License: GNU General Public License v3.0

Lua 39.56% TypeScript 59.07% CSS 1.00% HTML 0.38%

ox_doorlock's Introduction

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.

The UI needs to be built - use the latest release if you want to drag-n-drop.

Dependencies

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

mysql-async is no longer supported.

  • does not support error-catching (pcall)
  • people use older versions which do not support parameters as arrays
  • it isn't maintained and has issues that will never be resolved

ox_lib (v2.3.0 or higher)

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

ox_target (preferred) or qtarget (deprecated) or qb-target

(Optional) Used for lockpicking.

Usage

Use the /doorlock command to open the UI and enter the settings for your new door.
Once you confirm the settings, activate your targeting resource (typically LALT) to select the entity (or entities) to use.

Adding any arguments after the command will open the closest door to you, to easily modify it.

Conversion

Placing nui_doorlock config files into the convert folder will convert the data and insert it into the database.
Success is not guaranteed if using a fork on nui_doorlock, like the qb version.

Client API

  • Use the closest door. Still performs server-side checks, so may fail.
exports.ox_doorlock:useClosestDoor()
  • Pick the lock of the closest door. Still performs server-side checks, so may fail.
exports.ox_doorlock:pickClosestDoor()

Server 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')
  • Set door state (0: unlocked, 1: locked)
TriggerEvent('ox_doorlock:setState', mrpd_locker_rooms.id, state)
  • 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)

Door Settings

General

  • Door name
    • Used to easily identify the door.
  • Passcode
    • Door can be unlocked by anybody by using the code or phrase.
  • Autolock interval
    • Door will be locked after x seconds.
  • Interact distance
    • Door can only be used when within x metres.
  • Door rate
    • Door movement speed for sliding/garage/automatic doors, or swinging doors when locked.
  • Locked
    • Sets the door as locked by default.
  • Double
    • Door is a set of two doors, controlled together.
  • Automatic
    • Sliding/garage/automatic door.
  • Lockpick
    • Door can be lockpicked when interacting with a targeting resource.
  • Hide UI
    • No indicators (i.e. icon, text) will display on the door.

Characters

  • Character Id
    • Character identifier used by a framework (i.e. player.charid, xPlayer.identifier, Player.CitizenId).

Groups

  • Group
    • Framework dependent, referring to jobs, gangs, etc.
  • Grade
    • The minimum grade to allow access for the group (0 to allow all).

Items

  • Item
    • Name of the item.
  • Metadata type
    • Requires metadata support (i.e. ox_inventory) to check slot.metadata.type

Lockpick

  • Difficulty
    • Sets the skillcheck difficulty (see docs).
  • Area size
    • Custom difficulty area size.
  • Speed multiplier
    • Custom difficulty idicator speed.

ox_doorlock's People

Contributors

thelindat avatar lukewastakenn avatar github-actions[bot] avatar manason avatar far18 avatar zan1456 avatar tomstilson avatar bitpredator avatar nuga-dev avatar n-fire avatar jag3dagster avatar icecubepiso avatar dolutattoo avatar derwashbr avatar berkiebb avatar andyyy7666 avatar antond15 avatar usermacieg avatar mkeefeus avatar mindexas avatar murayuki avatar vrnagy avatar sarmingo avatar saturn745 avatar skryptific avatar szxna avatar thefantomas avatar cosminwindox avatar borisnliscool avatar ffpetrozzi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.