This is a very awesome parking mod, that i specially made for qb-core This is just how you park in real live ๐ so park anywhere you want ๐๐๐ This mod is more intended for large servers, with VIP players, you can give this player an extra feature, to let them park in front of there own house, or you can use this, if you are a youtuber, and you don't want to mesh up and get your scene back togetter again, and getting al your vehicles from garage back on it place, you can also use this mod, so your scene stays how you put it, just a little thing I thought of what you also can do with this mod. ๐
This mod is also good if players crashes or if the server gets a reboot, and if you have permission to park, and you have parked your vehicle, then you never have to get your vehicle from the garage again, but if you do forget to park your vehicle, your vehicle can be found in garage or impound.
This is my second mod i make public, so please by kind to my ๐ i still have much to learn.
- โ oxmysql
- โ qb-core
- โ qb-garages
- โ qb-vehiclekeys
- โ qb-phone
- โ cc-fuel
- โ interact-sound
- โ you can also use other vehiclekey scripts, change this in the config file.
- ๐ Step 1: First stop your server. ๐
- ๐ Step 2: Copy the directory qb-parking to resources/[qb]/
- ๐ Step 3: Add the player_parking.sql with 2 tables to your correct database.
- ๐ Step 4: Add any recommended extra code what I say you should add.
- ๐ Step 5: If you are 100% sure, you have done all 4 steps correctly, go to step 6.๐
- ๐ Step 6: Start your server.
- ๐ Step 7: Add your self as vip, you can use the command: /park-addvip [id] [amount]
- ๐ Step 8: Most important step -> Enjoy ๐๐๐
- โ Easy to install and use
- โ QB-Phone notifications
- โ Admin Controll like disable or enable the system or set it to only allowed for vip players only.
- โ User Controll like displaying text on screen.
- โ Police can, if thay want, always see who owns the vehicle by using /park-names
- โ Players with user status will only see the model name of this vecihle, not the owners name or plate.
- โ 3D Waypoints is optional to use, uncommand the d3 waypoint in fxmanifest.lua file.
- ๐ Your players will love this extra feature, if they can park there own vehicle in front of there housees or clubs.
- ๐ Your players can setup youtube scenes, and if they want, they can come back later, and your vechiles are still there.
- ๐ This is very usefull cause if you make a scene and somehthing goes wrong, then don't wory you vechiles are right there.
- ๐ And of course you should not forget to park your vehicle ๐๐๐
- ๐ Typ "/park" to park or drive your vehicle where you are at that moment. (Users and Admins)
- ๐ Typ "/park-names if you want to display the names ontop of the vehicle that is parked. (Users and Admins)
- ๐ Typ "/park-notification" to turn on or of the phone notification (Users and Admins)
- ๐ Typ "/park-system" if you want to turn on or off the system. (Admin Only)
- ๐ Typ "/park-usevip" to turn on and of the vip system
- ๐ Typ "/park-addvip [id] [amount]" if you want to add a vip. (Admin Only)
- ๐ Typ "/park-removevip [id]" if you want to remove a vip. (Admin Only)
- ๐ If you want to use the F5 button, you must add it to your /binds and add on F5 the word "park"
- ๐ Change the max cars that can park in the world space, change the amount from Config.Maxcarparking in the config.lua file.
- ๐ Vip users can be added by command, only if you use the vip option.
- ๐ Knowledge of programming and use your brains cause i'am not going to help you install this mod, cause it's very easy to do.
- ๐ I recommend to use this mod only for vip players or for players who are most online on you server.
- ๐ Try not to spawn too many vehicles in world space, this can cause issues and hiccups.
- ๐ It is also recommended to have a good computer/server to use this mod, cause you will need it.
- ๐ To keep the server nice and clean for everyody, use this system only for vip players.
- โ Prossessor: I7 12xCore
- โ Memory: 16 gig memory
- โ Graphics: GTX 1050 TI 4GB
- ๐ DO NOT park your vehicles on roofs or that kind of stuff, just don't do it, it will work, but it breaks the mod,
- ๐ use the recommended parking spots in the world like you do in real life,
- ๐ you can do of course just park at your own house on a parking spot to keep it nice and clean for everyone.
- โ You can impound this vehicles, if a user park their vehicle incorrectly, and you added the trigger correctly...
- โ You can give a fine, and then if you want, you can still impound this vehicle.
- โ If a player as police, if they can enable the hud to see the name and plate of this persons parked vehicle, by using /park-names.
- โ The Polices and Mechanics client side trigger event, for the police or mechanic to impount a vehicle correctly.
- โ You MUST add this to your police impound trigger event.
RegisterNetEvent('vehiclekeys:client:SetVehicleOwnerToCitizenid', function(plate, citizenid)
TriggerServerEvent('vehiclekeys:server:SetVehicleOwnerToCitizenid', plate, citizenid)
end)
RegisterNetEvent('vehiclekeys:server:SetVehicleOwnerToCitizenid', function(plate, citizenid)
if VehicleList then
local val = VehicleList[plate]
if val then
VehicleList[plate].owners[citizenid] = true
else
VehicleList[plate] = { owners = {} }
VehicleList[plate].owners[citizenid] = true
end
else
VehicleList = {}
VehicleList[plate] = { owners = {} }
VehicleList[plate].owners[citizenid] = true
end
end)
- โ Go to resources[qb]/qb-core/server/player.lua around line 506, and find, local playertables = {}.
- โ This is, if we want to delete a character, we also want to delete the parked vehicles in the database,
- โ Place the line below at the bottom in playertables (there are more insite), so place this one at the bottom.
{ table = 'player_parking' },
- Added below -> TriggerEvent("qb-parking:client:stolen", lockpickedPlate)
-- resources/[qb]/qb-vehiclekeys/client.lua line 165 change it with this code.
local function lockpickFinish(success)
local ped = PlayerPedId()
local pos = GetEntityCoords(ped)
local vehicle = QBCore.Functions.GetClosestVehicle(pos)
local chance = math.random()
if success then
TriggerServerEvent('hud:server:GainStress', math.random(1, 4))
QBCore.Functions.Notify('Opened Door!', 'success')
SetVehicleDoorsLocked(vehicle, 1)
lockpicked = true
lockpickedPlate = QBCore.Functions.GetPlate(vehicle)
TriggerEvent("qb-parking:client:stolen", lockpickedPlate) -- <---------------- HERE !!!
else
PoliceCall()
TriggerServerEvent('hud:server:GainStress', math.random(1, 4))
QBCore.Functions.Notify('Someone Called The Police!', 'error')
end
if usingAdvanced then
if chance <= Config.RemoveLockpickAdvanced then
TriggerEvent('inventory:client:ItemBox', QBCore.Shared.Items["advancedlockpick"], "remove")
TriggerServerEvent("QBCore:Server:RemoveItem", "advancedlockpick", 1)
end
else
if chance <= Config.RemoveLockpickNormal then
TriggerEvent('inventory:client:ItemBox', QBCore.Shared.Items["lockpick"], "remove")
TriggerServerEvent("QBCore:Server:RemoveItem", "lockpick", 1)
end
end
end
TriggerEvent("qb-parking:client:impound", plate)
- Go to resources[qb]\qb-policejob\client\job.lua line 332
- Find ๐
RegisterNetEvent('police:client:ImpoundVehicle', function(fullImpound, price)
local vehicle = QBCore.Functions.GetClosestVehicle()
local bodyDamage = math.ceil(GetVehicleBodyHealth(vehicle))
local engineDamage = math.ceil(GetVehicleEngineHealth(vehicle))
local totalFuel = exports['LegacyFuel']:GetFuel(vehicle)
if vehicle ~= 0 and vehicle then
local ped = PlayerPedId()
local pos = GetEntityCoords(ped)
local vehpos = GetEntityCoords(vehicle)
if #(pos - vehpos) < 5.0 and not IsPedInAnyVehicle(ped) then
local plate = QBCore.Functions.GetPlate(vehicle)
TriggerServerEvent("police:server:Impound", plate, fullImpound, price, bodyDamage, engineDamage, totalFuel)
QBCore.Functions.DeleteVehicle(vehicle)
end
end
end)
- Replace ๐
RegisterNetEvent('police:client:ImpoundVehicle', function(fullImpound, price)
local vehicle = QBCore.Functions.GetClosestVehicle()
local bodyDamage = math.ceil(GetVehicleBodyHealth(vehicle))
local engineDamage = math.ceil(GetVehicleEngineHealth(vehicle))
local totalFuel = exports['LegacyFuel']:GetFuel(vehicle)
if vehicle ~= 0 and vehicle then
local ped = PlayerPedId()
local pos = GetEntityCoords(ped)
local vehpos = GetEntityCoords(vehicle)
if #(pos - vehpos) < 5.0 and not IsPedInAnyVehicle(ped) then
local plate = QBCore.Functions.GetPlate(vehicle)
TriggerEvent('qb-parking:client:impound', plate) -- <--- impound qb-parking trigger
TriggerServerEvent("police:server:Impound", plate, fullImpound, price, bodyDamage, engineDamage, totalFuel)
QBCore.Functions.DeleteVehicle(vehicle)
end
end
end)
TriggerEvent("qb-parking:client:unpark", plate)
CREATE TABLE `player_parking` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`citizenid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`citizenname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`model` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`plate` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`fuel` int(15) NOT NULL DEFAULT 0,
`data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
`time` bigint(20) NOT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;
CREATE TABLE IF NOT EXISTS `player_parking_vips` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`citizenid` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`citizenname` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`maxparking` int(5) NOT NULL DEFAULT 0,
`hasparked` int(5) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;
- 1: copy a file from the resources[qb]/qb-parking/locales directory
- 2: rename this file for example fr.lua or sp.lua
- 3: translate the lines in the file to your language
- 4: you now have added a new language to the system, enjoy ๐
- If you have any suggestions or nice ideas let me know and we can see what we can do ๐๐
- Keep it nice and clean for everybody and have fun with this awesome qb-parking mod ๐๐