Füsti docs
DiscordGithub
  • Füsti's scripts
  • 🧟‍♂️fusti_zombie
    • Using the export
      • Setting up zone types
      • Setting up blips
      • Setting up zombies
  • 🪚fusti_jobcreator
    • Setting up the config
      • Setting up mainPlace
      • Setting up vehicles
      • Setting up actions
      • Picture of add-on vehicles
  • 🚙FUSTI_VEHICLESHOP
    • Setting up the config
      • Creating categories
      • Setting up the client side handlers and functions
      • Setting up the server side handlers and functions
      • Creating shops
      • Creating vehicles
Powered by GitBook
On this page

Was this helpful?

  1. FUSTI_VEHICLESHOP
  2. Setting up the config

Setting up the client side handlers and functions

There are multiple examples shown in the config, and it is already prepared to ESX frameworks using OX Lib and OX Inventory

AddEventHandler('fusti_vehicleshop:onEnter', function() -- called when the player is entered into the shop
    ExecuteCommand('hud')
    DisplayRadar(false)
    exports.ox_target:disableTargeting(true) -- optional
end)

AddEventHandler('fusti_vehicleshop:onExit', function() -- called when the player is exited from the shop
    ExecuteCommand('hud')
    DisplayRadar(true)
    exports.ox_target:disableTargeting(false) -- optional
end)

AddEventHandler('fusti_vehicleshop:onPurchase', function(data) -- called when the player successfully bought a vehicle
    local title = 'Information'
    local description = 'You have successfully purchased your vehicle for %s%s! (%s - %s)'
    lib.notify({
        title = title,
        description = description:format(data.price, data.currency, data.name, data.properties.plate),
        type = 'inform',
        position = 'top',
        icon = 'fas fa-car',
        time = 3000
    })
    -- ESX.ShowNotification(description:format(data.price, data.currency, data.vehicleName, data.plate), 'info', 3000)
    -- QBCore.Functions.Notify(description:format(data.price, data.currency, data.vehicleName, data.plate), 'info', 3000)
end)

Config.getVehicleProperties = function(entity) -- here you can use your framework's function as you like
    return lib.getVehicleProperties(entity) -- QBCore.Functions.GetVehicleProperties(entity) // ESX.Game.GetVehicleProperties(entity)
end
PreviousCreating categoriesNextSetting up the server side handlers and functions

Last updated 1 year ago

Was this helpful?

🚙