đŸ”Ŧ
RX Scripts
STOREDISCORD
  • 👋Overview
  • Find us
    • 🔗Store
    • 🔗Discord
    • 🔗Youtube
  • 🌐Scripts
    • Garages
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Ēī¸Exports
      • â†Šī¸Events
    • Reports PRO
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Ēī¸Exports
      • â†Šī¸Events
    • Mining
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Ēī¸Exports
      • â†Šī¸Events
    • Fishing
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Ēī¸Exports
      • â†Šī¸Events
    • Player Stores
      • đŸ› ī¸Installation
      • 🚚Jobs DLC
      • 📝Configurables
      • â†Ēī¸Exports
      • â†Šī¸Events
    • Drug Labs
      • đŸ› ī¸Installation
      • âœˆī¸Operation DLC
      • 📝Configurables
      • â†Ēī¸Exports
      • â†Šī¸Events
    • Hunting
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Ēī¸Exports
      • â†Šī¸Events
    • Plantation
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Ēī¸Exports
      • â†Šī¸Events
    • Gang Wars
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Šī¸Events
    • Housing
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Šī¸Events
    • Chopshop
      • đŸ› ī¸Installation
      • 📝Configurables
    • Death System
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Šī¸Events
    • Recyclers
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Ēī¸Exports
      • â†Šī¸Events
    • Smelters
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Ēī¸Exports
      • â†Šī¸Events
    • Crates & Storages
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Šī¸Exports
      • â†Šī¸Events
    • Black Markets
      • đŸ› ī¸Installation
      • 📝Configurables
    • Hazard Zones
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Ēī¸Exports
      • â†Šī¸Events
    • Report System
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Ēī¸Exports
      • â†Šī¸Events
    • Billing System
      • đŸ› ī¸Installation
      • â†Ēī¸Exports
      • â†Šī¸Events
Powered by GitBook
On this page
  1. Scripts
  2. Housing

Configurables

--[[
BY RX Scripts Š rxscripts.xyz
--]]

Config = {}

Config.Locale = 'en'
Config.SaveInterval = 10 -- In Minutes
Config.DefaultRoutingBucket = 0
Config.UseMoney = 'bank' -- Money account used for payments
Config.PostMessageCooldown = 300 -- In Seconds, cooldown on sending post messages to a house
Config.MaxHouses = 5 -- Amount of houses a player can own
Config.SellReturn = 0.5 -- Percentage of the house price you get back when selling (0 - 1)
Config.LaptopProp = 'prop_laptop_01a' -- Prop used for the laptop

Config.AllowedToCreate = {
    jobs = {
        -- 'real_estate_agent',
    },
    groups = {
        'admin',
        'superadmin',
    }
}

Config.Commands = {
    create = 'housing:create',
    delete = 'housing:delete',
}

Config.Ringing = {
    refreshCooldown = 3000, -- In MS
    canOpenStash = true, -- Can the player open the stash whilst being let in by ringing the doorbell?
    canOpenWardrobe = true, -- Can the player open the wardrobe whilst being let in by ringing the doorbell?
}

Config.Keyholders = {
    maxKeyholders = 5, -- false to make unlimited
    canOpenStash = true, -- Can the player open the stash as a keyholder?
    canOpenWardrobe = true, -- Can the player open the wardrobe as a keyholder?
}

Config.BreakIn = {
    enabled = true,
    canOpenStash = true,
    canOpenWardrobe = true,
    minimumCops = 0,
    copsJob = 'police',
    requiredItem = 'lockpick',
}

Config.Raid = {
    enabled = true,
    canOpenStash = true,
    canOpenWardrobe = true,
    requiredItem = 'phone',
    allowedJobs = { -- Minimum grade required
        { job = "police", grade = 0 },
    }
}

Config.Blips = {
    ownedPropertyOwner = { -- When you have the key to the property
        enabled = true,
        color = 26,
        sprite = 40,
        scale = 0.8,
        display = 4,
    },
    ownedPropertyStranger = { -- When you don't own the property
        enabled = true,
        color = 62,
        sprite = 40,
        scale = 0.8,
        display = 4,
    },
    unownedProperty = { -- When the property is unowned
        enabled = true,
        color = 0,
        sprite = 40,
        scale = 0.8,
        display = 4,
    },
}

Config.StashGrades = {
    { -- DEFAULT GRADE
        price = 0,
        weight = 150000,
        slots = 10,
    },
    {
        price = 1000,
        weight = 300000,
        slots = 20,
    },
    {
        price = 2000,
        weight = 500000,
        slots = 30,
    }
}

Config.Shells = {
    -- K4MB1 STARTERPACK FURNITURED SHELLS
    ["standardmotel_shell"] = {
        offsets = {
            door = vector3(-0.397827, -2.530762, -1.556461),
            doorHeading = 274.00531005859,
            laptop = vector3(1.451294, -3.258057, 0.216225),
            laptopHeading = -5.9250378608704,
            stash = vector3(-0.530762, 1.204346, -0.555267),
            clothing = vector3(1.264404, 2.504395, -0.556389),
        },
    },
    ["modernhotel_shell"] = {
        offsets = {
            door = vector3(4.920410, 4.077881, -1.817928),
            doorHeading = 178.88801574707,
            laptop = vector3(0.147583, 1.938477, -0.349930),
            laptopHeading = 13.525725364685,
            stash = vector3(-4.238403, 3.557617, -0.817917),
            clothing = vector3(3.026489, -3.417236, -0.817917),
        },
    },
    ["furnitured_midapart"] = {
        offsets = {
            door = vector3(1.511230, -9.875488, -0.521904),
            doorHeading = 14.050617218018,
            laptop = vector3(-5.873413, 1.514404, 0.247147),
            laptopHeading = 340.99652099609,
            stash = vector3(0.181519, 6.426270, -0.521912),
            clothing = vector3(6.112793, 9.284424, -0.521912),
        },
    },
}

--[[
    ONLY UNCOMMENT/CHANGE THIS IF YOU HAVE RENAMED SCRIPTS SUCH AS FRAMEWORK, TARGET, INVENTORY ETC
    RENAME THE SCRIPT NAME TO THE NEW NAME
--]]
-- ESX = 'es_extended'
-- QB = 'qb-core'
-- OXInv = 'ox_inventory'
-- QBInv = 'qb-inventory'
-- QSInv = 'qs-inventory'
-- PSInv = 'ps-inventory'
-- OKOKG = 'okokGarage'
-- FMAPP = 'fivem-appearance'
IgnoreResourceNotFoundErrors = false
--[[
BY RX Scripts Š rxscripts.xyz
--]]

function RegisterStash(stash)
    if OXInv then
        OXInv:RegisterStash(stash.id, stash.label, stash.slots, stash.weight, stash.owner, false)
    else
        Error("No inventory found for registering stash (server/opensource.lua:5)")
    end
end

function UpgradeStash(stashId, newWeight, newSlots)
    if OXInv then
        OXInv:SetMaxWeight(stashId, newWeight)
        OXInv:SetSlotCount(stashId, newSlots)
    else
        Error("No inventory found for upgrading stash (server/opensource.lua:11)")
    end
end

function Notify(src, msg, type)
    if ESX then
        TriggerClientEvent('esx:showNotification', src, msg, type)
    elseif QB then
        if type == 'info' then type = nil end
        TriggerClientEvent('QBCore:Notify', src, msg, type)
    end
end

function GetPlayerBySrc(src)
    if ESX then
        return ESX.GetPlayerFromId(src)
    elseif QB then
        return QB.Functions.GetPlayer(src)
    end
end

function HasGroup(src, group)
    if ESX then
        return ESX.GetPlayerFromId(src).getGroup() == group
    elseif QB then
        return QB.Functions.HasPermission(src, group)
    end
end

function GetJob(src)
    if ESX then
        return ESX.GetPlayerFromId(src).job
    elseif QB then
        return QB.Functions.GetPlayer(src).PlayerData.job
    end
end

function GetJobGrade(src)
    local job = GetJob(src)

    if ESX then
        return job.grade
    elseif QB then
        return job.grade.level
    end
end

function HasItem(src, item)
    if ESX then
        return ESX.GetPlayerFromId(src).getInventoryItem(item).count > 0
    elseif QB then
        item = QB.Functions.GetPlayer(src).Functions.GetItemByName(item)
        if not item then return false end
        return item.amount > 0
    end
end

function GetItemLabel(src, item)
    if ESX then
        return ESX.GetPlayerFromId(src).getInventoryItem(item).label
    elseif QB then
        return QB.Shared.Items[item].label
    end
end

function GetPlayerByIdentifier(identifier)
    if ESX then
        return ESX.GetPlayerFromIdentifier(identifier)
    elseif QB then
        return QB.Functions.GetPlayerByCitizenId(identifier)
    end
end

function GetIdentifier(src)
    if ESX then
        return ESX.GetPlayerFromId(src).identifier
    elseif QB then
        return QB.Functions.GetPlayer(src).PlayerData.citizenid
    end
end

function GetJobOnlineSources(job)
    local players = {}

    if ESX then
        for _, player in pairs(ESX.GetExtendedPlayers("job", job)) do
            players[#players+1] = player.source
        end
    elseif QB then
        for _, src in pairs(QB.Functions.GetPlayers()) do
            if GetJob(src).name == job then
                players[#players+1] = src
            end
        end
    end

    return players
end

function GetMoney(src, type)
    if ESX then
        return ESX.GetPlayerFromId(src).getAccount(type).money
    elseif QB then
        return QB.Functions.GetPlayer(src).PlayerData.money[type]
    end
end

function RemoveMoney(src, type, amount)
    if ESX then
        ESX.GetPlayerFromId(src).removeAccountMoney(type, amount)
    elseif QB then
        QB.Functions.GetPlayer(src).Functions.RemoveMoney(type, amount)
    end
end

function AddMoney(src, type, amount)
    if ESX then
        ESX.GetPlayerFromId(src).addAccountMoney(type, amount)
    elseif QB then
        QB.Functions.GetPlayer(src).Functions.AddMoney(type, amount)
    end
end

function GetPlayerName(src)
    if ESX then
        return ESX.GetPlayerFromId(src).name
    elseif QB then
        return QB.Functions.GetPlayer(src).PlayerData.charinfo.firstname .. " " .. QB.Functions.GetPlayer(src).PlayerData.charinfo.lastname
    end
end

function IsAdmin(src)
    if ESX then
        return ESX.GetPlayerFromId(src).getGroup() == "admin"
    elseif QB then
        return QB.Functions.HasPermission(src, "god")
    end
end

function GetSrcByPlayer(player)
    if ESX then
        return player.source
    elseif QB then
        return player.PlayerData.source
    end
end
--[[
BY RX Scripts Š rxscripts.xyz
--]]

function OpenStash(stashId, owner, weight, slots)
    if OXInv then
        OXInv:openInventory('stash', { id = stashId, owner = owner })
    elseif QBInv or QSInv or PSInv then
        TriggerServerEvent('inventory:server:OpenInventory', 'stash', stashId, {
            maxweight = weight,
            slots = slots,
        })
        TriggerEvent('inventory:client:SetCurrentStash', stashId)
    else
        Error("No inventory found for opening stash (client/opensource.lua:OpenStash)")
    end
end

function StoreVehicleInGarage()
    if OKOKG then
        TriggerEvent("okokGarage:StoreVehiclePrivate")
    else
        Error("No garage resource found (client/opensource.lua:StoreVehicleInGarage)")
    end
end

function OpenGarage(coords)
    if OKOKG then
        TriggerEvent("okokGarage:OpenPrivateGarageMenu", vector3(coords.x, coords.y, coords.z), coords.w)
    else
        Error("No garage resource found (client/opensource.lua:OpenGarage)")
    end
end

function ShowMarker(type, coords)
    if type == 'laptop' or type == 'door' or type == 'stash' or type == 'clothing' then
        DrawMarker(2, coords, 0, 0, 0, 0, 180.0, 0, 0.3, 0.3, 0.3, 204, 0, 102, 100, false, false, 2, true, false, false, false)
    elseif type == 'entranceForSale' then
        DrawMarker(29, coords, 0, 0, 0, 0, 180.0, 0, 0.5, 0.5, 0.5, 255, 204, 0, 100, false, false, 2, true, false, false, false)
    elseif type == 'entranceHasKey' or type == 'entranceNoKey' then
        local rgb = type == 'entranceHasKey' and { 4, 107, 200 } or { 217, 217, 217 }
        DrawMarker(1, coords, 0, 0, 0, 0, 0, 0, 2.0, 2.0, 0.5, rgb[1], rgb[2], rgb[3], 100, false, false, 2, false, false, false, false)
    elseif type == 'storeVehicle' then
        DrawMarker(1, coords, 0, 0, 0, 0, 0, 0, 3.0, 3.0, 0.5, 4, 107, 200, 100, false, false, 2, false, false, false, false)
    elseif type == 'takeVehicle' then
        DrawMarker(36, coords, 0, 0, 0, 0, 0, 0, 1.0, 1.0, 1.0, 4, 107, 200, 100, false, false, 2, true, false, false, false)
    end
end

function OpenWardrobe()
    if FMAPP then
        exports["fivem-appearance"]:openWardrobe()
    else
        Error("No wardrobe resource found (client/opensource.lua:OpenWardrobe)")
    end
end

function BreakInMinigame()
    TaskStartScenarioInPlace(PlayerPedId(), "WORLD_HUMAN_STAND_MOBILE", 0, true)
    
    local result = lib.skillCheck({'easy', 'easy', 'easy'}, {'w', 'a', 's', 'd'})
    
    ClearPedTasks(PlayerPedId())
    return result
end

function RaidMinigame()
    TaskStartScenarioInPlace(PlayerPedId(), "WORLD_HUMAN_STAND_MOBILE", 0, true)
    
    local result = lib.skillCheck({'easy', 'easy', 'easy'}, {'w', 'a', 's', 'd'})
    
    ClearPedTasks(PlayerPedId())
    return result
end

function Notify(msg, type)
    if ESX then
        ESX.ShowNotification(msg, type)
    elseif QB then
        if type == 'info' then type = nil end
        QB.Functions.Notify(msg, type)
    end
end

function GetPlayerData()
    if ESX then
        return ESX.GetPlayerData()
    elseif QB then
        return QB.Functions.GetPlayerData()
    end
end

function IsPlayerLoaded()
    if ESX then
        return GetPlayerData() and GetPlayerData().identifier
    elseif QB then
        return GetPlayerData() and GetPlayerData().citizenid
    end
end

function GetIdentifier()
    if ESX then
        return GetPlayerData().identifier
    elseif QB then
        return GetPlayerData().citizenid
    end
end

function GetJob()
    if ESX then
        return ESX.GetPlayerData().job
    elseif QB then
        return QB.Functions.GetPlayerData().job
    end
end

function GetJobGrade()
    local job = GetJob()

    if ESX then
        return job.grade
    elseif QB then
        return job.grade.level
    end
end
--[[
BY RX Scripts Š rxscripts.xyz
--]]

--[[ K4MB1 STARTER SHELLS ]]--
Config.Shells["standardmotel_shell"] = {
    offsets = {
        door = vector3(-0.397827, -2.530762, -1.556461),
        doorHeading = 274.00531005859,
        laptop = vector3(1.451294, -3.258057, 0.216225),
        laptopHeading = -5.9250378608704,
        stash = vector3(-0.530762, 1.204346, -0.555267),
        clothing = vector3(1.264404, 2.504395, -0.556389),
    },
}
Config.Shells["modernhotel_shell"] = {
    offsets = {
        door = vector3(4.920410, 4.077881, -1.817928),
        doorHeading = 178.88801574707,
        laptop = vector3(0.147583, 1.938477, -0.349930),
        laptopHeading = 13.525725364685,
        stash = vector3(-4.238403, 3.557617, -0.817917),
        clothing = vector3(3.026489, -3.417236, -0.817917),
    },
}
Config.Shells["furnitured_midapart"] = {
    offsets = {
        door = vector3(1.511230, -9.875488, -0.521904),
        doorHeading = 14.050617218018,
        laptop = vector3(-5.873413, 1.514404, 0.247147),
        laptopHeading = 340.99652099609,
        stash = vector3(0.181519, 6.426270, -0.521912),
        clothing = vector3(6.112793, 9.284424, -0.521912),
    },
}

--[[ K4MB1 ALL SHELLS PACK ]]--
Config.Shells["kambi_furnishedhouse1"] = {
    offsets = {
        door = vector3(-0.302299, -2.310595, 1.000000),
        doorHeading = 269.28866577148,
        laptop = vector3(2.461346, 0.994795, 1.709068),
        laptopHeading = 93.704513549805,
        stash = vector3(-2.224915, 2.173328, 0.999969),
        clothing = vector3(-3.631947, 3.867060, 1.000023),
    },
}
Config.Shells["luxury_housing3_k4mb1"] = {
    offsets = {
        door = vector3(-5.918327, -1.069616, -0.700142),
        doorHeading = 271.65982055664,
        laptop = vector3(4.359890, -1.811699, -0.371010),
        laptopHeading = 15.432975769043,
        stash = vector3(2.209511, 1.106823, -0.700180),
        clothing = vector3(4.790962, 2.558894, -0.700180),
    },
}
Config.Shells["luxury_housing4_k4mb1"] = {
    offsets = {
        door = vector3(-5.918327, -1.069616, -0.700142),
        doorHeading = 271.65982055664,
        laptop = vector3(4.359890, -1.811699, -0.371010),
        laptopHeading = 15.432975769043,
        stash = vector3(2.209511, 1.106823, -0.700180),
        clothing = vector3(4.790962, 2.558894, -0.700180),
    },
}
Config.Shells["modernhotel2_shell"] = {
    offsets = {
        door = vector3(4.888165, 4.098339, -0.821373),
        doorHeading = 173.50604248047,
        laptop = vector3(0.153008, 2.036717, -0.340164),
        laptopHeading = 354.2177734375,
        stash = vector3(-4.196033, 3.586248, -0.821388),
        clothing = vector3(2.670223, -3.429825, -0.821381),
    },
}
Config.Shells["modernhotel3_shell"] = {
    offsets = {
        door = vector3(4.888165, 4.098339, -0.821373),
        doorHeading = 173.50604248047,
        laptop = vector3(0.153008, 2.036717, -0.340164),
        laptopHeading = 354.2177734375,
        stash = vector3(-4.196033, 3.586248, -0.821388),
        clothing = vector3(2.670223, -3.429825, -0.821381),
    },
}
Config.Shells["furnitured_lowapart"] = {
    offsets = {
        door = vector3(4.951286, -0.943733, 0.345718),
        doorHeading = 1.5189808607101,
        laptop = vector3(-0.914440, 3.064525, 0.791992),
        laptopHeading = 284.94964599609,
        stash = vector3(-3.037910, 4.091669, 0.345734),
        clothing = vector3(2.368061, -2.780310, 0.345718),
    },
}
Config.Shells["furnitured_midapart"] = {
    offsets = {
        door = vector3(4.951286, -0.943733, 0.345718),
        doorHeading = 1.5189808607101,
        laptop = vector3(-0.914440, 3.064525, 0.791992),
        laptopHeading = 284.94964599609,
        stash = vector3(-3.037910, 4.091669, 0.345734),
        clothing = vector3(2.368061, -2.780310, 0.345718),
    },
}
Config.Shells["furnitured_motel"] = {
    offsets = {
        door = vector3(-1.483879, -3.701548, -0.360237),
        doorHeading = 357.70227050781,
        laptop = vector3(1.476959, -3.340054, 0.311470),
        laptopHeading = 37.169040679932,
        stash = vector3(-1.833771, 0.192400, -0.360237),
        clothing = vector3(-1.279999, 2.247858, -0.360237),
    },
}
Config.Shells["classicmotel_shell"] = {
    offsets = {
        door = vector3(0.304794, -3.666093, -0.337509),
        doorHeading = 0.68369942903519,
        laptop = vector3(-2.125351, 2.821413, 0.115730),
        laptopHeading = 261.10562133789,
        stash = vector3(4.262878, 0.223864, -0.337494),
        clothing = vector3(2.957283, 3.064002, -0.337494),
    },
}
Config.Shells["highendmotel_shell"] = {
    offsets = {
        door = vector3(3.221344, 3.109703, -0.521217),
        doorHeading = 179.76197814941,
        laptop = vector3(2.010498, -3.591475, -0.104385),
        laptopHeading = 187.64874267578,
        stash = vector3(4.133987, -0.971325, -0.520737),
        clothing = vector3(-0.569107, 0.631935, -0.521263),
    },
}
PreviousInstallationNextEvents

Last updated 8 months ago

🌐
📝