paska

15. huhtikuuta 2021 | 341 näyttökertaa

function OpenShopMenu(zone)
    ESX.UI.Menu.CloseAll()
    ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'shop', {
        title    = _U('shop'),
        align    = 'bottom-right',
        elements = elements
    }, function(data, menu)
        ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'shop_confirm', {
            title    = _U('shop_confirm', data.current.value, data.current.label_real, ESX.Math.GroupDigits(data.current.price * data.current.value)),
            align    = 'bottom-right',
            elements = {
                {label = _U('no'),  value = 'no'},
                {label = _U('yes'), value = 'yes'}
            }
        }, function(data2, menu2)
            if data2.current.value == 'yes' then
                TriggerServerEvent('slrp_shops:buyItem', data.current.item, data.current.value, zone)
            end
 
   menu2.close()
  end, function(data2, menu2)
  menu2.close()
  end)
    end, function(data, menu)
        menu.close()
 
        CurrentAction     = 'shop_menu'
        CurrentActionMsg  = _U('press_menu')
        CurrentActionData = {zone = zone}
   end)
end