[RELEASE] esx_jb_trailer

yes but its the only way for police boat to work that i found as a solution. So a check could be added for police to use ray and then use closestvehicle for other boat. Unless you know another solution.

normally putting 127 as flag with closest vehicle should work , but it’s like it doesn’t :frowning:

here is the documentation:
https://pastebin.com/kghNFkRi

i test other numbers found on google and did not work either so the ray as of now is the only way to make the predator work. So on his pr he should make like it was but could make a config to look for police boat that needs ray so this way the only time user need to look at is the police and well police should know that when they become a police. For now this could be a solution.

Yes i saw that documentation but i wish gta sometime wouldn’t make all this stuff unorganized or complicated XD

So im almost done with the list i had done with traillersmall then i will made a pr with then i will take a little break with this lol It’s very boring lol Spawn car get back in truck to get the marker then go in marker test car, tweak xyz, restart script test again then dv. repeat.
Once i do the pr i will compare the list that ive done with the list your provided then i will display what car are not done and if someone wants to do it or help then they can.

what a possible fix could be is getting the latest vehicle the player was in. then it will always return an entity. but then you may not be in any other car then the car you want to ‘tow’
you will have to check weather the vehicle is the vehicle attatched to the trailer or not (if you inderstand what i am saying )
so look if salder has a trailer if it does it may not be towed he must enter again the car he wants to tow

1 Like

But if you tow multiple car that mean you need to go in car after entering tow then tow car then get in new car then tow. This probably makes it more confusing for player. I mean the ray cast was meant only for police boat which is mostly for police which you can tell them when in training.

well it is like that now ? isn’t it, if you want vehicle on the big trailer you need to get your vehicle, put it on the spot where it triggers closest vehicle then getting a new car then again driving to the spot getclosestvehicle.

you could easilt remove getclosest vehicle and get the last vehicle entered

Yeahh if you look it that way. I guess that is true. Then i guess this solution is probably best then when i think of this this mean even if there is two car close to that marker would mean if would indeed use the one you entered :stuck_out_tongue: I Think this would be the best alternative.

yes you only need to check if vehicle is empty (no one is driving) and close to the trailer, becasue otherwise maybe someone will steal vehicle and the stolen vehicle is in the north an you are at the airport and then you trigger get latest vehicle and put it on my trailer players will look weard :’)

use this native
https://runtime.fivem.net/doc/natives/#_0x9A9112A0FE9A4713

1 Like

Worked like a charm :smiley: then for check i could use this GetPedInVehicleSeat to make sure no one is in right ?

Ill have to test this when my friend is around.

here i did a test with all flags in a for loop and these were the results:
al those flags did trigger police cars and police helicopters:
policehelicopterflags: https://pastebin.com/XzYjLnEb
policecarflags: https://pastebin.com/aYKLSKvM
policeboatflags: https://pastebin.com/xi1gKWHD
@XxFri3ndlyxX

1 Like

This is a lot of flags wow. Damn rockstar. Why so many.

yea but there are no flags in common :frowning: otherwise would be great and we would have taken that common flag

I’ve created a PR to allow more language options, instead of only having French. I’ve added English.

1 Like

New update coming soon :smiley:

  • New Trailer config added.
  • New configuration added. Now you have option to disable Towing if said vehicle is not on the list.
  • This configuration is per trailer. So each trailer can be enabled or disabled.
  • Keybing are now configurable directly from the config
  • Disabling detach trailer for controller as it interfere and by default gta has dpad right to detach so it not necessary.
  • Long hours has been put into this.
Config.Key    = 26 -- Default is C on Keyboard or R3 on Controller

-- Set to true if your using a controller. Looking behind will no longer detach your trailer and you can still use d-pad right to detach trailer as usual.
Config.DisableController = false 
Config.DetachTrailerKey  = 29 -- B on keyboard by default. Wont work if DisableController is set to true

Config.SmallTrailerTowListOnly = true -- Set to false if you want to tow vehicle that are not on the list of the Cartrailer 
Config.BoatTrailerTowListOnly  = true -- Set to false if you want to tow vehicle that are not on the list of the Boattrailer
Config.BigTrailerTowListOnly   = true -- Set to false if you want to tow vehicle that are not on the list of the Trucktrailer.
Config.PjTrailerTowListOnly    = true -- Set to false if you want to tow vehicle that are not on the list of the PjTrailer.

Todo list

  • Add a check for PjTrailer so that if position front or back is used. Middle can’t be used so that vehicle are not clipping.
  • Adding the rest of the gta cars. Not sure when i will do this. Very long hours to do and very boring.

Video

Enjoy!

You can download it here until @Jager_Bom update his github.

2 Likes

how do i detach a boat please

Go to the rear left side of boat trailer you will see top left screen tow thing. Press C or R3 to tow detach. Your boat will detach.

1 Like

so walking into the marker on any trailer causes the script to break this is a server where this is the only resource also gives an error cannot find nill value at the attach vehicle code line instead of the text menue

i got the two small trailers to work but the two large ones just blink the marker then breaks it
large ones give this now when i press C for the tow menu

there must me something wrong with locales, gonna look at it now :slight_smile:
thanks for reporting