-
Notifications
You must be signed in to change notification settings - Fork 1
Getting Started
FRFlo edited this page Jun 29, 2023
·
2 revisions
- FiveM
- NodeJS (NPM)
- Visual Studio Code
- FloInput
Download the latest bundled version from the releases page and extract it into your
resources folder.
Add the following line to your server.cfg:
ensure FloInputIf 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 --recursiveDownload the latest source code from the releases page and extract it into your resources folder.
Run the following command in the FloInput directory:
npm install
npm run buildAdd the following line to your server.cfg:
ensure FloInputThis 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')