So whenever I use a tow truck with a hook (even custom ones) it unhooks the vehicles after like 30 seconds.
Does anyone know how I can fix that bc my server has multiple tow companies and we dont want everyone driving around in flatbeds.
So whenever I use a tow truck with a hook (even custom ones) it unhooks the vehicles after like 30 seconds.
Does anyone know how I can fix that bc my server has multiple tow companies and we dont want everyone driving around in flatbeds.
try too look for scripts that mess around with towtrucks (if you have any ) maybe try to update your server to a newer version if you havent already done this.
I do not have this problem with unhooking vehicles on my Server atleast running on 3404
our only tow scripts affect flatbeds and our server is running 3402
hmm you could try and make a Script specially for the towtrucks (with hook) so you attach them with a keybind or somehitng like that.
just type towtruck in the Search bar and you will find like 6 more natives for that
Thanks I will have to look into that
I have a small amount of scripting experience so I will see what happens
Before I mess anything up tho, I will ask does anyone know what the best way to go about creating a script so any vehicle can be attached to a tow truck hook?
I have very basic experience coding and all of it is in java so im not gonna be great at coding here all help will be appreciated
If you know Java, I suggest you to start FiveM scripting with C# which is very similar in syntax.
To make that script, attach to the “Tick” event, which is executed every game tick:
public class TowScript : BaseScript // : is the equivalent of "extends" in Java
{
[Tick]
private async Task Update()
{
}
}
Then check if the desired control was just pressed using IsControlJustPressed
Then write your logic in there.
Some useful natives:
PlayerPedId
GetVehiclePedIsIn
AttachVehicleToTrailer
How do I do this please I’m really struggling with two hook tow trucks I got realising the cars after so long then they stop attaching completly.