24 lines
		
	
	
	
		
			714 B
		
	
	
	
		
			Lua
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
	
		
			714 B
		
	
	
	
		
			Lua
		
	
	
	
	
	
| local bones = {}
 | |
| for boneName, _index in pairs(WHEEL_BONES) do
 | |
|     bones[#bones+1] = boneName
 | |
| end
 | |
| 
 | |
| exports.ox_target:addGlobalVehicle({
 | |
|     {
 | |
|         label = GetLocalization('target_label'),
 | |
|         icon = Config.TargetIcon,
 | |
|         distance = Config.MaxTireInteractionDist,
 | |
|         bones = bones,
 | |
|         canInteract = function(entity)
 | |
|             return TargetCanInteract(entity)
 | |
|         end,
 | |
|         onSelect = function(data)
 | |
|             local tire = exports[CURRENT_RESOURCE]:getClosestVehicleTire(data.entity, data.coords)
 | |
|             if tire.index == nil then
 | |
|                 return
 | |
|             end
 | |
| 
 | |
|             exports[CURRENT_RESOURCE]:attemptToSlashTire(tire)
 | |
|         end
 | |
|     }
 | |
| })
 | 
