ZeroDream Towing
Vehicle towing system for FiveM
Features
- Towing cars
- Network synchronized ropes
- Custom rope connection bone of the vehicle
- Controllable rope length
- No framework require
Installation
- Clone or download this repo: kasuganosoras/zerodream_towing
- Copy the
zerodream_towing
folder to your server resources folder - Add
start zerodream_towing
to your server.cfg - Restart the server
How to use
By default, you can use the command /tow
to tow your cars.
The car should have a
attach_female
bone, if not it will say ‘Not allowed to tow’.You can change the bone name in
config.lua
, I suggest usingchassis
orneon_b
for the tow car bone.
- Close to the first car and type command
/tow
- Go to the second car and type it again
- Now your cars should be connected
- Using Page Up / Page Down to control the rope length (Keys can be changed in config)
- Type the command
/tow
again to disconnect the cars
If you want to integrate it into your scripts, please read the API documentation below.
API
SetTowVehicle: Use this function to set the towing car, you have to call it two times to set the first and second vehicle.
local vehicleA = GetVehiclePedIsIn(GetPlayerPed(-1), false)
local vehicleB = GetVehiclePedIsIn(GetPlayerPed(2), false)
exports["zerodream_towing"]:SetTowVehicle(vehicleA)
exports["zerodream_towing"]:SetTowVehicle(vehicleB)
FreeTowing: This function will detach the cars immediately.
if IsControlJustPressed(0, 51) then
exports["zerodream_towing"]:FreeTowing()
end
Credits
- PocceMod: https://github.com/razzie/PocceMod
Change log
1.0.1 (2022.08.22) - Fixed rope length network sync issue
1.0.0 (2022.08.21) - First release