function OpenLawyerMenu()
ESX.UI.Menu.CloseAll()
ESX.UI.Menu.Open(
'default', GetCurrentResourceName(), 'mobile_mecano_actions',
{
css = 'meconcernant',
title = _U('mechanic'),
align = 'bottom-right',
elements = {
{label = _U('billing'), value = 'billing'}
}
},
function(data, menu)
if IsBusy then return end
if data.current.value == 'billing' then
ESX.UI.Menu.Open(
'dialog', GetCurrentResourceName(), 'billing',
{
title = _U('invoice_amount')
},
function(data, menu)
local amount = tonumber(data.value)
if amount == nil or amount < 0 then
ESX.ShowNotification(_U('amount_invalid'))
else
local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer()
if closestPlayer == -1 or closestDistance > 3.0 then
ESX.ShowNotification(_U('no_players_nearby'))
else
menu.close()
TriggerServerEvent('esx_billing:sendBill', GetPlayerServerId(closestPlayer), 'society_mecano', _U('mechanic'), amount)
end
end
end,
function(data, menu)
menu.close()
end
)
end
end
ESX.UI.Menu.CloseAll()
ESX.UI.Menu.Open(
'default', GetCurrentResourceName(), 'mobile_mecano_actions',
{
css = 'meconcernant',
title = _U('mechanic'),
align = 'bottom-right',
elements = {
{label = _U('billing'), value = 'billing'}
}
},
function(data, menu)
if IsBusy then return end
if data.current.value == 'billing' then
ESX.UI.Menu.Open(
'dialog', GetCurrentResourceName(), 'billing',
{
title = _U('invoice_amount')
},
function(data, menu)
local amount = tonumber(data.value)
if amount == nil or amount < 0 then
ESX.ShowNotification(_U('amount_invalid'))
else
local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer()
if closestPlayer == -1 or closestDistance > 3.0 then
ESX.ShowNotification(_U('no_players_nearby'))
else
menu.close()
TriggerServerEvent('esx_billing:sendBill', GetPlayerServerId(closestPlayer), 'society_mecano', _U('mechanic'), amount)
end
end
end,
function(data, menu)
menu.close()
end
)
end
end