IF-Store Docs
DiscordYoutubeStoreMy Hosting
  • 📚Welcome To IF-Developments!
  • About us
    • 💗Support
    • 📉Common issues
    • ⁉️Terms of Service
    • ⚙️Download & Install Resources
  • Resources
    • 💰Banking V1
    • 💰Banking V2
    • 💰Redline Banking
    • 💰Banking V3
    • 🖼️HUD V1
    • 🖼️HUD V2
    • 🖼️HUD V3
    • 🖼️DPS HUD
    • 👕Luxury Clothing Store
    • 🖇️Crafting V1
    • 🐶Pets V2
    • GameShop
    • ⚙️Login/Signup
    • 🎆Redline Garage
    • 🛁Hot Tube
    • 💬Chat V1
Powered by GitBook
On this page

Was this helpful?

  1. Resources

Redline Garage

Documentation of Redline Garage

Supported on ESX and QB servers

SQL Structure

We've made a SQL Structure separated of default QB/ESX garage scripts to avoid incompatibility problems, so, you need to go on README.md FOR ESX

ALTER TABLE `owned_vehicles`
  ADD COLUMN `garage` VARCHAR(255) DEFAULT NULL,
  ADD COLUMN `fuel` INT DEFAULT NULL,
  ADD COLUMN `engine` FLOAT DEFAULT NULL,
  ADD COLUMN `body` FLOAT DEFAULT NULL,
  ADD COLUMN `state` INT DEFAULT NULL,
  ADD COLUMN `depotprice` INT DEFAULT NULL;

FOR QB

ALTER TABLE `player_vehicles`
  ADD COLUMN `garage` VARCHAR(255) DEFAULT NULL,
  ADD COLUMN `fuel` INT DEFAULT NULL,
  ADD COLUMN `engine` FLOAT DEFAULT NULL,
  ADD COLUMN `body` FLOAT DEFAULT NULL,
  ADD COLUMN `state` INT DEFAULT NULL,
  ADD COLUMN `depotprice` INT DEFAULT NULL;
  ADD COLUMN `mods` INT DEFAULT NULL;
Installation

  • Make sure that the required scripts, ["PolyZone", "oxmysql"], and one of the target scripts 'ox_target', 'qb-target', or 'qtarget' are installed on your server.

  • Choose your language with Config.locale in shareds/config.lua; the default languages are Turkish, English, and German. You can add more language options by checking the shareds/locales.lua file.

  • Configure other settings in Config.lua according to your server's needs; all settings have explanations provided.

  • Ensure that you have started the script after the requirements by adding "ensure if-redlinegarage" to your server.cfg.

Add new garages
  • You can add a new garage to shareds/garages.lua. For example:

    ["newgarageindex"] = { -- The index of the garage must be unique
        ["label"] = "new garage", -- The visible name of the garage
        ["takeVehicle"] = vector3(273.43, -343.99, 44.91), -- Target NPC position for accessing the garage; can include heading as a vector4.
        ["spawnPoint"] = vector4(270.94, -342.96, 43.97, 161.5), -- Spawn location when a vehicle is taken out of the garage
        ["putVehicle"] = vector3(276.69, -339.85, 44.91), -- Vehicle entry point into the garage
        ["previewPoint"] = vector4(274.69, -330.25, 44.92, 166.89), -- Preview location for vehicles inside the garage; defaults to spawnPoint if not specified.
        ["showBlip"] = true, -- Determines whether the garage blip is visible
        ["blipName"] = "Garage", -- The name of the garage blip on the map
        ["blipNumber"] = 357, -- Blip type; you can view other types through FiveM
        ["blipColor"] = 3, -- Blip color; does not support RGB, only predefined blip color numbers in FiveM
        ["type"] = "public", -- Type of garage: public, job, gang, depot, house
        ["vehicle"] = "car", -- Categories of vehicles that can be stored in the garage: car, air, sea, rig
        ["job"] = "police", -- Specify the job that can access the garage if the type is set to job or gang
        ["jobType"] = "leo", -- Checks for job type if the job does not match; add it if you use the same grade in two different jobs, e.g., police/fbi
        ['npc'] = { -- If not specified, default NPC and heading are used; if specified, the model and direction of the NPC that will appear at the takeVehicle location are set.
            model = "s_m_m_movspace_01",
            heading = 50.0
        },
        ['limit'] = 10, -- If using a limited garage, set the garage limit; if left blank, the default limit is applied
        ['previewsCoords'] = { -- Specify the areas where vehicle previews will be created if Config.garagePreview is set correctly in the config; you can add as many as you want within the garage area.
            vector4(265.71, -331.87, 44.51, 250.0),
            vector4(267.71, -329.06, 44.51, 250.21),
            vector4(268.84, -325.82, 44.51, 248.74)
        }
    },
  • You can add garages in-game with admin permissions. First, add your Steamhex or license to Config.admins; an example is already provided. Use the account to which you granted permission and use the commands in Config.commands to create a garage in-game. The "createGarage" command opens the garage creation menu. When entering the command, don't forget to add a unique garage index as a parameter, for example, "/command newgarage". Fill in the desired fields in the menu, close the menu with the "esc" key before clicking the save button to get the coordinates. You can then reopen the menu with the same command and parameter to continue where you left off. After clicking the save button, go to the desired location to add "previewsCoords" and use the "addgaragepreviewpoint" command as specified. This command takes your current location as a vector4 and adds it as a preview point for the garage you're creating. Repeat this as needed and then execute the "savegarage" command to save your garage. Your garage is now ready.

Integrating with house garages

Some programming knowledge is required for these steps; if you don't know, you should seek assistance from someone who does.

  • You can add garage coordinates within your house script to garages on the server using a loop and the exports['if-redlinegarage'].addHouseGarage(houseindex, garageinfo) export. As an example:

exports['if-redlinegarage'].addHouseGarage('nakreshouse:1',
    {
        ["label"] = "nakres house",
        ["takeVehicle"] = vector3(336.71, -120.03, 67.32),
        ["spawnPoint"] = vector4(340.13, -121.89, 67.11, 339.41),
        ["putVehicle"] = vector4(340.13, -121.89, 67.11, 339.41),
        ["vehicle"] = "car", --- car, air, sea, rig
     }
)

Example usage to add house garages

for houseindex, house in pairs(G_houses) do
    local garage = house.garage
    local garageIndex = house.garage.index or houseindex
    exports['if-redlinegarage'].addHouseGarage(garageIndex, garage)
end
  • set house permission control -> Config.houseHasKeyadd YourPermissionCheckFunction with the actual function or logic you have for checking whether a user has the required permission for the specified houseindex. The function should return true if the user has access and false otherwise.

    Config.houseHasKey = function(src, houseindex)
        -- Your house key access control logic here
        -- Example: Check if the user has the required permission for the specified houseindex
        local userHasAccess = YourPermissionCheckFunction(src, houseindex)
        return userHasAccess
    end

PreviousLogin/SignupNextHot Tube

Last updated 1 year ago

Was this helpful?

🎆
Page cover image