/ps-ui

Standalone UI System for FiveM

Primary LanguageSvelteGNU General Public License v3.0GPL-3.0

ps-ui

For all support questions, ask in our Discord support chat. Do not create issues on GitHub if you need help. Issues are for bug reporting and new features only.

Installation

  • Download ZIP
  • Drag and drop resource into your server files
  • Start resource through server.cfg
  • Restart your server.

Usage

  • Check exports below.
  • Each interface lua has all the details you need.

Minigames

Number Maze

Start a Number Maze game with a callback for success or failure.

exports['ps-ui']:Maze(function(success)
    if success then
        print("success")
    else
        print("fail")
    end
end, timeLimit)  -- Hack Time Limit in seconds
Number Maze

Notify

Display a notification with text, type, and duration.

exports['ps-ui']:Notify('Your message', 'notification-type', duration)
Number Maze

Circle

Start a Circle game with a callback for success or failure.

exports['ps-ui']:Circle(function(success)
    if success then
        print("success")
    else
        print("fail")
    end
end, numCircles, time)  -- Number of Circles, Time in milliseconds
Number Maze

Scrambler

Start a Scrambler game with a callback for success or failure.

exports['ps-ui']:Scrambler(function(success)
    if success then
        print("success")
    else
        print("fail")
    end
end, type, time, mirrored)  -- Type options: alphabet, numeric, alphanumeric, greek, braille, runes; Time in seconds; Mirrored options: 0, 1, 2
Scrambler

Var

Start a VAR Hack game with a callback for success or failure.

exports['ps-ui']:VarHack(function(success)
    if success then
        print("success")
    else
        print("fail")
    end
end, numBlocks, time)  -- Number of Blocks, Time in seconds
Var

Thermite

Start a Thermite game with a callback for success or failure.

exports['ps-ui']:Thermite(function(success)
    if success then
        print("success")
    else
        print("fail")
    end
end, time, gridSize, incorrectBlocks)  -- Time in seconds, Grid Size (5-10), Incorrect Blocks
Thermite

Context Menu

Create a menu with submenus and events.

exports['ps-ui']:CreateMenu({
    {
        id = "examplemenu", -- has to be unique
        header = "Menu Header",
        text = "Menu Text",
        icon = "icon-class",
        color = "color",
        event = "event-name",
        args = {arg1, arg2},
        server = false,
        subMenu = {
            {
                id = "examplesubmenu", -- has to be unique
                header = 'Submenu Header',
                icon = 'icon-class',
                color = 'color',
                event = "event-name",
                args = {arg1, arg2},
            },
        },
    },
}) 

Hide the currently displayed menu

exports['ps-ui']:HideMenu()
Context Menu

Status

Toggle the display of status with information

exports['ps-ui']:StatusShow("Title", "Description", "icon", 
{
    {key = "Key1", value = "Value1"}, 
    {key = "Key2", value = "Value2"}, 
    {key = "Key3", value = "Value3"}
})
Status

Display Text

Display text with a specified color

exports['ps-ui']:DisplayText("Your text", "color")

Hide the currently displayed text

exports['ps-ui']:HideText()
Show Text

Input

Display an input form and print the input values.

local input = exports['ps-ui']:Input({
    {
        id = '1',
        label = 'Label',
        type = "input-type",
        icon = "icon-class"
    },
    -- Add more inputs as needed
})
for k, v in pairs(input) do 
    print(k, v.id, v.value)
end
Input

Show Image

Displays an image from a URL.

exports['ps-ui']:ShowImage("imageURL")
Show Image

Credits