Configuring the resource

Resource Settings

-- Distance to load the bike stations in from
    loadDistance = 200.0,

    accessMachineDistance = 3,

    -- The distance between docks in metres
    distanceBetweenDocks = 2.0,

    useMachineKey = {0, 191},

    -- Key to return the bikes at the end of the rent
    returnBikeKey = {0, 38},

    -- Length of cooldown in seconds
    cooldownLength = 300,

When configuring the resource you will start with the above lines.

Starting with the LoadDistance this is the distance the bike station will load in for on people, and 200.0 is the default value for how far this resource will load in.

The accessMachineDistance = 3, is how far away you can be from the bike terminal to be able to access it to purchase a bike.

distanceBetweenDocks = 2.0, which allows you to choose how far each bike dock will be from one another, by default the docks are 2 meters apart from one another, moving this up will make it further away while making the number smaller will make it smaller.

useMachineKey = {0, 191}, 191 is the enter keybind you can change this to the key you wish. You can use this website here

returnBikeKey = {0, 38}, 38 is the E keybind, which allows you to return the bike to the dock.

cooldownLength = 300, this is how long the resource will wait before allowing the user to reuse the bike terminal.

Resource Dock Settings

-- If a dock is empty for this long, it will automatically recreate a new bike (minute)
replenishAfter = 10,
blipName = "Available Bikes: ", -- This shows how many bikes available at each dock
blipsEnabled = true, -- Global option
blip = 226,
blipShortRange = true,
blipScale = 1.0,
blipColour = 1,
blipDisplay = 6,
animation = true, -- Set to true to have animation when entering machine.

replenishAfter = 10. This indicates how long it will take to restock the docks with bikes. This duration is in minutes, so after 10 minutes, the dock will be automatically recreated, refilling it.

blipName = "Available Bikes: ", this is what the name of the blip on the map will be called.

blipsEnabled = true, this will allow you to enable blips to the docks this is a global option.

bip = 226, this is the ID of the sprite. You can change this to alter the icon on the game map. You can find the IDs here

blipShortRange = true, this allows you to make it so the blip only shows if you're near the station.

blipScale = 1.0, this allows you to edit the size of the blip on the map.

blipColour = 1, which allows you to change the colour of the blip to configure this you can view the fivem docs here

blipDisplay = 6, allows you to change the style of display for the blips. To see the different options you can view the fivem natives by clicking here

animation = true, gives you the ability to enable or disable the animation a player plays when entering the bike hire terminal. To disable the animations change the value of true to false.

Configuring locations

To configure the locations for new bike hire locations or configure already pre-existing locations please view the Configuring Locations page of this resource.

Configuring translations

If you need to change the text of any prompts within this resource we have made it easy for you to change this.

    translations = {
        press = "Press",
        machineKey = "INPUT_FRONTEND_RDOWN",
        returnKey = "INPUT_PICKUP",
        toHire = "to hire a bike",
        toReturn = "to return this bike",
        noFree = "~y~Alert~w~: There are no free docks to return this vehicle.",
        noneLeft = "~y~Alert~w~: There are no bikes left.the",
        bikeHired = "~g~Success~w~: You've hired a bike, it is unlocked and you can start using it.",
        bikeReturned = "~g~Success~w~: You've returned the bike, thanks.",
        cooldown = "~y~Alert~w~: You must wait before hiring another bike.",
        insufficientFunds = "~y~Alert~w~: You have insufficient funds.",
        onCooldown = "Cannot rent bike currently."

    },

When changing the translations please only change the text within the quote marks, changing the values will break this script.

Bike Rent Price

After reaching the bottom of the config file you will see a config line saying "costToRent" This allows you to change the price of the bikes. To change the price please change 100 to the value you wish.

Framework permissions

The bike hire resource comes with some default frameworks including vRP, ESX, and QBcore to enable any of these frameworks to change the value of false to true. For example,

    framework = {
        usevRP = false,
        useESX = false,
        useQBcore = false,
    }

If you want to enable QBcore, change 'useQBcore = false' to true. This will activate the QBcore framework. You can also add your code to the sv_utils.lua file if you do not use the base framework money system.

Last updated