Giter Site home page Giter Site logo

an_dialogbox's Introduction

NUI Dialog Box for FiveM [Standalone]

An immersive dialog box with sounds and a simple but beautiful UI. I created this because of the very few options available out there. Using this utility will open a whole world of possibilities for your server and make your FiveM scripting easier. This is intended for advanced users who know a bit about coding.

Preview

image

DEMO VIDEO

Installation

  • Download this and put it inside your resources folder ( โš ๏ธ DO NOT CHANGE THE RESOURCE NAME )
  • Add this to your server.cfg: start an_dialogBox

Usage

add this somewhere in your code where you wanna trigger the dialog box:

exports['an_dialogBox']:showDialog(name, label, input, help, submitFunc, cancelFunc)
  • name [REQUIRED] A unique name for your dialog, can also be used to prevent people from injecting stuff to the dialog box with the NUI Dev Tools
  • label [REQUIRED] The text that's gonna be shown as the title of the dialog form
  • input [REQUIRED] The default typed text inside the input ( can be empty )
  • help [REQUIRED] A little hint text below the text area
  • submitFunc() [REQUIRED] This is the function that runs once the OK button is clicked or when you click ENTER. It takes the input text typed into that form as an argument.
  • cancelFunc() [OPTIONAL] This is the function that runs once the Cancel button is clicked or the form is canceled. doesn't take any arguments and can be the function that runs if the player closes or cancel the dialog Box

Debug

  • Set debugMode on Line 14 of client.lua to true
  • Use /testdialog command to test the demo dialog

Example Code ( Easy to configure / Plug and Play )

You can put it on any script and it's gonna work

RegisterCommand('example', function(src, args)
		exports['an_dialogBox']:showDialog('example_dialog', 'Enter your name:', '0', 'This is a hint example', onSubmit, onCancel)
end)
function onSubmit(data)
		print('You submitted the following text: ^1'..data)
end
function onCancel()
		print('CANCELED')
end

an_dialogbox's People

Contributors

aymannajim avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.