mGarage
mGarage Documentation
Last updated
mGarage Documentation
Last updated
Update your artifacts from here https://runtime.fivem.net/artifacts/fivem/build_server_windows/master/
In order to run this script your artifact should be the latest update or +set sv_enforceGameBuild 2699 this gamebuild. Also onesync has to stay open.
Drag codem-garage into your resources folder.
Select framework you're using options are esx, newqb and oldqb.
Select the sql you're using option are oxmysql, ghmattimysql, mysql-async from config.
Create a discord bot token and paste it to here (this is necessary to get players' discord profile image).
Insert the SQL File to your SQL. Please insert the right one for your framework.
For ESX the part of vehicle price list is in the esx-insert file.
For QB the part of vehicle price list is inside the ""qb-core/shared/vehicle.lua "
If you are using something other framework its must be in the " client/function.lua "
You can edit the down below codes to configure this.
If you want to close " repair, transfer, sell " you can close it via config.
Config.InteractionHandler = "drawtext" -- "qb-target","drawtext","custom" is a custom interaction handler. This is the code for open garages.
qb-target
You can also configure this to your own target system from down below.
Config.InteractionHandler2 = "drawmarker" -- "drawtext", "drawmarker","custom" is a custom interaction handler. This is the code for parking cars to garage.
Drawmarker
Drawtext
You can configure the job garage vehicles plate number from config.
You can adjust the mileage format that displays maximum speed on vehicle specs from config.
KM = KMH
MI = MPH
You can change the default sell price from config.
If a vehicle doesn't have a sell price it'll automaticly configure itself to default sell price.
You can adjust the fuel system from config.
If you are using another fuel system you can adjust it from down below codes.
You can adjust the repair and vale price and money types from config as well.
You can adjust your notification from down below codes from config.
You can change your vehicle weights according to their classes from config.
You can change your vehicle text according to their classes from config.
You can change camera position for garages. In order to that follow the steps.
Get the positions where you want your garage camera to be shown.
And get your coordinates.
And paste it with the order of x,y,z.
1.To give your vehicle a name go to " client/vehicle_name.lua " and change the following codes.
'techart17' is the vehicle code, 'Porsche Panemara' is the vehicle name.
2.If you want to add a logo for this vehicle change the following codes.
You need to adjust this from Config.CarLogo. Also be sure that your file format is in the "nui/images/logo" as PNG.
3. If you want to adjust the vehicle preview footage change the following codes.
You can add it from Config.CarImage. Add the png formated file name near to your car name. Also be sure that your preview footage png file is in the "nui/images/cars".
4. If you set eveything correctly you'll get this view on garage.
1.Go to "qb-phone/client/main.lua" and find the codes down below.
And change this codes to down below codes.
2.Go to "qb-phone/server/main.lua" and find the codes down below.
And change this codes to down below codes.
3.If your phone is not opening go to "qb-phone/fxmanifest.lua" and delete the '@qb-garages/config.lua'.
If its still not opening go to your database and change the parking column value to " Garage A ".
4.Done!
You can use this trigger snippet.
If you are not going to use it for gangs " ["gang"] = "none" " this part has to stay like this.
'grade = 0' means that in your job employees that has grade 0 and above that can see that vehicle.
'grade = 2' means that in your job employees that has grade 2 and above that can see that vehicles and thefore 0 and 1 can't see it.
If you want to add new vehicles you can go in the order like 6-7-8 like down below.
If you are getting this error " [Codem] Missing vehicle read documentation: ... " in your vehicles part shown below seen as null therefore script can't reach the vehicles.
If you are getting this error "[^3WARNING^7] Ignoring vehicle ^5%s^7 due to invalid Model ..." your vehicle model is incorrect so it means either there is no vehicle like that or there is something wrong in vehicle handling files.
https://codem.tebex.io/package/5296269