[Release] Towtruck Script V1.2

thats an awesome idea i never thought of doing that. i always used the simple trainer.

How do you locate the XYZ for the vehicle?

2 Likes

i have a tow truck in game and when i do it it flots behind it now i need to make it so the truck sits here FlatbedX=-0.850
FlatbedY= 2.550
FlatbedZ= 0.690

i do not know how to make it so it sits there

could you show me your file on this ive tried and cant get it to work for some reason i assume your using trflat right

I would like to get this script to work with this model help

This one will. https://forum.cfx.re/t/release-just-another-towing-script/56408/13

Great Script
Keep up the good work @asser90

it took me an hour to get the numbers right for this truck model. BUT I got it towing vehicles mounting them to the center of the bed…

long shot here but anyone know how to convert this to vrp

Is it possible to add other vehicles / add-on, that i could do /tow. Not only flatbed

Im sure you can with this one but i would look into https://github.com/Deziel0495/ImprovedTowTruckScript

I tried that one, but it doesn’t work on my server. It says couldn’t load resource…

That’s weird works perfectly fine for me. i don’t have much experience with this one only the one i linked. but i am working on a C# tow script that i might release soon when i get it finished

1 Like

I am trying to actually be just able to fix the car while driving onto the trailer, but my head doesn’t get how to do that… Still would look much better then just teleporting there :confused: :slight_smile:

Any advice how?

Script works great, thank you very much, but is there any way to rotate a vehicle by 90 degrees? When use the tow script with the cartrailer, it attaches the car nose up, but works perfectly for all other tow trucks I added. Keep up the great work.

Other than me having trouble getting this script to work, it just says I’m too far away from a vehicle

For those wondering how to rotate the cars.

Step One
For each trailer add the rotate variables

['thauler'] = {x = 0.0, y = 0.0, z = 0.0, rotx = 0.0,  roty = 0.0, rotz = 0.0}

Next

define new varibles below

local xoff = 0.0
local yoff = 0.0
local zoff = 0.0

They should look like this

local xrotoff = 0.0
local yrotoff = 0.0
local zrotoff = 0.0

Next
set the variables to what u entered below

xoff = posOffset.x
yoff = posOffset.y
zoff = posOffset.z

should look like this

xrotoff = posOffset.rotx
yrotoff = posOffset.roty
zrotoff = posOffset.rotz

Lastely add them to the attach entity refrence

AttachEntityToEntity(targetVehicle, vehicle, GetEntityBoneIndexByName(vehicle, 'bodyshell'), 0.0 + xoff, -1.5 + yoff, 0.0 + zoff, 0.0 + xrotoff, 0.0 + yrotoff, 0.0 + zrotoff, 1, 1, 0, 1, 0, 1)

X: Front and Back Tilt | + will tilt ur nose up, - will tilt the back end up.
Y: Roll Left and Right Tilt | + Will tilt the body to the right, - will tilt the body to the left.
Z: Left and Right Turn | + Will turn the car to the left, - will turn the car to the right

1 Like

@Jsturnage how do i get it centered to that model?

No vehicle to tow? i litteraly did everything right…

this works very good but the only problem is the mechanic cant use it, me as an admin it works great any help ?