We provide various open source functions into our Advanced Chop Shop resource that enables you to add further customization and/or add third-party resource integrations such as XP systems.
Client
The functions below can be found in lation_chopshop/client/functions.lua
StartChopping() - Empty function that's triggered when player has started chopping process
-- Empty function that's triggered when player has started chopping process-- Can be used for things like disabling inventory, etcStartChopping=function()-- Below are some examples:-- qs-inventory: exports['qs-inventory']:setInventoryDisabled(true)-- ox_inventory: LocalPlayer.state.invBusy = true-- qb-inventory: LocalPlayer.state.inv_busy = trueend
FinishChopping() - Empty function that's triggered when player has finished chopping process
-- Empty function that's triggered when player has finished chopping process-- Can be used for things like disabling inventory, etcFinishChopping=function()-- Below are some examples:-- qs-inventory: exports['qs-inventory']:setInventoryDisabled(false)-- ox_inventory: LocalPlayer.state.invBusy = false-- qb-inventory: LocalPlayer.state.inv_busy = falseend
ContractStarted() - Empty function that's triggered when a contract has started
-- Empty function that's triggered when a contract has started--- @param coords vector4 Position at which the vehicle is spawned--- @param driver number The driver's entity ID--- @param vehicle number The vehicle's entity ID--- @param model string The vehicle spawn name, data can be accessed via Config.Vehicles[model]--- @param isSale boolean True if it's a selling contract, false if choppingContractStarted=function(coords,driver,vehicle,model,isSale)end
VehicleHijacked() - Empty function that's triggered when a player obtained contract vehicle
-- Empty function that's triggered when a player succesfully obtained contract vehicle--- @param vehicle number Entity ID--- @param model string Vehicle spawn name, data can be accessed via Config.Vehicles[model]--- @param isSale boolean True if it's a selling contract, false if choppingVehicleHijacked=function(vehicle,model,isSale)end
Server
The functions below can be found in lation_chopshop/server/functions.lua
ChoppedPart() - Empty function that's triggered when done chopping a part
-- Empty function that's triggered when done chopping a part-- Useful for various reasons such as XP systems, rewarding items, etc--- @param source number Player ID--- @param model string Vehicle model: panto--- @param type string Part type: wheels, doors or frameChoppedPart=function(source,model,type)-- Can be used for any purpose, such as rewarding a specific item for a specific model-- When chopping a specific part, or any sort of other similar variation(s).-- Below is a simplified example:if model =='baller3' theniftype=='frame' thenlocal chance =math.random(100)if chance <15then-- AddItem(source, 'specialItem', 1)endendend-- The simplified example above rewards a "specialItem" with a 15% chance-- When a baller3 frame is chopped by a player-- This can be expanded on by the use of exports as well. For example, checking-- If the player has a certain amount of reputation first. Like so:if exports.lation_chopshop:GetData(source, 'reputation') >=10000thenif model =='baller3' theniftype=='frame' thenlocal chance =math.random(100)if chance <15then-- AddItem(source, 'specialItem', 1)endendendend-- The above example will now only consider a player for this "specialItem" if-- They have 10,000 or more reputation. end
ToolPurchased() - Empty function that's triggered when a player purchased from the tool shop
-- Empty function that's triggered when a player purchases from the tool shop--- @param source number Player ID--- @param data table item, label, price, min, max--- @param quantity number Quantity of item purchasedToolPurchased=function(source,data,quantity)end
PartsSwapped - Empty function that's triggered when a player swaps auto parts for an item
-- Empty function that's triggered when a player swaps auto parts for an item--- @param source number Player ID--- @param data table item, label, price, min, max of item swapped for--- @param quantity number Quantity of item swapped forPartsSwapped=function(source,data,quantity)end