sn_properties

Integration for OP-GARAGES with sn_properties

1

Find Garages Folder

Go to sn_properties/client/framework/garages/

2

Create New File

create file named op-garages.lua

3

Paste Code

Paste this code inside created file:

if Config.garage ~= 'op-garages' then return end
function onGarageEnter(property)
    if IsPedInAnyVehicle(PlayerPedId(), true) then
        SNLib.showTextUI('[E] Park vehicle in the garage')
    else 
        SNLib.showTextUI('[E] Open garage')
    end
end

function onGarageExit(property)
    SNLib.hideTextUI()
end

function insideGarage(property)
    if IsControlJustReleased(0, 38) then
        Wait(100)
        local coords = vec4(property.garage_zone.x, property.garage_zone.y, property.garage_zone.z, property.garage_zone.w)
        exports['op-garages']:OpenGarageHere(coords, true)
    end
end
4

Find Config

Go to the config file of sn_properties and replace:

This:

garageScripts = {
    'ak47_garage',
    'cd_garage',
    'codem_garage',
    'jg-advancedgarages',
    'okokGarage',
    'qb-garages',
    'qbx_garages',
    'qs-advancedgarages',
    'rcore_garage',
    'zerio-garage',
    --'sn_garages',
    'mythic-vehicles',
}

if Config.garage == 'auto' then
    for _, resource in ipairs(garageScripts) do
        if GetResourceState(resource):find('start') then
            Config.garage = resource
            break
        end
    end
end

With This:

garageScripts = {
    'ak47_garage',
    'cd_garage',
    'codem_garage',
    'jg-advancedgarages',
    'okokGarage',
    'qb-garages',
    'qbx_garages',
    'qs-advancedgarages',
    'rcore_garage',
    'zerio-garage',
    --'sn_garages',
    'mythic-vehicles',
    'op-garages',
}

if Config.garage == 'auto' then
    for _, resource in ipairs(garageScripts) do
        if GetResourceState(resource):find('start') then
            Config.garage = resource
            break
        end
    end
end
5

All Done!

Everything is ready!

Last updated