Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
local playerPed = GetPlayerPed(-1)
local coords = GetEntityCoords(playerPed)
local veh = GetVehiclePedIsIn(playerPed)
local plate = GetVehicleNumberPlateText(veh)
seat = GetPedInVehicleSeat(veh, index)
if IsPedInAnyVehicle(playerPed, false) and GetPedInVehicleSeat(GetVehiclePedIsIn(GetPlayerPed(-1), false), -1) == GetPlayerPed(-1) then
if not trackedVehicles[plate].canTurnOver then
local vehPos = GetWorldPositionOfEntityBone(veh, GetEntityBoneIndexByName(veh, "bonnet"))
if hassearched[plate] == false or hassearched[plate] == nil then
DrawText3Ds(vehPos.x, vehPos.y, vehPos.z, "Press [H] to hotwire / [Z] to search for keys")
elseif hassearched[plate] == true then
DrawText3Ds(vehPos.x, vehPos.y, vehPos.z, "Press [H] to hotwire")
end
if IsControlJustPressed(0, 304) then
useds = false
TriggerEvent("disc-hotwire:hotwire", useds)
end
if IsControlJustPressed(0, 20) and not hassearched[plate] == true then
searchvehicle()
else
end
end
end
end
end)