Custom Apps
Here you will find information about how to integrate custom apps inside the phone by using your own app templates.
Custom Apps
Config
You can edit the config file to incorporate the custom app.
Config.Applications = {
{
... // Other apps here.
},
{
appName = 'customapp', -- This is the name of the app, it will be used to identify the app.
label = 'Custom App', -- This is the label that will be displayed under the app icon.
appIcon = 'customapp.webp', -- Paste your app icon in (nui/build/assets/icons)
appPath = 'https://cfx-nui-customapp/ui/dist/index.html', -- This is the URL that will be loaded when the app is opened. (Built version)
isVisible = function() -- This is a function that will be called to determine if the app should be visible. You can use this to hide the app based on the player's job, group, etc.
return true
end
}
}
OR
OR
Exports
Call the following export to add an app from another resource.
exports['snappy-phone']:registerApp({
appName = 'customapp', -- This is the name of the app, it will be used to identify the app.
label = 'Custom App', -- This is the label that will be displayed under the app icon.
appIcon = 'customapp.png', -- Paste your app icon in (nui/build/assets/icons)
appPath = 'https://cfx-nui-' .. GetCurrentResourceName() .. '/ui/dist/index.html', -- This is the URL that will be loaded when the app is opened. (Built version)
isVisible = function() -- This is a function that will be called to determine if the app should be visible. You can use this to hide the app based on the player's job, group, etc.
return true
end
})
Refer to Custom App Template to start making your own app.
Last updated