kibra-mechanics

Current Version: 1.0.7

Setup

Step 1

Download the kibra-core and kibra-mechanics-flatbed3 files and then move it to the resources folder.

Step 2

In your server's server.cfg file, issue a command to start kibra-mechanics and kibra-core below your infrastructure's current mainfile (qbcore or es_extended).
start kibra-core
start kibra-mechanics
start kibra-mechanics-flatbed3

Step 3

Open kibra-core/shared/main.lua. And choose your Shared.Framework == "ESX" infrastructure.
Shared.Framework == "ESX" -- or "QBCore"

Step 4

Open your server's database management panel (phpmyadmin or HeidiSQL). Insert the following sql code into your database.
CREATE TABLE IF NOT EXISTS `kibra-mechanics` (
`id` int(11) NOT NULL,
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`owner` varchar(46) DEFAULT NULL,
`employees` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '[]',
`money` float NOT NULL,
`wage` float NOT NULL,
`discountrate` float NOT NULL,
`customers` text NOT NULL DEFAULT '[]',
`repairfee` float NOT NULL DEFAULT 0,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;

Step 5

Don't forget to restart your server. Good Roles :)

config-file

Config = {}
Config.DefaultMechanicName = "Mechanic" -- Default name of mechanical businesses.
Config.DefaultMechanicMoney = 1000 -- The amount of money to start mechanical businesses.
Config.UseVehicleKeys = true
Config.UseKibraVehicleShop = false -- This setting only applies to our customers using kibra-vehicleshops.
-- Thanks to this setting, in vehicle modifications, the prices of vehicle parts will be indexed to the sales prices of the vehicles.
Config.VehiclePriceToPartPriceRatio = 10 --% This setting is inversely proportional.
-- This ratio is the percentage value that determines how much the vehicle price will affect the part price.
-- IT CAN ONLY WORK WITH USERS OF KIBRA-VEHICLESHOPS.
Config.PlateInterchangeability = true -- If you enable this, players can change their license plate via the mechanic.
Config.EmployeesFreeDiscount = true -- It allows your employees to make modifications for free.
Config.UseRGBColor = true
Config.PlateSpace = true -- Allows players to leave spaces on the plates.
Config.RegisterVehiclePropsDatabase = true -- At the end of the modifications, it finds the vehicle from the database and updates the prop json column.
Config.MechanicsCompany = true -- If you mark as true, players can buy and operate mechanical businesses.
Config.PlateReplacementFee = 750 -- Plate Replacement Fee
Config.UseServerJobSystem = false -- [[This feature is a beta version.]] The operating system in the mechanics depends on the jobs.
Config.DefaultTechRank = 1 -- If you are using the Server job system, the rank to start when you recruit someone to your mechanic business.
Config.DefaultBossRank = 4 -- If you are using the Server job system, the rank to start when you owner someone to your mechanic business.
Config.RepairTime = 20 -- Vehicle engine repair time -- SECOND
Config.AutoPropsUpdate = true
Config.HudHideEvent = "" -- When the mod menu opens, it hides your hud.
Config.HudOpenEvent = "" -- When the mod menu is closed, it shows your hud.
Config.FixKitItem = "fixkit" -- The name of the car kit item that only repairs the engine.
Config.OnlyCarsInTheDatabase = false -- A setting that allows only vehicles purchased from the gallery or registered in the database to be modified.
Config.PlateMinimumLetter = 8 -- Minimum number of letters required for license plates
Config.MouseActiveKeyText = "Press Home"
Config.MouseActiveKey = "home" -- Mechanically open, key that activates and deactivates your keyboard and mouse control.
Config.VehicleSpeedUnit = "km/h" -- or "mph" or "ms"
Config.ModifiedAccessKey = 38 -- https://docs.fivem.net/docs/game-references/controls/
Config.BossMenuOpenKey = 38 -- https://docs.fivem.net/docs/game-references/controls/
Config.TowTruckSpawnKey = 38 -- https://docs.fivem.net/docs/game-references/controls/
Config.TowTrucks = {
{
Label = "Flatbed",
Model = "flatbed3",
isOut = false,
isAddon = false,
img = nil
},
{
Label = "Towtruck",
Model = "towtruck",
isOut = false,
isAddon = false,
img = nil
},
{
Label = "Slamvan",
Model = "slamvan",
isOut = false,
isAddon = false,
img = nil
},
}
Config.Opens = {
["Modify"] = {"[E]", "Modify Vehicle"},
["BossMenu"] = {"[E]", "Boss Menu"},
["VehicleSpawn"] = {"[E]", "Tow Trucks"},
["EnterTowTruck"] = {"[E]", "Enter A TowTruck"}
}
Config.Mechanics = {
{
Owner = nil,
Price = 100000,
MechanicName = nil,
DiscountRate = 0,
JobName = "mechanic", -- If you are using the server's job system, enter the job name.
VehicleSpawn = vector3(-356.51284790039,-119.94790649414,38.696281433105),
TownTruckSpawnCoord = vector4(-366.07720947266,-111.69420623779,38.696643829346,110.70636749268),
Customers = {},
VehicleRepairAndCleaningLaborPrice = 1000, -- Vehicle Cleaning and Repair Fee || This is the labor price only. The price may increase depending on the damage of the vehicle.
SalaryPerMod = 40, -- Percentage that employees will receive from their modification wages.
Money = 0,
Employees = {},
CenterCoord = vector3(-339.3092956543,-137.1961517334,38.699272155762),
BossMenuCoord = vector3(-347.41546630859,-133.4807434082,39.240417480469),
BlipShow = true,
Blip = {Id = 446, Scale = 1.0, Color = 2, Display = 4},
ModifiedAreas = {
{Coord = vector3(-338.6139831543,-137.64077758789,39.00968170166), Distance = 3.0},
{Coord = vector3(490.57504272461,5590.2646484375,794.02239990234), Distance = 4.0}
}
},
}
kibraSubMenus = {
["engine"] = {
priceDefault = 200, -- Plugin Level 1 Price.
pluginLevelPriceIncreaseRate = 3.5,
},
["brakes"] = {
priceDefault = 100, -- Plugin Level 1 Price.
pluginLevelPriceIncreaseRate = 2.5,
},
["transmission"] = {
priceDefault = 1000, -- Plugin Level 1 Price.
pluginLevelPriceIncreaseRate = 1.5,
},
["tyreSmokeColor"] = {
priceDefault = 300, -- Plugin Level 1 Price.
pluginLevelPriceIncreaseRate = 1,
},
["fender"] = {
priceDefault = 1300, -- Plugin Level 1 Price.
pluginLevelPriceIncreaseRate = 1.4,
},
["rightfender"] = {
priceDefault = 1500, -- Plugin Level 1 Price.
pluginLevelPriceIncreaseRate = 1.4,
},
["neonColor"] = {
priceDefault = 250, -- Plugin Level 1 Price.
pluginLevelPriceIncreaseRate = 1,
},
["cage"] = {
priceDefault = 2500, -- Plugin Level 1 Price.
pluginLevelPriceIncreaseRate = 1.4,
},
["lightbar"] = {
priceDefault = 750, -- Plugin Level 1 Price.
pluginLevelPriceIncreaseRate = 1.45,
},
["livery"] = {
priceDefault = 1050, -- Plugin Level 1 Price.
pluginLevelPriceIncreaseRate = 2,
},
["speakers"] = {
priceDefault = 650, -- Plugin Level 1 Price.
pluginLevelPriceIncreaseRate = 2,
},
["armor"] = {
priceDefault = 1000, -- Plugin Level 1 Price.
pluginLevelPriceIncreaseRate = 4.5,
},
["suspension"] = {
priceDefault = 350, -- Plugin Level 1 Price.
pluginLevelPriceIncreaseRate = 2.5,
},
["turbo"] = {
priceDefault = 750, -- Plugin Level 1 Price.
pluginLevelPriceIncreaseRate = 2.5,
},
["horn"] = {
priceDefault = 150,
pluginLevelPriceIncreaseRate = 1,
},
["wheels"] = {
priceDefault = 250, -- Plugin Level 1 Price.
pluginLevelPriceIncreaseRate = 1,
},
["spoiler"] = {
priceDefault = 150, -- Plugin Level 1 Price.
pluginLevelPriceIncreaseRate = 1.3,
},
["frontbumper"] = {
priceDefault = 450, -- Plugin Level 1 Price.
pluginLevelPriceIncreaseRate = 1.7,
},
["rearbumper"] = {
priceDefault = 350, -- Plugin Level 1 Price.
pluginLevelPriceIncreaseRate = 1.5,
},
["skirt"] = {
priceDefault = 50, -- Plugin Level 1 Price.
pluginLevelPriceIncreaseRate = 1.5,
},
["exhaust"] = {
priceDefault = 50, -- Plugin Level 1 Price.
pluginLevelPriceIncreaseRate = 1.5,
},
["grille"] = {
priceDefault = 550, -- Plugin Level 1 Price.
pluginLevelPriceIncreaseRate = 2,
},
["headlight"] = {
priceDefault = 250, -- Plugin Level 1 Price.
pluginLevelPriceIncreaseRate = 2,
},
["hood"] = {
priceDefault = 550, -- Plugin Level 1 Price.
pluginLevelPriceIncreaseRate = 2,
},
["roof"] = {
priceDefault = 260, -- Plugin Level 1 Price.
pluginLevelPriceIncreaseRate = 2,
},
["plate"] = {
priceDefault = 1500, -- Plugin Level 1 Price.
pluginLevelPriceIncreaseRate = 2,
},
["color1"] = {
priceDefault = 500, -- Plugin Level 1 Price.
pluginLevelPriceIncreaseRate = 2,
},
["color2"] = {
priceDefault = 300, -- Plugin Level 1 Price.
pluginLevelPriceIncreaseRate = 2,
},
["pearlescentColor"] = {
priceDefault = 200, -- Plugin Level 1 Price.
pluginLevelPriceIncreaseRate = 2,
},
["wheelColor"] = {
priceDefault = 380, -- Plugin Level 1 Price.
pluginLevelPriceIncreaseRate = 1,
},
["windowTint"] = {
priceDefault = 1080, -- Plugin Level 1 Price.
pluginLevelPriceIncreaseRate = 1.4,
}
}
Config.Notify = function(textx, type)
KIBRA.Natives.Notify(type, textx)
end
Config.ServerNotify = function(src, textx)
TriggerClientEvent('esx:showNotification', src, textx)
end
Config.Show = function(button, text)
KIBRA.Natives.UI.Show(button, text)
end
Config.Hide = function()
KIBRA.Natives.UI.Hide()
end
Config.VehicleKeysEvent = "vehiclekeys:client:SetOwner"
Config.VehicleAddKeyEvent = "qb-vehiclekeys:client:AddKeys"
Config.Text = {
["Notinstalled"] = "Not Installed",
["Attached"] = "Attached",
["ActivateMouse"] = "You have activated mouse movement",
["DisableMouse"] = "You have disabled mouse movement",
["YourNotAuthorized"] = "You are not authorized to do this!",
["transactionsuccessful"] = "You changed the part.",
["Level"] = "Level",
["Payment"] = "Payment",
["SendInvoice"] = "Send Invoice",
["SuccessPlate"] = "Plate change has been added to your cart.",
["NoRegisteredCar"] = "This vehicle is not a registered vehicle.",
["RemovedNeon"] = "You removed the neon system from the car.",
["SuccessMechanicSell"] = "You have successfully sold the Mechanical business. Your money has been sent to your bank account.",
["NoNearOne"] = "There is no one to transfer ownership.",
["TransferSuccess"] = "Ownership of the mechanical business has been transferred to you.",
["SuccesTransfer"] = "You Have Successfully Transferred Mechanical Ownership.",
["InNotGame"] = "The person is not in the game.",
["EnterA100DenKucuk"] = "Enter a value less than 100.",
["NotBlank"] = "You cannot leave this field blank!",
["Guncelledin"] = "You have updated the employee salary percentage.",
["SuccessWithdraw"] = "You have successfully withdrawn money from the Company Vault.",
["EnoughMoneyCompany"] = "There is not enough money in the company vault.",
["SuccessDeposit"] = "You have successfully deposited money into the company vault.",
["EnoughMoneyYou"] = "You don't have enough money on you.",
["YourselfNotFire"] = "You Can't Fire Yourself!",
["SuccessFired"] = "You successfully fired.",
["NotYourselfHire"] = "You cannot hire yourself.",
["HasInJob"] = "This person already has this job.",
["SuccessHasJobNew"] = "You have been successfully recruited.",
["NewJobHayirliOlsun"] = "You have been successfully recruited.",
["Kibroc"] = "You are the Mechanical Owner. There is no higher.",
["SuccessPromote"] = "Successfully promoted.",
["NotYourselfPromote"] = "You cannot raise your own rank.",
["NotBlankBro"] = "Enter a different mechanical name and do not leave it blank.",
["SuccessNameChange"] = "You have successfully changed the name of the company.",
["NotChanges"] = "You didn't make any changes.",
["DeletedBasket"] = "You deleted the modification from the basket.",
["RefusedCustomer"] = "The customer refused to pay.",
["SuccessCustomerPayment"] = "The customer successfully made the payment.",
["SuccessKanks"] = "Payment Successful.",
["YouHaveEnoughMoney"] = "You Have Insufficient Money.",
["NotRegistered"] = 'This vehicle is not a registered vehicle.',
["UpdateDiscountRate"] = "You updated the discount rate.",
["SifirdanKucukOlamaz"] = "You cannot leave this field blank or write a value less than 0.",
["InstalledModifie"] = "Installed on the modified vehicle.",
["DeletedCustomerTable"] = "You have emptied the customer table.",
["Error"] = "Something went wrong.",
["LicensePlate"] = "License Plate",
["CustomerEnoughMoney"] = "Customer Does Not Have Enough Money.",
["CarOwner"] = "Car Owner",
["RecruitNewStaff"] = "Recruit New Staff",
["AddEmployee"] = "Add Employee",
["Fired"] = "Fired",
["CancelRecruitingEmployees"] = "Cancel Recruiting Employees",
["BackToEmployees"] = "Back to Employees",
["Back"] = "Back",
["Hire"] = "Hire",
["AddToBasket"] = "Add to basket",
["Cancel"] = "Cancel",
["EnterANewLicensePlate"] = "Enter a new license plate",
["MechanicBuyText"] = "~b~[E]~w~ - Buy Mechanic",
["SuccessBuyMechanic"] = "You have successfully purchased the mechanic.",
["AlreadyWorking"] = "This person is already working at your job.",
["Owner"] = "Owner",
["Techinician"] = "Techinician",
["RepairFeeSuccessUpdate"] = "You have updated the vehicle repair and cleaning fee.",
["VehicleRepairFee"] = "Vehicle Repair / Cleaning",
["VehicleRepairWill"] = "Vehicle Repair will be made after you make your payment.",
["VehicleSuccessRepaired"] = "Vehicle Engine repaired. For physical damage, go to a mechanic.",
["YouCanNotRepair"] = "You cannot repair the engine while inside the vehicle.",
["ThisBelongsAnother"] = "This plate belongs to another vehicle.",
["IsNotSuitable"] = "This Vehicle is not suitable for modding.",
["RaiseInTheBed"] = "Press ~INPUT_CONTEXT~ to ~b~raise ~w~the bed.~n~Press ~INPUT_DETONATE~ to ~b~detach ~w~the vehicle.",
["AttachVehicle"] = "Press ~INPUT_CONTEXT~ to ~b~raise ~w~the bed.~n~Press ~INPUT_DETONATE~ to ~b~attach ~w~a vehicle.",
["LowerTheBed"] = "Press ~INPUT_CONTEXT~ to ~b~lower ~w~the bed.",
["SuccessIntoOut"] = "The vehicle was successfully ejected.",
["AlreadyOutVehicle"] = "You've already taken out a vehicle!",
["ThisVehicleNotBelongMechanic"] = "This vehicle does not belong to this business.",
["NoOneElseYou"] = "There is no one else in the game but you.",
["YetersizHarf"] = "Insufficient number of letters for the plate.",
["SuccessEmployee"] = "You have successfully recruited the player.",
["AnyGetGehicle"] = "There is a vehicle at the vehicle extraction point. That's why I can't get a vehicle :D",
["VehicleModelNotFound"] = "Vehicle Model Not Found.",
["kimseyok"] = "There is no one near you to hire.",
["NotSpace"] = "You cannot leave any spaces on the plate.",
["Clear"] = "Clear"
}
Config.MechanicMenu = {
["Engine"] = "Engine",
["Brakes"] = "Brakes",
["Suspension"] = "Suspension",
["Turbo"] = "Turbo",
["Cage"] = "Cage",
["Transmission"] = "Transmission",
["Wheels"] = "Wheels",
["Armor"] = "Armor",
["Horns"] = "Horns",
["Livery"] = "Livery",
["LeftFender"] = "Left Fender",
["RightFender"] = "Right Fender",
["Headlights"] = "Headlights",
["BodyParts"] = "Body Parts",
["Spoilers"] = "Spoilers",
["FrontBumper"] = "Front Bumper",
["RearBumper"] = "Rear Bumper",
["SideSkirt"] = "Side Skirt",
["Exhaust"] = "Exhaust",
["Grille"] = "Grille",
["Windows"] = "Windows",
["Hood"] = "Hood",
["Roof"] = "Roof",
["VehColor"] = "Color",
["WheelType"] = "Wheel Type",
["WheelColor"] = "Wheel Color",
["TireSmoke"] = "Tire Smoke",
["Neon"] = "Neon",
["PlateIndex"] = "Plate",
["PrimaryColor"] = "Primary",
["SecondaryColor"] = "Secondary",
["PearlescentColor"] = "Pearlescent",
["Interior"] = "Interior",
["Speakers"] = "Speakers",
-- Wheels Category
["Sports"] = "Sports",
["Muscle"] = "Muscle",
["Offroad"] = "Offroad",
["Luxury"] = "Luxury",
["Lowrider"] = "Lowrider",
["Suv"] = "Suv",
["Tuning"] = "Tuning",
["Motorcycle"] = "Motorcycle",
}