MaDHouSe79 / mh-trailers

MH-Trailers for (QB/ESX) Transport all your vehicles with trailers.
GNU General Public License v3.0
31 stars 9 forks source link

mh-trailers not working qbcore #6

Closed jn1001 closed 6 months ago

jn1001 commented 8 months ago

Hello I wanted to use youre script but had a few issues.

The script isnt working with qb-target. Also with ox_target its partially not working the shop throws errors nil global lib.

Also there is Config.Target and Config.Menu missing in Config.lua.

Thats all I could find sofar.

tom091291 commented 8 months ago

check my pr fix so far is in there for qbcore

MaDHouSe79 commented 8 months ago

Hello I wanted to use youre script but had a few issues.

The script isnt working with qb-target. Also with ox_target its partially not working the shop throws errors nil global lib.

Also there is Config.Target and Config.Menu missing in Config.lua.

Thats all I could find sofar.

check the core files, cause the Config.Target and menu do exsist.

also check your fxmanifest.lua and edit to your server needs.

jn1001 commented 8 months ago

Our server runs ox_lib as a dependencie for other ressources but we dont run ox_target. Thats why it probably isnt working.

dotkee commented 8 months ago

Our server runs ox_lib as a dependencie for other ressources but we dont run ox_target. Thats why it probably isnt working.

If you go to mh-trailers -> core -> mconfig.lua On line 22 Config.Target = "ox_target" -> Config.Target = "qb-target"

MaDHouSe79 commented 8 months ago

try a new one the code is updated 😅

jn1001 commented 8 months ago

grafik

Thats what I changed:
Config.Target = "qb-target" -- qb-target or ox_target
Config.Menu = "qb-input"    -- qb-input or ox_lib
Config.FuelScript = 'cdn-fuel'
MaDHouSe79 commented 8 months ago

change in core/mconfig.lua this

From

if GetResourceState("ox_lib") ~= 'missing' then
    Config.Target = "ox_target" -- qb-target or ox_target
    Config.Menu = "ox_lib"      -- qb-input or ox_lib
elseif GetResourceState("ox_lib") == 'missing' then
    Config.Target = "qb-target" -- qb-target or ox_target
    Config.Menu = "qb-input"    -- qb-input or ox_lib
end

To

if GetResourceState("ox_lib") ~= 'missing' then -- this means you have ox_lib installed
    Config.Target = "qb-target" -- qb-target or ox_target
    Config.Menu = "ox_lib"      -- qb-input or ox_lib
elseif GetResourceState("ox_lib") == 'missing' then -- this means you dsont have ox_lib installed
    Config.Target = "qb-target" -- qb-target or ox_target
    Config.Menu = "qb-input"    -- qb-input or ox_lib
end

cause you use ox_lib and no ox_target right?

jn1001 commented 8 months ago

I have tried it now multiple times but I cant third eye the shop ped if I use ox_lib with qb-target.

jn1001 commented 8 months ago

I have tried it now multiple times but I cant third eye the shop ped if I use ox_lib with qb-target.

switch off to qbx

Hi, what do you mean exactly with switch off to qbx?

I mean why does it not work with qb-target and qb-input?

MaDHouSe79 commented 8 months ago

did you already download a new one? cause it is updated yesterday.

jn1001 commented 8 months ago

I updated and now the qb-target with qb-input works I can rent a truck. It takes the money and spawns only the truck without a trailer and I cant enter even the spawned truck its locked.

Also people can keep renting trucks and keep spawning new ones in and create chaos.

MaDHouSe79 commented 8 months ago

I updated and now the qb-target with qb-input works I can rent a truck. It takes the money and spawns only the truck without a trailer and I cant enter even the spawned truck its locked.

Also people can keep renting trucks and keep spawning new ones in and create chaos.

Ok i just fix that, hope this works for you, you need to download a new one to test it.

jn1001 commented 8 months ago

grafik

I updated but its the same menu works spawns the truck only takes money and truck is locked. Trailer doesnt spawn and this is the console output. And I can keep spawning trucks still. Just saw that it takes 500 from cash if you have cash. If you have 0 it does not take any money from the bank or sends a notification that you dont have enough money. Instead it just spawns the truck without trailer and without taking any money from the player.

Also tested it in a newly fresh qb-core server only for the test same behavior.

MaDHouSe79 commented 8 months ago

what are you doing? are you just download it and load it in the server? you don't look to any config file? fuel of something? cause this is in the mconfig.lua.

jn1001 commented 8 months ago

I forgot this time the fuel config. But the script still doesnt take money from you if you have 0 cash and still lets you rent a truck without paying anything. Also I get a notification that I got the keys to the vehicle but if I get out and try to enter again I dont have them. Also while sitting in the truck I cant lock or unlock doors.

MaDHouSe79 commented 8 months ago

I forgot this time the fuel config. But the script still doesnt take money from you if you have 0 cash and still lets you rent a truck without paying anything. Also I get a notification that I got the keys to the vehicle but if I get out and try to enter again I dont have them. Also while sitting in the truck I cant lock or unlock doors.

try if it works now with the money, cause i change stuff and you have to need to look inside mconfig.lua if the key does not work.

jn1001 commented 8 months ago

The money issue is fixed.

We use qb-vehiclekeys and I changed it in the config to this: -- Vehiclekeys trigger Config.UseServerTrigger = true Config.ServerVehicleKeyTrigger = "qb-vehiclekeys:server:AcquireVehicleKeys"

Config.UseClientTrigger = false Config.ClientVehicleKeyTrigger = "vehiclekeys:client:SetOwner"

I tried both and with both I dont get a key.

MaDHouSe79 commented 8 months ago

The money issue is fixed.

We use qb-vehiclekeys and I changed it in the config to this: -- Vehiclekeys trigger Config.UseServerTrigger = true Config.ServerVehicleKeyTrigger = "qb-vehiclekeys:server:AcquireVehicleKeys"

Config.UseClientTrigger = false Config.ClientVehicleKeyTrigger = "vehiclekeys:client:SetOwner"

I tried both and with both I dont get a key.

it sute work now

jn1001 commented 8 months ago

You mean you updated again or the way its set up should work?

MaDHouSe79 commented 8 months ago

you need to download again and setup it for your server, but the keys sute work now, i just test it and it works.

MaDHouSe79 commented 8 months ago

can you add options for qbx vehicle keys ?

https://github.com/MaDHouSe79/mh-trailers/blob/28f83410fc78f798c4500726c3f27877a65e926d/core/mconfig.lua#L41