NoSql Development Documentation

website·Indexed 31 days ago

https://docs.nosql-development.com

Open-source resources for FiveM, including NoSql UI for managing server graphical elements like progress bars and notifications, and NoSql License for licensing and document systems.

Tokens
1.4K
Snippets
15
Records
15
Agent score
2%

What's inside NoSql Development

  1. Install NoSql UI and its dependencies

    NoSql UI is a resource used to manage the graphical side of a server, providing components like progress bars, notifications, and menus. To install NoSql UI, you must first install the required dependency: nosql_lib.
    # Dependency: Install nosql_lib
    # Source: https://github.com/NoSql-Development/nosql_lib
  2. Install NoSql License and dependencies

    To set up the NoSql License system, you must install the required resource dependencies and download the main license package.
    # Required dependency: nosql_lib
    # Download from: https://github.com/NoSql-Development/nosql_lib
    
    # Main resource package
    # Download from: https://nosql-development.tebex.io/package/7006028
  3. Grant a license to a player using Give License

    To assign a license to a player, trigger the nosql_idcard:server:givelicense server event. You must provide the photo URL/link, the license type, and the target player's ID.
    -- Parameters: photo (string), type (string), targetID (number)
    TriggerServerEvent("nosql_idcard:server:givelicense", "LINK_PHOTO", "drive_license", 1)
  4. Create and manage menus with nosql_ui:Menu

    Use exports.nosql_ui:Menu(data) to display a menu with a list of selectable items. The function returns the callback string of the selected item. Use exports.nosql_ui:CloseMenu() to dismiss the menu.
    local menu = exports.nosql_ui:Menu({
    	title = 'TITLE',
    	subtitle = 'SUB TITLE',
    	items = {
    		{
    			icon = "🎒",
    			label = "Inventory",
    			desc = "Manage your items",
    			disabled = true,
    			callback = 'inventory'
    		},
    		{
    			icon = "🚗",
    			label = "Vehicles",
    			desc = "Vehicle management",
    			callback = 'vehicles'
    		}
    	}
    })
    print("Selected item from menu: "..menu)
    
    -- To close the menu
    exports.nosql_ui:CloseMenu()
  5. Display a progress bar using nosql_ui

    Trigger a client-side progress bar. This event allows for freezing the player and playing a specific animation (either a dictionary/library pair or a scenario) while the bar is active.
    TriggerClientEvent("nosql_ui:client:showProgressBar", source, {
        message = 'Example',
        time = 10000,
        freezePlayer = true,
        animation = {
            type = "anim",
            dict = "mini@prostitutes@sexlow_veh",
            lib = "low_car_sex_to_prop_p2_player"
        },
        onFinish = function()
            print("finish")
        end
    })
  6. Manage on-screen help text with nosql_ui

    The Nosql UI provides three functions to manage help text (typically a key-bind prompt): showHelpText to create it, updateHelpText to modify existing text/keys, and hideHelpText to remove it from the screen.
    -- Show help text
    exports.nosql_ui:showHelpText({
    	text = "Open Inventory",
    	key = "E"
    })
    
    -- Update existing help text
    exports.nosql_ui:updateHelpText({
    	text = "Open Inventory",
    	key = "E"
    })
    
    -- Hide help text
    exports.nosql_ui:hideHelpText()
  7. Show a notification using nosql_ui

    Trigger a client-side notification with a specific type, title, description, and display duration using the nosql_ui:client:showNotification event.
    TriggerClientEvent("nosql_ui:client:showNotification", source, {
        notificationType = 'info', -- Options: 'info', 'success', 'error', 'warning'
        title = 'Title',
        description = 'Example',
        time = 5000 -- Duration in milliseconds
    })
  8. Retrieve a license photo using GetPhoto

    To get a photo for a license, trigger the nosql_idcard:client:createLicense client event. This requires the license type and the target player's ID.
    -- Parameters: type (string), targetID (number)
    TriggerEvent("nosql_idcard:client:createLicense", 'drive_license', 1)
  9. Display a progress bar with nosql_ui:ProgressBar

    Use exports.nosql_ui:ProgressBar(data) to show a progress bar. This function supports freezing the player, playing a specific animation, and executing a callback function upon completion.
    exports.nosql_ui:ProgressBar({
    	message = 'Example',
    	time = 10000,
    	freezePlayer = true,
    	animation = {
    		type = "anim",
    		dict = "mini@prostitutes@sexlow_veh",
    		lib = "low_car_sex_to_prop_p2_player"
    	},
    	onFinish = function()
    		print("finish")
    	end
    })
  10. Control InfoBox and Logo visibility

    Use the following exports to toggle the visibility of the InfoBox and the Logo UI elements.
    -- InfoBox
    exports.nosql_ui:showInfoBox(data)
    exports.nosql_ui:hideInfoBox(data)
    
    -- Logo
    exports.nosql_ui:showLogo()
    exports.nosql_ui:hideLogo()
  11. Manage HelpText using nosql_ui

    Control the visibility and content of the HelpText UI. You can show a new help text, update an existing one, or hide it entirely.
    -- Show HelpText
    TriggerClientEvent("nosql_ui:client:showHelpText", source, {
        text = "Open Inventory",
        key = "E"
    })
    
    -- Update HelpText
    TriggerClientEvent("nosql_ui:client:updateHelpText", source, {
        text = "Open Inventory",
        key = "E"
    })
    
    -- Hide HelpText
    TriggerClientEvent("nosql_ui:client:hideHelpText", source)
  12. Display a notification with nosql_ui:Notify

    Use exports.nosql_ui:Notify(data) to show a notification toast to the user. You can specify the type of notification (info, success, error, or warning), the title, the message body, and the display duration in milliseconds.
    exports.nosql_ui:Notify({
    	notificationType = 'info', -- Options: 'info', 'success', 'error', 'warning'
    	title = 'Title',
    	message = 'Example',
    	time = 5000
    })