Use new boss menu

This commit is contained in:
Jérémie N'gadi
2017-09-03 11:55:20 +02:00
parent 885af6d462
commit ffde3dca8f
+5 -52
View File
@@ -292,8 +292,7 @@ function OpenAmbulanceActionsMenu()
}
if Config.EnablePlayerManagement and PlayerData.job.grade_name == 'boss' then
table.insert(elements, {label = _U('withdraw_society'), value = 'withdraw_society_money'})
table.insert(elements, {label = _U('deposit_society'), value = 'deposit_society_money'})
table.insert(elements, {label = 'Action Patron', value = 'boss_actions'})
end
ESX.UI.Menu.CloseAll()
@@ -310,56 +309,10 @@ function OpenAmbulanceActionsMenu()
OpenCloakroomMenu()
end
if data.current.value == 'withdraw_society_money' then
ESX.UI.Menu.Open(
'dialog', GetCurrentResourceName(), 'withdraw_society_money_amount',
{
title = _U('money_withdraw')
},
function(data, menu)
local amount = tonumber(data.value)
if amount == nil then
ESX.ShowNotification(_U('invalid_amount'))
else
menu.close()
TriggerServerEvent('esx_society:withdrawMoney', 'ambulance', amount)
end
end,
function(data, menu)
menu.close()
end
)
end
if data.current.value == 'deposit_society_money' then
ESX.UI.Menu.Open(
'dialog', GetCurrentResourceName(), 'deposit_money_amount',
{
title = _U('deposit_amount')
},
function(data, menu)
local amount = tonumber(data.value)
if amount == nil then
ESX.ShowNotification(_U('invalid_amount'))
else
menu.close()
TriggerServerEvent('esx_society:depositMoney', 'ambulance', amount)
end
end,
function(data, menu)
menu.close()
end
)
if data.current.value == 'boss_actions' then
TriggerEvent('esx_society:openBossMenu', 'ambulance', function(data, menu)
menu.close()
end, {wash = false})
end
end,