hey guys i’m trying to find some script that let me make a costum value in the f6 menu like bills/fine/payment/receit is there ainy way ? i only have one that the value is fixed not costum
hey guys i’m trying to find some script that let me make a costum value in the f6 menu like bills/fine/payment/receit is there ainy way ? i only have one that the value is fixed not costum
function BillMenu()
ESX.UI.Menu.CloseAll()
ESX.UI.Menu.Open(‘default’, GetCurrentResourceName(), ‘billmenu’, {
title = ‘Billing Menu’,
align = ‘top-left’,
elements = {
{label = “Request Payment”, value = ‘billing’},
}}, function(data, menu)
if data.current.value == ‘billing’ then
ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'billing', {
title = "Payment value"
}, function(data, menu)
local amount = tonumber(data.value)
if amount == nil then
ESX.ShowNotification("Invalid value")
else
menu.close()
local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer()
if closestPlayer == -1 or closestDistance > 3.0 then
ESX.ShowNotification("There's no nearby players")
else
TriggerServerEvent('esx_billing:sendBill', GetPlayerServerId(closestPlayer), 'society_name', 'SOCIETYNAME', amount)
ESX.ShowNotification("The payment request was sent")
end
end
end, function(data, menu)
menu.close()
end)
Just create a call for this function and a society to receive the values from the esx_billing, then this should work.
Thank you so much but can you explain a little more im new to this
I’d love to learn more about it to, since we try to build a Restaurant