[Release] Towtruck Script V1.2

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 ?

Is there a way to put a timer on it so it takes a couple minutes for the car to get onto the flatbed?

Good work and release. A lil outdated for this era, but with a little work it can be modified to work really well. - Thanks for the release.

how? bud`

were you able to find out how to add addon flatbeds? I know this is a year after your post but I am just now trying to do the same thing you are.

I think yes, but sorry man can’t remember much from then xD. I will reply to u again if I find anything

Oh ok cool, thanks!

1 Like

how do i fix this

so i had the script running for mmonths now, no problem.
only recently with artifact 2668 + it seemed that attaching the entity doesnt work anymore. idk why but the car ist just “glued” behind the truck and doesnt get attached to it.

how do i add more than one truck/trailer. everytime ive tried adding more than one it breaks

How can i add more models of flatbeds? Like, policeflatbed, policeflatbed2.
I tried but just one works with the script… Pls help!

Can somebody help ? The car is behind the Tow truck but I get the message “There is no vehicule to tow” event if it’s freackign close to the flatbed

ui78fyfsdsujlasiy

is it possible to add vehicles so the are registered tow trucks