[Standalone | ESX | QBCore] ZeroDream Parking | Parking your car like in real life

ZeroDream Parking

A car parking script for FiveM | Standalone | Custom framework support

Preview Video


Features

  • Stored the cars like the real life, your cars will not disappear when you are offline.
  • When you are outside the car, you can press key to save/drive it.
  • Store vehicle damage (Windows, tires, doors, deformations).
  • On global parking mode, you can park your car anywhere.
  • Require parking fees for player, also player not need to pay if they have parking card.
  • Blacklist for vehicles model support, separately set in each parking.
  • Custom key binds support, player can define the key binds themselves.
  • Standalone script, it can run without any framework.
  • ESX / QBCore or other custom framework support.
  • Database will be import automatically, you don’t need to import it yourself.
  • Optimized performance (0.01ms in common, 0.05ms when close to vehicles).

IMPORTANT

!!! CHANGE THE KEY BINDS BEFORE YOU START IT !!!
!!! CHANGE THE KEY BINDS BEFORE YOU START IT !!!
!!! CHANGE THE KEY BINDS BEFORE YOU START IT !!!

This script is using RegisterKeyMapping, when you run the script, the key bindings are sent to the clients, you cannot modify them again by changing the configuration, every player needs to change it in pause menu by themselves.

Requirements

Download & Installation

Manually

  • Download Zip File
  • Unzip the archive and rename the folder to zerodream_parking
  • Put it in your resources folder

Using Git

GitHub Repo: GitHub - kasuganosoras/zerodream_parking: πŸš— A car parking script for FiveM

git clone https://github.com/kasuganosoras/zerodream_parking

Installation

  • Add ensure zerodream_parking to your server.cfg.
  • Restart your server, the script will create the database table automatically.
  • Restart your server again to take effect.

Commands

name args description
/impound <plate> Impound a car and remove it from the parking
/findveh <plate> Find a car by plate number

Custom API

All the code related to the framework or balance system is in the client/api.lua and server/api.lua file, you can modify it to fit your needs.

By default, I have added the ESX support, you can enable it by change the framework type in config.lua to esx.

You can visit the documents to learn more: GitHub Wiki

Configuration

Here is an example configuration file
Config = {

    -- Debug mode
    debug       = false,

    -- Locale (en / zh / es)
    locale      = 'en',

    -- Which framework you are using, can be 'standalone', 'esx', 'esx1.9' or 'qbcore'
    framework   = 'standalone',

    -- Require stop the engine before parking car?
    stopEngine  = true,

    -- Allow park not owned vehicles?
    notOwnedCar = true,

    -- Locked car for everyone (included owner)?
    lockedCar   = true,

    -- Parking card item name
    parkingCard = 'parkingcard',

    -- Command settings, use false to disable (Only can disable engine control / find vehicle)
    commands    = {
        -- Control engine command
        engineControl  = 'enginecontrol',
        -- Park vehicle command
        parkingVehicle = 'parkingvehicle',
        -- Find the vehicle command
        findVehicle    = 'findveh',
    },

    -- Default key binding, use false to disable, player can change key binding in pause menu > settings > key binding > FiveM
    keyBinding  = {
        -- Turn on/off engine
        engineControl  = 'G',
        -- Park vehicle
        parkingVehicle = 'L',
    },

    -- Impound settings
    impound     = {
        command = 'impound',
        job     = { 'police', 'admin' },
    },

    -- Parking setting
    parking     = {
        -- Parking id, should be unique, DO NOT USE 'global' AS PARKING ID
        ['parking_1']  = {
            -- Parking name
            name       = 'Parking 1',
            -- Parking position
            pos        = vec3(-320.1, -921.38, 30.0),
            -- The parking size
            size       = 50.0,
            -- Max cars can be parked in this parking
            maxCars    = 10,
            -- Allow vehicle class, can be find here: https://docs.fivem.net/natives/?_0x29439776AAA00A62 (use -1 means all, use , to separate multiple types)
            allowTypes = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }, -- if you want to allow all class, change to { -1 },
            -- Parking fee per day in real life time
            parkingFee = 1000,
            -- Display notification?
            notify     = true,
            -- White list, can be identifier, ip and job name, player will not need to pay parking fee if they are in the whitelist
            whitelist  = {
                'identifier.steam:110000131d62281',
                'ip.127.0.0.1',
                'job.admin',
            },
            -- Black list of vehicle model
            blacklist  = {
                'adder',
                'banshee',
            },
        },
    },

    -- Global parking
    globalParking = {
        -- if true, player can park their vehicle in any where
        enable     = true,
        -- Max cars can be parked on the map
        maxCars    = 100,
        -- Allow vehicle class, can be find here: https://docs.fivem.net/natives/?_0x29439776AAA00A62 (use -1 means all, use , to separate multiple types)
        allowTypes = { -1 }, -- if you want to allow all class, change to { -1 },
        -- Render distance
        distance   = 50.0,
        -- Parking fee per day in real life time
        parkingFee = 1000,
        -- white list, can be identifier, ip and job name, player will not need to pay parking fee if they are in the whitelist
        whitelist  = {
            'identifier.steam:110000131d62281',
            'ip.127.0.0.1',
            'job.admin',
        },
        -- Black list of vehicle model
        blacklist  = {
            'adder',
            'banshee',
        },
    }
}

Changelog

Click to view the changelog

1.0.3

  • Fixed ESX Multi-character cannot get identifier when player join game issue.
  • Fixed the space char in vehicle plate will cause the server cannot find the vehicle issue.
  • Fixed MySQL table creation issue.
  • Added locking car for everyone option.
  • Added impound command for console support.
  • Added IsParkingVehicle and ImpoundVehicle exports for client scripts.
  • Added ImpoundVehicle export for server scripts.
  • Default global parking allow vehicle types change to -1.

1.0.2

  • Added ESX 1.9 support
  • Added QBCore support
  • Added oxmysql support
  • Bugs fix

1.0.1

  • Bugs fix
  • Added new API features
  • Added deformation save
  • Added bulletproof tires save
  • Added broken windows save
  • Added burst tires save

1.0.0

  • First release of this script
  • Base parking API support
  • Added ESX support

Enjoy!

Happy new year to everyone!:tada:

19 Likes

nice work bro

Very very nice script but i have a problem with impound

1 Like

If you are using standalone mode, the impound command will not be working.

You can edit the config.lua and change the impound job to player, then everyone can use impound command.

is it possibel to write for standelone allsow for a job?

when i write esx in the config i have this error and we are using esx legacy

errrorassw

Which ESX version you using?
I have tested it on ESX 1.1.0

we are using esx_legacy

I have the same error as you I am on the last version of legacy, you managed to settle it?

I think that may cause by the name properties is removed in esx legacy.
You can edit the server/api.lua and find the GetPlayerNickname parts, change the

return xPlayer.name

to

return GetPlayerName(player)

Then it should solve.

A new commit has been pushed to the GitHub, all the above problems should be solved.

Is this like a Update Version of this?

Yes, this script is written entirely from scratch, it has better performance, support any framework, and it has better user experience.

Sounds nice. Will try. Good Work!

wow great work and especially so quickly fixed but when I want to impound he says he can not find the vehicle

You may enter a wrong plate number, or the car has been deleted in database but not in client game.

You can try to restart the script and check if the car is still here, or you can go to database and check is the car record exists.

the vehicle is allsow in the db

Umm, that is caused by your plate number has a space. I forget to connect the plate number string, it will be fixed soon.