Skip to content

v2.1.0

Choose a tag to compare

@Frowmza Frowmza released this 24 Mar 17:59
· 20 commits to main since this release

Bl_customs

Bug Fixes

  • Menu type not resetting

What new

  • Add onToggle: function(vehicle, index, toggle) , it will trigger if you click on a toggle mod of the current mod
-- example,  this to toggle vehicle extra
onToggle = function(vehicle, index, toggle)
     SetVehicleExtra(vehicle, index, not toggle)
end,
  • Add onSelect: function(vehicle, modIndex) , it will trigger if you click on a child of the current mod
-- example, this to set plate index
onSelect = function(vehicle, index)
      SetVehicleNumberPlateTextIndex(vehicle, index)
end,
  • Add onClick: function(vehicle) , this will be triggered if you click on the current mod and want to create child cards
-- example, this to get vehicle plates indexes
onClick = function(vehicle, stored)
            local mods = {
                { label = 'Blue/White',   id = 0, price = 200 },
                { label = 'Yellow/black', id = 1, price = 200 },
                { label = 'Yellow/Blue',  id = 2, price = 200 },
                { label = 'Blue/White2',  id = 3, price = 200 },
                { label = 'Blue/White3',  id = 4, price = 200 },
                { label = 'Yankton',      id = 5, price = 200 },
            }

            local currentMod = GetVehicleNumberPlateTextIndex(vehicle)
            stored.currentMod = currentMod
            for _, v in ipairs(mods) do
                if v.id == currentMod then
                    v.selected = true
                    v.applied = true
                    break
                end
            end
            return mods
end,

NOTE: the mods methods onToggle, onSelect, onClick will override the default effect!

  • Add vehicle Extras ( @Laxasw thanks for the suggestion )
  • Early return when you go back to the previous menu instead of sending unnecessary data to Lua
  • Overall cleanup/improvements