[Paid] [ESX] Spikestrips

Dependencies:

  1. qtarget/ox_target.
  • Easy to use
  • Usable items from inventory
  • Target system to pick up the spikestrips

Scripts preview: Click here!
preview with resmon: ​Click here!

!!LINKS UPDATED!!

ESX Tebex: Open
Our other resources: Tebex

My other work:

:desktop:HUD - Click here!

:pickup_truck:Vehicle lock system - Click here!

:blue_car:Spikestrip(base) - Click here!

​🪨Liberty city goldrush - ​Click here!

​​​🪙Liberty city metal detecting - ​Click here!

​​​🏬ESX Merryweather HQ Heist - Click here!

:convenience_store:​​ESX Shop robbery Full - Click here!

​​​🚘ESX car chopshop - Click here!

:money_with_wings:ESX ATM robbery - Click here!

​​​💰ESX Fleeca bank robbery - ​Click here!

​​​📦Illegal item run - Click here!

​​​🏪ESX Shop robbery LITE - Click here!

​​👑ESX Vangelico Robbery - Click here!

​🚛ESX Bilgeco Shipping - Click here!

​​​🪙ESX Metaldetecting - Click here

:rock:ESX Mining Escrow - Click here!

:green_apple:ESX Juice factory - Click here!

:strawberry:ESX Jam factory - Click here!

:rock:ESX Goldrush - Click here!

​​​🪨ESX Mining OPEN - Click here!

​​​🪨ESX Mining OT_Skills - Click here!

​​​🚛ESX Garbagejob - ​Click here! ​​​

​​​🛻QB Vehicle lock system - Click here!

:rock:QB Goldrush - Click here!

:articulated_lorry:QB Garbagejob - Click here!

:moneybag:QB Fleeca bank robbery - Click here!

:convenience_store:QB Shop robbery FULL - Click here!

:department_store:QB Merryweather HQ Heist - Click here!

​​​​​​​​🚘QB Vehicle chopshop - ​Click here! ​​​

Code is accessible Yes
Subscription-based No
Lines (approximately) ≈200
Requirements ESX
Support Yes

Bro went into the negative lines

1 Like

Haha, fixed for your peace of mind :smiley:

Can you post with resmon? A lot of the spike strips use a bunch of loops that affect performance.

sure gimme a bit, i just got home from work

preview with resmon: ​Click here!


after server restart, probably had some spikes laying around from yesterday.

1 Like

Does it spike if you’re in a vehicle?

does not spike NPC vehicles (while npc are driving over them), but spikes player vehicles like shown in 1st video.

Sorry poor choice of words, does the resmon go up if you’re in a vehicle?

yeah, it does spike up since, more the spikes near the vehicle, more it spikes up sadly.

Caused by the loops -

Citizen.CreateThread(function()
    while true do
        if IsPedInAnyVehicle(PlayerPedId(), false) then
            local vehicle = GetVehiclePedIsIn(PlayerPedId(), false)
            if GetPedInVehicleSeat(vehicle, -1) == PlayerPedId() then
                local vehiclePos = GetEntityCoords(vehicle, false)
                local spikes = GetClosestObjectOfType(vehiclePos.x, vehiclePos.y, vehiclePos.z, 80.0, GetHashKey(spikemodel), 1, 1, 1)
                local spikePos = GetEntityCoords(spikes, false)
                local distance = Vdist(vehiclePos.x, vehiclePos.y, vehiclePos.z, spikePos.x, spikePos.y, spikePos.z)

                if spikes ~= 0 then
                    nearSpikes = true
                else
                    nearSpikes = false
                end
            else
                nearSpikes = false
            end
        else
            nearSpikes = false
        end

        Citizen.Wait(0)
    end
end)

Citizen.CreateThread(function()
    while true do
        if nearSpikes then
            local tires = {
                {bone = "wheel_lf", index = 0},
                {bone = "wheel_rf", index = 1},
                {bone = "wheel_lm", index = 2},
                {bone = "wheel_rm", index = 3},
                {bone = "wheel_lr", index = 4},
                {bone = "wheel_rr", index = 5}
            }

            for a = 1, #tires do
                local vehicle = GetVehiclePedIsIn(PlayerPedId(), false)
                local tirePos = GetWorldPositionOfEntityBone(vehicle, GetEntityBoneIndexByName(vehicle, tires[a].bone))
                local spike = GetClosestObjectOfType(tirePos.x, tirePos.y, tirePos.z, 15.0, GetHashKey(spikemodel), 1, 1, 1)
                local spikePos = GetEntityCoords(spike, false)
                local distance = Vdist(tirePos.x, tirePos.y, tirePos.z, spikePos.x, spikePos.y, spikePos.z)

                if distance < 1.8 then
                    if not IsVehicleTyreBurst(vehicle, tires[a].index, true) or IsVehicleTyreBurst(vehicle, tires[a].index, false) then
                        SetVehicleTyreBurst(vehicle, tires[a].index, false, 1000.0)
                    end
                end
            end
        end

        Citizen.Wait(0)
    end
end)

You could do something like

local PedInVehicle = false
local PlayerPedIdVar = PlayerPedId()
local vehicle = nil
local PlayerSeat = nil

RegisterNetEvent('baseevents:enteredVehicle')
AddEventHandler('baseevents:enteredVehicle', function()
  PedInVehicle = true
  vehicle = currentVehicle
  PlayerSeat = currentSeat
end)

RegisterNetEvent('baseevents:leftVehicle')
AddEventHandler('baseevents:leftVehicle', function()
  PedInVehicle = false
  Vehicle = nil
  Seat = nil
end)

Citizen.CreateThread(function()
    while true do
        if PedInVehicle then
            if PlayerSeat == -1 then
                local vehiclePos = GetEntityCoords(vehicle, false)
                local spikes = GetClosestObjectOfType(vehiclePos.x, vehiclePos.y, vehiclePos.z, 80.0, GetHashKey(spikemodel), 1, 1, 1)
                local spikePos = GetEntityCoords(spikes, false)
                local distance = Vdist(vehiclePos.x, vehiclePos.y, vehiclePos.z, spikePos.x, spikePos.y, spikePos.z)

                if spikes ~= 0 then
                    nearSpikes = true
                else
                    nearSpikes = false
                end
            else
                nearSpikes = false
            end
        else
            nearSpikes = false
        end
        Citizen.Wait(0)
    end
end)

Citizen.CreateThread(function()
    while true do
        if nearSpikes then
            local tires = {
                {bone = "wheel_lf", index = 0},
                {bone = "wheel_rf", index = 1},
                {bone = "wheel_lm", index = 2},
                {bone = "wheel_rm", index = 3},
                {bone = "wheel_lr", index = 4},
                {bone = "wheel_rr", index = 5}
            }

            for a = 1, #tires do
                local tirePos = GetWorldPositionOfEntityBone(vehicle, GetEntityBoneIndexByName(vehicle, tires[a].bone))
                local spike = GetClosestObjectOfType(tirePos.x, tirePos.y, tirePos.z, 15.0, GetHashKey(spikemodel), 1, 1, 1)
                local spikePos = GetEntityCoords(spike, false)
                local distance = Vdist(tirePos.x, tirePos.y, tirePos.z, spikePos.x, spikePos.y, spikePos.z)

                if distance < 1.8 then
                    if not IsVehicleTyreBurst(vehicle, tires[a].index, true) or IsVehicleTyreBurst(vehicle, tires[a].index, false) then
                        SetVehicleTyreBurst(vehicle, tires[a].index, false, 1000.0)
                    end
                end
            end
        end

        Citizen.Wait(0)
    end
end)

yeah, but only thing that makes the spikes in the scripts are the loops itself, if there would be a way to cancel those loops there wouldnt be any spikes :smiley: , but if i’d cancel the loops, tires wont pop :smiley:, or by the code you did, it would spike up only for a driver :stuck_out_tongue:

I thought the use of loops calling natives constantly along with re-declaring variables was what decreased performance?

i can dig into it bit later :smiley: , maybe ill find a fix for it but not sure, btw tried your version somewhy it didnt pop the tires :D, but didnt really dig into it atm :stuck_out_tongue:

I’l clean it up and send it back to you, hadn’t had time to test it, it was just theoretical

sure, thanks for the help, right now working on another project as well, getting late here too its 11pm here, and soon off to sleep! :smiley: and as well you can find the support platfrom from the tebex home page, you can join there!

For some reason my GTA native spikes do not work. The second the prop is spawned they instantly de spawn. I have looked through every single file for “PD_Stinger” or whatever the prop name is but nothing specifies blacklisting that prop. In addition my anti cheat is not blocking that prop. Any idea? I want to use this!!

you can try other spikes - Click here!

Hello, how i can open the Target Menü/System?

With your target script keybind, just look at the spikestrips with your target sytstem.