hello thank you for giving me a few minutes, my question is very simple, I retrieved the functionality of esx_ambulancejob EMS to buy their own vehicle
I tried to add this to the esx_mechanicjob mechanics
everything seems to go except for entry into the marker
the viewing view of the purchase is only done at the 2nd opening of the menu and when I want to buy the vehicle money but removed a request is sent to the database, but there is an error and the vehicle is not bought
here are my files client main.lua (44.4 KB)
server main.lua (12.0 KB)
and the errors I think this is not very bad but I do not find the problem ^^
[MySQL:5.7.26] [esx_vehicleshop] [3ms] SELECT * FROM owned_vehicles WHERE owner = ‘steam:1100001010fc0b4’ AND type = ‘car’ AND job = ‘mechanic’
[MySQL:5.7.26] [esx_vehicleshop] [3ms] SELECT 1 FROM owned_vehicles WHERE plate = ‘OIU 413’
[MySQL:5.7.26] [esx_vehicleshop] [3ms] SELECT 1 FROM owned_vehicles WHERE plate = ‘BGW 619’
SCRIPT ERROR: @esx_mechanicjob/server/main.lua:352: attempt to index a nil value (global ‘MySQL’)TriggerServerCallback (@es_extended/server/functions.lua:33)
handler (@es_extended/server/common.lua:88)
and when I do it with the ambulance craft that works very well
[MySQL:5.7.26] [esx_vehicleshop] [3ms] SELECT 1 FROM owned_vehicles WHERE plate = ‘AEE 958’
[MySQL:5.7.26] [esx_vehicleshop] [3ms] SELECT 1 FROM owned_vehicles WHERE plate = ‘QFB 060’
[MySQL:5.7.26] [esx_vehicleshop] [7ms] SELECT 1 FROM owned_vehicles WHERE plate = ‘GGX 852’
[MySQL:5.7.26] [esx_ambulancejob] [4ms] INSERT INTO owned_vehicles (owner, vehicle, plate, type, job,stored
) VALUES (‘steam:1100001010fc0b4’, ‘{“modFender”:-1,“wheels”:0,“modSuspension”:-1,“modEngine”:-1,“modOrnaments”:-1,“neonColor”:[255,0,255],“modDoorSpeaker”:-1,“windowTint”:-1,“fuelLevel”:51.4,“modFrontBumper”:-1,“modTrimA”:-1,“modWindows”:-1,“modHood”:-1,“modTrimB”:-1,“modTank”:-1,“modEngineBlock”:-1,“tyreSmokeColor”:[255,255,255],“modSpeakers”:-1,“modAirFilter”:-1,“modSteeringWheel”:-1,“modAerials”:-1,“modXenon”:false,“color2”:28,“modSideSkirt”:-1,“bodyHealth”:1000.0,“modFrame”:-1,“modHorns”:-1,“modArchCover”:-1,“modBrakes”:-1,“modPlateHolder”:-1,“modBackWheels”:-1,“modDashboard”:-1,“modExhaust”:-1,“modArmor”:-1,“color1”:112,“modSpoilers”:-1,“plateIndex”:4,“wheelColor”:156,“modSeats”:-1,“modDial”:-1,“plate”:“GGX 852”,“modTransmission”:-1,“modVanityPlate”:-1,“modStruts”:-1,“dirtLevel”:5.0,“modSmokeEnabled”:false,“modRearBumper”:-1,“modGrille”:-1,“neonEnabled”:[false,false,false,false],“modTurbo”:false,“engineHealth”:1000.0,“modShifterLeavers”:-1,“model”:1171614426,“pearlescentColor”:112,“extras”:{“1”:true},“modLivery”:2,“modAPlate”:-1,“modRoof”:-1,“modHydrolic”:-1,“modFrontWheels”:-1,“modTrunk”:-1,“modRightFender”:-1}’, ‘GGX 852’, ‘car’, ‘ambulance’, true)
[MySQL:5.7.26] [esx_vehicleshop] [3ms] SELECT * FROM owned_vehicles WHERE owner = ‘steam:1100001010fc0b4’ AND type = ‘car’ AND job = ‘ambulance’