After my recent flatbed script post I received quite a lot of requests to make a towing script as well, which could be used together. Well, here it is! There is a big focus is synchronization, since this is a common issue for scripts using ropes. Winch functionality is also included and synchronized.
If it is drivable simply add the vehicle to the configuration, I already preconfigured three vehicles:
// All vehicles below have a tow rope that can be used. The x-y-z coordinates are the location with respect to the center of the vehicle, where to rope can be picked up.
Config.TowVehicles = {
[GetHashKey('flatbed')]: [0.0, 0.9, 0.6],
[GetHashKey('kamacho')]: [0.0, 2.6, 0.3],
[GetHashKey('mesa3')]: [0.0, 2.2, 0.0],
};
I have noticed that if you grab the rope and put it back without hooking a vehicle, the keys are still disabled so you canβt get back in the truck without reloading. Sadly, I didnt realize this until after integrating ox-target(and i probably didnt do it the right way) so the fixes i upload here will only work if you use ox target or disable it in the config. config.js (2.0 KB)
cl_main.js (26.7 KB)
EDIT: not sure what i did wrong but the old cl_main was only 4KB so my βfixesβ are clearly not as optimized as the originial resource