- I rewrote the parking script and now your vehicles are automatically parked, this happens when you get out or get in the vehicle.
- I remove the F5 park/unpark and everything else that was no longer needed.
- The Impound should also work automatically and the vehicle should disappear when the police impound a vehicle.
- Auto park only when your engine is off, you can change this in the config file,
- When you press
F
sort it wil park when you hold theF
it let the engine running and don't park. - And yes your vehicle will be back at the park location after server restart.
- Step 1: First stop your server.
- Step 2: Copy the directory
mh-parkinV2
toresources/[mh]/
. - Stap 3: Add
ensure [mh]
inserver.cfg
belowensure [defaultmaps]
. - Step 4: Start your server.
/toggleparktext
this disable or enable the text above the parked vehicles. (for streamers)/parkmenu
to open the parked menu so you can set a waypoint.
- The Impound should also work automatically and the vehicle should disappear when the police impound the vehicle.
- Impound Example
local vehicle, distance = QBCore.Functions.GetClosestVehicle(GetEntityCoords(PlayerPedId()))
if vehicle ~= 0 and distance <= 3.0 then
PlayerData = QBCore.Functions.GetPlayerData()
if PlayerData.job.name == 'police' and PlayerData.job.onduty then
local plate = QBCore.Functions.GetPlate(vehicle)
TriggerServerEvent('mh-parkingV2:server:Impound', plate)
end
end
- this for mechanics (client side call)
local vehicle, distance = QBCore.Functions.GetClosestVehicle(GetEntityCoords(PlayerPedId()))
if vehicle ~= 0 and distance <= 3.0 then
PlayerData = QBCore.Functions.GetPlayerData()
if PlayerData.job.name == 'mechanic' and PlayerData.job.onduty then
local plate = QBCore.Functions.GetPlate(vehicle)
TriggerServerEvent('mh-parkingV2:server:TowVehicle', plate)
end
end