[ESX][fork] hsn-hotwire (w/ Mini Game)

https://github.com/juddisjudd/hsn-hotwire

NOTE:
I am not using mythic_notify in my preview video but mythic_notify is used in the script.

exports[‘hsn-hotwire’]:AddKeys(plate)

You will need to add something like the following in any scripts that spawn your own car:

local plate = GetVehicleNumberPlateText(vehicle)
or
local plate = GetVehicleNumberPlateText(veh, vehicle)

Requirements:
mythic_notify
rprogress
ESX Legacy
luke_textui or cd_drawtextui

Credits for original:
hsnnnnn

7 Likes

Always add preview on streamable or YouTube it never load on on forum

Added clickable link

Realy cool script !
Just a little question, it lock all cars, the owned cars too :stuck_out_tongue:
Maybe add exeption for owned cars and some models in config ?

Use the export in your scripts where you spawn a car and don’t want it locked.

You may also need to add something like:

local plate = GetVehicleNumberPlateText(vehicle)

I put this export in my garage script but don’t work. I made somthing wrong i think.

spawnVehicle = function(vehicle, fuel, enginehealth, dirtLevel, plate)

if IsAnyVehicleNearPoint(currentGarage.spawnPoint.coords, 5.0) then

    exports['okokNotify']:Alert("GARRAGE", "Un véhicule bloque la sortie.", 8000, 'error')

else

    ESX.Game.SpawnVehicle(vehicle.model, currentGarage.spawnPoint.coords, currentGarage.spawnPoint.heading, function(veh)

        ESX.Game.SetVehicleProperties(veh, vehicle)

        exports['hsn-hotwire']:AddKeys(plate)

        SetEntityAsMissionEntity(veh, true, true)

        --TaskWarpPedIntoVehicle(GetPlayerPed(-1), veh, -1)

        SetVehicleDirtLevel(veh, dirtLevel)

        SetVehicleEngineHealth(veh, enginehealth + 0.0)

        exports['LegacyFuel']:SetFuel(veh, fuel)

        exports['okokNotify']:Alert("PARKING", "Votre véhicule est prêt! Bonne route.", 8000, 'success')

        --SetVehicleEngineOn(veh, false, true)

    end)



    TriggerServerEvent('esx_simplegarages:server:updateCarStoredState', plate, 0)

end

end

What error are you getting, I am going to assume something about plate in which read my above comment.

Thanks, it’s working with :
local plate = GetVehicleNumberPlateText(veh, vehicle)

1 Like

Updated:
-Added Animations while hotwiring and searching
-Set disablemouse to false

For Animations to work correctly you must use v.0.7.3 of rprogress

Updated:
-Removed ugly DrawText3Ds and replaced with luke_textu or cd_drawtextui
-Fixed “givekeys” command

Updated:

  • Folder Structure
  • Added config.lua for easy swapping of textui options

Work in Progress:

  • Use of locales

Can you fix this error

Update your rprogress to latest version.

ok cheers i will try that now.

Works now cheers.

1 Like

RegisterNUICallback(

"BuyVehicle",

function(data, cb)

    SetNuiFocus(false, false)

    local veh = data.vehicle

    local playerPed = PlayerPedId()

    IsInShopMenu = false

    ESX.TriggerServerCallback(

        "otaku_vehicleshop:buyVehicle",

        function(hasEnoughMoney)

            if hasEnoughMoney then

                ESX.Game.SpawnVehicle(

                    veh.model,

                    Config.Zones.ShopOutside.Pos,

                    Config.Zones.ShopOutside.Heading,

                    

                    function(vehicle)

                        TaskWarpPedIntoVehicle(playerPed, vehicle, -1)

                        local newPlate = GeneratePlate(true)

                        local vehicleProps = ESX.Game.GetVehicleProperties(vehicle)                         

                        vehicleProps.plate = newPlate

                        SetVehicleNumberPlateText(vehicle, newPlate)
                        local plate = GetVehicleNumberPlateText(veh, vehicle)
                         exports['hsn-hotwire']:AddKeys(plate)

                        

                        TriggerServerEvent("otaku_vehicleshop:setVehicleOwned", vehicleProps)                           

                    end

                    

                )

            else

                ESX.ShowNotification(_U("not_enough_money"))

            end

        end,

        veh.model

    )

end

)

I did something like this but still hotwiring when i bought car

Why are you using veh when veh is not being used? look at your function

how can we notify the person they received the keys

I’m having problems

lol could never be me