kibra-vehicleshops

Current Version: 1.0.0

Setup

Step 1

Download the kibra-core file and then move it to the resources folder.

Step 2

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

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 `kibra-vehicleshops` (
`id` int(11) NOT NULL,
`info` text NOT NULL DEFAULT '[]',
`employees` text NOT NULL DEFAULT '[]',
`vehicles` text NOT NULL DEFAULT '[]',
`history` text NOT NULL DEFAULT '[]',
`requests` text NOT NULL DEFAULT '[]',
`categories` text NOT NULL DEFAULT '[]',
`recentsales` text NOT NULL DEFAULT '[]',
`recentorders` text NOT NULL DEFAULT '[]'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE `kibra-vehicleshops`
ADD PRIMARY KEY (`id`);
ALTER TABLE `kibra-vehicleshops`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
COMMIT;

Step 5

Don't forget to restart your server. Good Roles :)
To reproduce the gallery, you can use this table. I just have to say that the order of the galleries is important. You must add a new gallery below the existing gallery table. Next, you must pass the required coordinates in your new gallery to the table you copied.
kibra-vehicleshops/shared/vehicleshops.lua file open. And then copy the following table to the Shared.VehicleShops table and add it to the table. But remember, you must put a comma after the "}" sign after the previous table is finished. Think of it like a series.
{
Type = "car",
Owner = "",
VehicleShopName = "",
Money = 0,
History = {},
Employees = {},
Vehicles = {},
StockRequestFeeRate = 0,
Discount = 0,
RecentSales = {},
RecentOrders = {},
IncreasedSalesRate = 0,
ShareofCarDeliverer = 0,
Categories = {},
Requests = {},
-- Do not play with the above variables. You can make changes to the following variables.
Price = 10000, -- VehicleShop purchase price.
BlipShow = true,
Blip = {Id = 227, Scale = 1.0, Color = 3, Display = 4},
ExitVehicleSpawn = vector4(-47.135898590088,-1078.0561523438,26.727151870728,70.806060791016), -- After the vehicle is purchased, where it will spawn.
CarSpawn = vector4(801.25549316406,-3002.4836425781,-69.130325317383,270.02352905273), -- Coordinate where the vehicle that appears in the gallery was created.
Spawn = vector3(806.68774414063,-3000.0852050781,-68.999771118164), -- Coordinate where the vehicle that appears in the gallery was created.
PlayerSpawn = vector3(801.6395874023438, -3003.283447265625, -69.5780029296875), -- Coordinate where the vehicle that appears in the gallery was created.
ShopOpenCoord = vector3(-57.419582366943,-1097.4156494141,26.422353744507), -- Coordinate of the menu where the players can see the vehicles.
BossMenuCoord = vector3(-32.046348571777,-1114.1044921875,26.422559738159), -- Location where the player can access the boss menu.
VehicleDeliveryCoord = vector3(-19.045358657837,-1111.5755615234,26.672071456909) -- Coordinate where the player will deliver the car during a vehicle delivery.
},
And then, you have to restart the script. And Congratulations! You just added a new gallery!
Upload the transparent image file of the tool you want to add to the file path kibra-vehicleshops/web/img.
Next, open kibra-vehicleshops/shared/main.lua
Shared.CustomCars = { -- Write the models of the vehicles you add as addon here.
"redeye"
}
Next, write the model of the vehicle in this table.
Remember: The model name of the vehicle and the image extension name of the vehicle must be the same.

config-file

Shared = {}
Shared.Company = true -- As long as this feature is true, players can purchase and operate vehicleshops.
Shared.VShopsBuyPayment = "bank" -- or Cash
Shared.FastOrderFeeRate = 80 -- %
-- Fast vehicle determines the purchase price.
-- By adding your specified percentage of the selected vehicle price to the vehicle price.
-- Quickly creates the purchase price of the vehicle.
Shared.CustomPlatePrice = 100000 -- $
-- Special Plate fee. When the players want to have a special plate for the vehicle they are going to buy,
-- a new price is created by adding the specified price to the vehicle price.
Shared.PlateChange = true
-- Setting that determines whether players can make a custom license plate at the time of vehicle purchase.
Shared.StarterPack = { -- The ones given by default to the vehicle gallery.
CompanyMoney = 10000, -- Start Default Money
Vehicles = { -- Start Default Vehicles
{
Category = "sports",
Price = 155500,
Stock = 1,
Model = "rebla",
Label = "Rebla"
},
{
Category = "sports",
Price = 100500,
Stock = 1,
Model = "drafter",
Label = "Drafter"
},
{
Category = "coupes",
Price = 2500,
Stock = 1,
Model = "panto",
Label = "Panto"
}
}
}
Shared.Perms = {
["boss"] = {"bossMenuAccent"}
}
-- All Permission: "bossMenuAccent", "moneyTransactions", "newOrderVehicle", "categoriEdit", "discountEdit", "transferOwnerShip", "settings", "requestVehicleAccept"
Shared.CloseHud = function() -- When Vehicleshop opens, it hides your hud.
TriggerEvent('wais:hudHide', true)
end
Shared.OpenHud = function() -- When Vehicleshop opens, it makes your hud visible.
TriggerEvent('wais:hudHide', false)
end
Shared.RandomCoords = { -- Vehicle Delivery Coordinates.
vector4(-1072.2581787109,-1704.5668945313,4.0577130317688,7.4976963996887),
vector4(-1318.6683349609,-1151.82421875,4.1425409317017,269.75317382813),
vector4(-97.464622497559,104.31408691406,73.15380859375,67.156059265137)
}
Shared.PlateLetters = 3 -- Number of letters on the plate
Shared.PlateNumbers = 3 -- Number of numbers on the plate
Shared.PlateUseSpace = true -- Variable that triggers whether there are gaps in the generated plates.
Shared.Colors = { -- Reproducible RGB Vehicle Colors
{r = 5, g = 121, b = 141},
{r = 249, g = 13, b = 13},
{r = 162, g = 13, b = 13},
{r = 249, g = 249, b = 13},
{r = 249, g = 119, b = 13},
{r = 13, g = 206, b = 249},
{r = 13, g = 99, b = 249},
{r = 0, g = 0, b = 0},
{r = 131, g = 13, b = 249},
{r = 249, g = 13, b = 221},
{r = 249, g = 241, b = 13},
{r = 249, g = 13, b = 107},
{r = 255, g = 255, b = 255},
}
Shared.TestDrive = {
VehicleSpawn = vector3(-880.50354003906,-3211.830078125,13.944427490234), -- Test Drive Starting Point.
Heading = 59.3147315979,
Time = 60 -- second
}
Shared.ClearRecentOrdersCommand = "clearorderlist" -- It is recommended to use this command regularly to avoid tiring the database.
-- It only deletes the logs of the delivered vehicles.
-- Usage Example: /clearorderlist
Shared.TestDriveCancelCommand = "cancel"
-- Players can end the test drive by typing this command during the test drive.
Shared.CustomVehicleKey = false
-- If you are using a script such as qb-vehiclekeys,
-- it will mark it as true and it will give the key to the player after the vehicle is purchased.
Shared.AddVehicleKey = function(plate, xPlayer)
if not Shared.CustomVehicleKey then return end
TriggerClientEvent('vehiclekeys:client:SetOwner', xPlayer.source, plate)
end
Shared.Controls = {
["OpenVehicleshop"] = {"[E]", 38}
}
Shared.Permissions = {
{
name = "boss",
label = "Boss"
},
{
name = "saleManager",
label = "Sale Manager"
},
{
name = "recruit",
label = "Recruit"
},
}
Shared.CustomCars = { -- Write the models of the vehicles you add as addon here.
"redeye"
}
Shared.VehicleShops = {
{
Type = "car",
Owner = "",
VehicleShopName = "",
Money = 0,
History = {},
Employees = {},
Vehicles = {},
StockRequestFeeRate = 0,
Discount = 0,
RecentSales = {},
RecentOrders = {},
IncreasedSalesRate = 0,
ShareofCarDeliverer = 0,
Categories = {},
Requests = {},
-- Do not play with the above variables. You can make changes to the following variables.
Price = 10000, -- VehicleShop purchase price.
BlipShow = true,
Blip = {Id = 227, Scale = 1.0, Color = 3, Display = 4},
ExitVehicleSpawn = vector4(-47.135898590088,-1078.0561523438,26.727151870728,70.806060791016), -- After the vehicle is purchased, where it will spawn.
CarSpawn = vector4(801.25549316406,-3002.4836425781,-69.130325317383,270.02352905273), -- Coordinate where the vehicle that appears in the gallery was created.
Spawn = vector3(806.68774414063,-3000.0852050781,-68.999771118164), -- Coordinate where the vehicle that appears in the gallery was created.
PlayerSpawn = vector3(801.6395874023438, -3003.283447265625, -69.5780029296875), -- Coordinate where the vehicle that appears in the gallery was created.
ShopOpenCoord = vector3(-57.419582366943,-1097.4156494141,26.422353744507), -- Coordinate of the menu where the players can see the vehicles.
BossMenuCoord = vector3(-32.046348571777,-1114.1044921875,26.422559738159), -- Location where the player can access the boss menu.
VehicleDeliveryCoord = vector3(-19.045358657837,-1111.5755615234,26.672071456909) -- Coordinate where the player will deliver the car during a vehicle delivery.
},
{
Type = "policeCar",
BlipShow = false,
JobName = {"police"},
Blip = {Id = 227, Scale = 1.0, Color = 3, Display = 4},
VehicleShopName = "Police Cardealer",
ExitVehicleSpawn = vector4(440.01361083984,-1021.6412353516,28.610815048218,93.780838012695), -- After the vehicle is purchased, where it will spawn.
CarSpawn = vector4(801.25549316406,-3002.4836425781,-69.130325317383,270.02352905273), -- Coordinate where the vehicle that appears in the gallery was created.
Spawn = vector3(806.68774414063,-3000.0852050781,-68.999771118164), -- Coordinate where the vehicle that appears in the gallery was created.
PlayerSpawn = vector3(801.6395874023438, -3003.283447265625, -69.5780029296875), -- Coordinate where the vehicle that appears in the gallery was created.
ShopOpenCoord = vector3(457.1979675293,-1019.9270019531,28.280912399292), -- Coordinate of the menu where the players can see the vehicles.
},
}
Shared.Texts = {
["BossMenu"] = "Boss Menu",
["OpenVehicleshop"] = "Vehicleshop",
["BuyVehicleshop"] = "Buy Vehicleshop",
["YouDontHaveEnoughMoney"] = "You Don't Have Enough Money.",
["UpdatedShopName"] = "You have updated the Vehicle Store name.",
["UpdatedDiscount"] = "You updated the discount rate.",
["NotBlank"] = "You cannot leave the field blank.",
["ClearedLogs"] = "The kept logs have been cleared.",
["YouTransferedElse"] = "You transferred business ownership to someone else.",
["YouNowAdmin"] = "You now own the business.",
["NoNearby"] = "There is no one by your side.",
["AlreadyWorking"] = "This person is already in this job!",
["AddedEmployee"] = "You have successfully recruited the person!",
["UpdatedPerm"] = "You have updated your employee's authority.",
["SuccessFired"] = "You fired the person.",
["SifirdanKucuk"] = "You cannot enter a value less than 0.",
["NotMuchMoney"] = "There isn't that much money in the company vault.",
["YouDontHaveMoney"] = "You don't have that much money on you.",
["SuccDeposit"] = "You Have Successfully Deposited Money",
["WithDeposit"] = "You Have Successfully Withdrawed Money",
["SuccessCarOrder"] = "You have successfully ordered a vehicle.",
["YetersizSirket"] = "There is not enough money in the company vault.",
["EditsSaved"] = "The edits are saved.",
["second"] = "Second",
["EndTest"] = "Your Test Drive will expire after this time",
["SuccessBuyVehicle"] = "You have successfully purchased a new vehicle.",
["CreateReq"] = "You have successfully created a stock requisition!",
["AlreadyCreated"] = "You have previously created a request for this vehicle!",
["UpdatedZam"] = "You updated the raise rate",
["NotAuthorized"] = "You are not authorized for this action",
["NotSelectedCar"] = "You must choose a vehicle.",
["NotSamePlate"] = "Your custom license plate cannot be the same as your regular license plate",
["SomeoneElseHave"] = "This plate belongs to someone else.",
["UpdatedStockReq"] = "Stock Request Fee Percentage Updated",
["CreatedCustomPlate"] = "You have created a Custom Plate",
["YouDeclineStockReq"] = "You declined the stock request",
["DontHaveEnoughMoneyForStock"] = "You don't have enough money to request stock.",
["SpecifyNumber"] = "Specify the number of vehicles",
["NewOrder"] = "A New Vehicle Order Has Arrived! Pick up the vehicle from the area marked on the GPS and deliver it to the gallery.",
["ReceiveVehicle"] = "Receive Vehicle",
["DeliverVehicle"] = "Deliver Vehicle",
["NotBelongCardealer"] = "This vehicle does not belong to the gallery!",
["DeliveredVehicle"] = "You delivered the vehicle. You will get: ",
["SuccessUpdate"] = "Successfully updated",
["isNowSale"] = "The vehicle you have requested for stock is now on sale in the current gallery!",
["harika"] = "You have deleted the logs of the delivered vehicles in all galleries.",
["StockAvailable"] = "Stock Available",
["OutofStock"] = "Out of Stock",
["TestDrive"] = "Test Drive",
["StockRequest"] = "Stock Request",
["Delivered"] = "Delivered",
["Requesting:"] = "Requesting:",
["Accept"] = "Accept",
["EnterAPlate"] = "Enter A Plate",
["Save"] = "Save",
["Cancel"] = "Cancel",
["Update"] = "Update",
["Buy"] = "Buy",
["Fast"] = "FAST",
["BackEmployees"] = "Back Employees"
}
```