Exports and Events

OpenTuningMenu

With following export you are able to open tuning menu.

  • isStation boolean

exports['p_tuningmenu']:OpenTuningMenu(isStation)

Example of Usage

local isStation = false
exports['p_tuningmenu']:OpenTuningMenu(isStation)
-- THIS CODE WILL OPEN MENU WITH BUY OPTION

local isStation = true
exports['p_tuningmenu']:OpenTuningMenu(isStation)
-- THIS CODE WILL OPEN MENU WITHOUT BUY OPTION

local isStation = ESX.PlayerData.job.name == 'mechanic' and false or true
exports['p_tuningmenu']:OpenTuningMenu(isStation)
-- THIS CODE WILL OPEN MENU WITH BUY OPTION FOR PLAYER WITH JOB MECHANIC

ForceCloseMenu

With this export you can force close menu for player.

exports['p_tuningmenu']:ForceCloseMenu()
-- THIS WILL INSTANT CLOSE MENU WITHOUT SAVING ANYTHING

With this event handler you can follow menu state.

RegisterNetEvent('p_tuningmenu:MenuState', function(state)
    -- TOGGLE HUD EXPORT
end)

Example of Usage

RegisterNetEvent('p_tuningmenu:MenuState', function(state)
    exports['hud']:ToggleHud(state) -- state is boolean [true / false]
end)

Last updated