Skip to content

Getting Started

FRFlo edited this page Jun 29, 2023 · 2 revisions

Requirements

  • FiveM
  • NodeJS (NPM)
  • Visual Studio Code
  • FloInput

How to install

Using the bundled version

Download the latest bundled version Télécharger from the releases page and extract it into your resources folder.

Add the following line to your server.cfg:

ensure FloInput

Manually

Using Git

If you want to integrate FloInput into your own server, you can submodule this repository into your resources folder and add the following line to your server.cfg:

git submodule add https://github.com/FRFlo/FloInput resources/FloInput
git submodule update --init --recursive

Source code

Download the latest source code from the releases page and extract it into your resources folder.

Installation

Run the following command in the FloInput directory:

npm install
npm run build

Add the following line to your server.cfg:

ensure FloInput

How to use it ?

This resource is only client side. Here is an example of how to use it:

-- Show a number input dialog
TriggerEvent('FloInput:create', 'Enter a number', 'number', {
    min = 0,
    max = 100,
    placeholder = 'Enter a number between 0 and 100',
    value = '50'
}, function(data)
    print('You entered: ' .. data)
end)

-- Show a text input dialog
TriggerEvent('FloInput:create', 'Enter a text', 'text', {
    minLength = 1,
    maxLength = 256,
    placeholder = 'Enter a text between 1 and 256 characters',
    value = 'Hello World!'
}, function(data)
    print('You entered: ' .. data)
end)

-- Show a small text input dialog
TriggerEvent('FloInput:create', 'Enter a small password', 'small_text', {
    minLength = 1,
    maxLength = 10,
    placeholder = 'Enter a small password between 1 and 10 characters',
    value = 'Hello World!',
    secret = true
}, function(data)
    print('You entered: ' .. data)
end)
-- Hide the input dialog
TriggerEvent('FloInput:hide')

Clone this wiki locally