[FREE][STANDALONE] Towing script



I’ve made this script for a server which I used to develop for around a year ago, unfortunately though, the server has died before even having a go at using the script, originally it was meant to work with the ESX framework only, but I’ve decided to convert it to be a standalone script, the reason why I made this script in the first place was because I’ve seen a similar one which was/is paid, so I preferred to give it a go myself as I was pretty sure I could recreate it myself.

Anyway, enough backstory for the origin of this script.

Here’s the github where you can get it: GitHub - SupremeCatOG/towing

Here’s a quick and nasty showcase of the script: Towing showcase, meh - YouTube

Don’t use this code to make yet another paid version of this :slight_smile: .

24 Likes

This looks great! Have you tried to attach vehicles on big trailer when those trailers are disconnected first?

1 Like

i love u

1 Like

Everything should work just fine as the vehicles attach to the trailer itself.

hi did u try and check to fully work with onesync infinty

2 Likes

The server this was built for was a 64 slot server, therefore using Onesync, when we tested it everything seemed to work fine, I don’t know if that’s also true for servers that have more than 64 slots.

Looking great, is it possible for other players do detach my attached vehicle?

Haven’t thought about that, I’ll play a little with the script tomorrow and I’ll update it if I get it working properly.

Awesome stuff!

1 Like

QUICK UPDATE

  • Added a check to see if the vehicle is attached to anything before trying to detach it.
  • Added notifications for the /detach command.
  • Borrowed QBCore’s GetClosestVehicle() function (clearly all credits go to them for it) as it finds trailers besides all the other vehicles.
2 Likes

Good, I don’t know if you thought that the ramp is not that ramp and is the one that was created for the [Release] Flatbed w/ working bed it is very good but it has a I failed that when you hit the block on the ramp the vehicle crashes the script but I think that with the descent of Tampa that your script has more would look much better, sorry for the plate, it is a personal opinion that I have and thanks for the script It works very well

1 Like

There seems to be a problem when using the command deployramp that deletes the truck FLATBED

hmm, odd, could you tell me how it happened? Did you restart the script before deploying the ramp on the truck, or did it just do it the first time you tried the command, can you think of a way to reproduce the bug?

When I write the command, this problem occurs, however, I did not do anything, I just downloaded and installed it only, and when I choose the truck FLATBED and type the command deployramp, it may delete the truck and it appears as in the picture above

Just made it back home, should’ve fixed the bug, feel free to download the updated version of the script from the repository.

1 Like

Is there any possibility to use addon vehicles?

Sure, at the top of the client file there’s a list of whitelisted vehicles, just add the addon vehicle you want to use in there.
Besides whitelisting it, you want to play with the offset to make the ramp be at the position you want it.

I understand. What happens is that I have been trying to add a custom flatbed, but it does not allow to deploy the ramp or attach any vehicles to it. I tried adding a “sultan” to the whitelist and that one worked perfectly. However, I have tried with several addon vehicles but none of them are really allowed to use the functions.

Alright, I’ll give it a look and I’ll let you know.

Forget it, it was my mistake. I was putting the name of the addon vehicles in upper case following the examples you posted, but for the addons, the name should be in lower case. Everything worked perfectly!