Exports
Export
Description
Parameter(s)
Return type
Examples
local isSlashing = exports.slashtires:isSlashing()
if isSlashing then
print("The player is slashing a tire!")
else
print("The player is not slashing any tires")
end
local canCurWeaponSlash = exports.slashtires:canCurrentWeaponSlashTires()
if canCurWeaponSlash then
print("The current player weapon can slash a tire!")
else
print("The current player weapon cannot slash a tire!")
end
local vehicle = GetVehiclePedIsIn(PlayerPedId(), false)
if vehicle ~= 0 then
-- Burst the front left tire of the vehicle the ped is in
exports.slashtires:burstVehicleTire(vehicle, 0)
end
-- I'm too lazy to write a function for this for the example, but if you don't use ox_lib then just use your own function
local vehicle2 = lib.getClosestVehicle(GetEntityCoords(PlayerPedId()))
if vehicle2 ~= 0 then
-- If you don't pass in the coords paramter it gets the current player position
-- For the boneName see the WHEEL_BONES table in shared/variables.lua file
local tire = exports.slashtires:getVehicleTireByBone(vehicle, 'wheel_rf')
if tire.index ~= nil then
exports.slashtires:attemptToSlashTire(tire)
end
end
if vehicle2 ~= 0 then
local tire = exports.slashtires:getClosestVehicleTire(vehicle)
-- If you don't want the attemptToSlashTire export to give a notification to the player then this is "work-around", otherswise just use attemptToSlashTire
local canSlash, reason = exports.slashtires:canSlashVehicleTire(tire)
if not canSlash then
print("can't slash, reason:", reason)
return
end
exports.slashtires:slashTire(tire)
endLast updated