Configuring this resource
This script allows you to easily build a customizable vehicle spawning menu for your FiveM server. Players can browse through categories and select the vehicles they are permitted to spawn.
We use the ox_lib resource to handle styling and display β this is the only dependency required.
π Installation
Ensure ox_lib is installed Download and install
ox_libin your resources.Add
MirrorParkStudios-VehicleSpawnerto your resources folderEnsure it's started in your server.cfg:
ensure ox_lib ensure MirrorParkStudios-VehicleSpawnerUse
/vsin-game (or customize the command name in the config)
βοΈ Configuration Options
You can find the configuration file at: π Shared/Config.lua
This file allows you to customize how the menu is accessed, who can use it, and what order your menus appear in. Below is a breakdown of each option:
π§ Config.Debug
Config.DebugType: boolean Default: true
Enables or disables debug logging in the server/client console. Set this to false in production to reduce console noise.
π¬ Config.Command
Config.CommandType: table Controls whether the /vs command is enabled, and what its name is.
π Config.RestrictionCheck
Config.RestrictionCheckType: function This function determines whether a player is allowed to open the menu. You can insert any logic based on job, permission, or player data. Return true to allow access, or false to block it.
π Config.MenuOrder
Config.MenuOrderType: table (array of strings)
This controls the load order of menu structure files in your Shared/Menus/ folder. The entries should match the file names exactly without the .lua extension.
For example, this would load Shared/Menus/FP.lua first, then MO8.lua.
π Example Menu Structure
We have chosen to allow you to create folders per menu that you would like, to prevent you becoming overwhelmed with one extremely long file.
You can find an example of a Menu structure at /Menus/_EXAMPLE.lua, which contains useful notes to help you build your desired menu. This will not be loaded unless you add _EXAMPLE to Config.MenuOrder.
Note: Every menu file must end with:
π― Opening the Menu Manually
If you'd like to open the menu manually from another script, you can trigger the following client event:
This will open the vehicle spawn menu for the current player, respecting the restriction check in your config.
Last updated