nss_libs

nss_libs

This item is free.

Add to Basket

DESCRIPTION

This is a library that offers helpers that are used by other packages such as nss_quest, which uses a distance check and the wrapper of Vorp's inventory (in the future also other frameworks than Vorp shall be supported).

The goal of this library is to provide frequently used features simplified for package programming, so that you become faster when developing new packages. In addition, performance and simplicity are a big focus for this library.

All modules and UI components are documented in the handbook.

  • Modules
    • Discord Webhook API
    • "Player near location" distance check API
    • "Entity near player" distance check API
    • Server event API
    • Client event API
    • Database API (currently oxmysql, ghmattimysql)
    • Database updater (versioned SQL migrations)
    • Inventory API (currently Vorp)
    • Character API (currently Vorp)
    • Blip API
    • Keyboard API
    • Prompts API
    • Notification API (including extended notifications)
    • Version check API
    • NPC API
    • Chunk API (including chunk streaming)
    • Attach prop API
    • Particle FX player
    • Config validator
    • And more to come...
  • UI components (including API)
    • Buttons
    • Confirm dialog
    • Modal
    • Notifications
    • Pad lock
    • Loading indicator
    • Audio
    • Responsive solution (to support all common screen resolutions)
    • Simple text editor
    • Dynamic SVG replacer (replaces simple <img>-tags by styleable SVGs)
    • Simple text box
    • Simple tip
    • And more to come...

BETA NOTICE

This package is in an early beta stage. Use at your own risk.

It is possible that this package could become chargeable in the future, because the effort to create such a library is very high, especially to maintain the library sustainably. However, we are not sure about this. If you have already purchased it for free, you will be able to use it for free in the future.

DEPENDENCIES

  • VorpCore 2.2 (or higher)
  • vorp_inventory 3.5.0 (or higher)

SUPPORT & INFO

  • Discord
  • Handbook
  • No setup required - only ensure that the package is loaded by REDM.
  • This script is encrypted.

CODE EXAMPLE FOR "PLAYER NEAR LOCATION" API

---@type NssLibsPointInRangeApi
local pir_api = exports.nss_libs:getPointInRangeApi(GetCurrentResourceName())

---@type NssLibsPointInRangeListenerApi
local pir_listener
local radius = 10.0
local x, y, z = 0.0, 0.0, 0.0

local on_enter = function()

    -- Do something when player enters the radius
    print("Entered the location")

    -- Ensure the player can only enter once for all time ;)
    if pir_listener then
        pir_listener.remove()
    end
end

local on_leave = function()

    -- Do something when player leaves the radius
    print("Left the location")
end

pir_listener = pir_api.add(x, y, z, radius, on_enter, on_leave)