Custom Apps
You need the laptop complete bundle to use this feature.
You can add custom apps by building your own using the provided template or stream it from an existing website hosted at services like WIX or any other website builder.
Existing Websites
For existing websites you can use the following export and configuration from any client.lua:
Building my Own App
React knowledge is required for this.
Clone the repository from Github.
Install yarn and all dependencies.
Run yarn dev and open the address
http://localhost:3000/
in your browser.Go to src/index.jsx and uncomment line 22 to show the App in your Browser.
Run yarn build to build the app when is ready and test it in game.
Don't forget to comment out line 22 before building the app.
fetchNui hook
This hook will allow you to send data from the UI to the Lua files using NUICallbacks, there's already an example inside app.jsx
resourceName is the resource that is gonna receive the callback data.
NUICallbackName is the name of the callback registered in the .lua file using native RegisterNUICallback()
Data is the info the resource is gonna receive from our UI.
You can send a response from the Lua callback by making the function asynchronous like this:
Import your custom App
Once your App UI is built is now time to import it to av_laptop so it can be used in game, for this you will need to create a table just like this example and send it to av_apps using the registerApp export.
If you followed and built the app correctly you should be able to open it in game
Last updated