Enter locked vehicle without triggering hotwire animation

Hello,

I’m creating a vehicle hotwiring minigame. However, I can’t figure out how to stop the hotwire animation/task from automatically triggering after a locked vehicle’s window is smashed and the vehicle is entered. Can anyone point me in the right direction on how to accomplish this?

Thanks!

Hey @datahex
Have you already tried to use a native?
Maybe this one.

I’ve tried a few natives including CancelEvent, StopAnimTask and ClearPedTasks but so far nothing has worked.

Well, I don’t really know then :confused:
Hope you find a fix for that

datahex via FiveM [email protected] escreveu no dia domingo, 24/03/2019 à(s) 17:48:

The animation is started if the vehicle is set to “need hotwiring” natively

you can use:

IsVehicleNeedsToBeHotwired(veh)

it will return TRUE if the veh is set to need hotwiring, so you can check before hand (though it may not be necessary to check)

you can use:

SetVehicleNeedsToBeHotwired(vehicle, false)

when the person is getting in the car to disable the natural hotwiring system.

you can use:

if DoesEntityExist(GetVehiclePedIsTryingToEnter(PlayerPedId())) then --is player entering a vehicle

to detect if the ped is currently getting in a vehicle

edit: made more simple example

actually, i made it a mod. ill add a release thread:

2 Likes