MONO DOCS
Search
⌃K
🏠

ESX_PROPERTY

MONO_GARAGE in ESX_PROPERTY

Go to esx_property/client/main.lua and look at line 756
-- Original
function StoreVehicle(PropertyId)
local Vehicle = GetVehiclePedIsIn(ESX.PlayerData.ped, false)
if Vehicle then
local VehProperties = ESX.Game.GetVehicleProperties(Vehicle)
VehProperties.DisplayName = GetLabelText(GetDisplayNameFromVehicleModel(VehProperties.model))
ESX.TriggerServerCallback("esx_property:StoreVehicle", function(result)
if result then
SetEntityAsMissionEntity(Vehicle, true, true)
DeleteVehicle(Vehicle)
ESX.ShowNotification(TranslateCap("store_success"), "success")
return
else
ESX.ShowNotification(TranslateCap("store_error"), "error")
return
end
end, PropertyId, VehProperties)
end
end
function AccessGarage(PropertyId)
ESX.TriggerServerCallback("esx_property:AccessGarage", function(Vehicles)
if Vehicles then
local elements = {{unselectable = true, icon = "fas fa-warehouse", title = TranslateCap("property_garage")}}
for k, v in pairs(Vehicles) do
elements[#elements + 1] = {title = v.vehicle.DisplayName .. " | " .. v.vehicle.plate, Properties = v.vehicle, index = k}
end
ESX.OpenContext("right", elements, function(menu, element)
if element.Properties then
ESX.CloseContext()
ESX.ShowNotification(TranslateCap("retriving_notify",element.Properties.DisplayName))
if ESX.Game.IsSpawnPointClear(vector3(Properties[PropertyId].garage.pos.x, Properties[PropertyId].garage.pos.y,
Properties[PropertyId].garage.pos.z), 3.0) then
ESX.Game.SpawnVehicle(element.Properties.model, Properties[PropertyId].garage.pos, Properties[PropertyId].garage.Heading,
function(vehicle)
SetEntityAsMissionEntity(vehicle, true, true)
ESX.Game.SetVehicleProperties(vehicle, element.Properties)
TaskWarpPedIntoVehicle(ESX.PlayerData.ped, vehicle, -1)
SetModelAsNoLongerNeeded(element.Properties.model)
TriggerServerEvent("esx_property:SetVehicleOut", PropertyId, element.index)
end)
end
end
end)
else
ESX.ShowNotification(TranslateCap("cannot_access"), "error")
return
end
end, PropertyId)
end
3 - Replace the old function with this new one.
function StoreVehicle(PropertyId)
exports['mono_garage']:SaveVehicle({
garage = Properties[PropertyId].Name,
type = 'all',
distance = 2.5,
})
end
function AccessGarage(PropertyId)
exports['mono_garage']:OpenGarage({
garage = Properties[PropertyId].Name,
type = 'all',
spawnpos = {
vec4(Properties[PropertyId].garage.pos.x, Properties[PropertyId].garage.pos.y, Properties[PropertyId].garage.pos.z,
Properties[PropertyId].garage.Heading)
},
impound = 'Auto Impound',
SetInToVeh = true,
})
end
4 - Save the file and restart your server. 5 - You can now save and remove vehicles from esx_property with mono_garage!