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 server 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

Config.RemoveMoney = function(source, amount) -- remove money function, you can set your inventory here as you like
    exports.ox_inventory:RemoveItem(source, 'money', amount) -- xPlayer.removeInventoryItem('money', count)
end

Config.GetMoney = function(source) -- get the money, always returns a number, you can set here your inventory as you like
    local money = exports.ox_inventory:GetItem(source, 'money', nil, true) -- xPlayer.getInventoryItem(item).count
    return money
end

Config.Query = function(source, data)
    -- you can put your custom query with your data-s, encode the data table to find which values are in it.
    -- the query must be a STRING, and the additional informations must be in a table as the example shows.
    local xPlayer = ESX.GetPlayerFromId(source) -- QBCore.Functions.GetPlayer(source)
    local owner = xPlayer.identifier -- QBCore.Functions.GetIdentifier(source)

    local properties = data.properties
    local plate = data.plate
    local query = 'INSERT INTO owned_vehicles (owner, plate, vehicle) VALUES (?,?,?)'
    return query, {owner, plate, json.encode(properties)}
end
PreviousSetting up the client side handlers and functionsNextCreating shops

Last updated 1 year ago

Was this helpful?

🚙