SAFScriptsDocs

Configuration

SAF Garage is coming soon. These docs describe the build that will ship.

On this page

Everything you would want to change is in config.lua. Rules that need code (who owns what, keys, fuel, limits per rank) are in bridge/, covered in Custom servers.

Framework

OptionDefaultWhat it does
Config.Framework'auto''auto', 'qbx', 'qb', 'esx', 'nd', 'ox' or 'standalone'

Storage

OptionDefaultWhat it does
Config.Storage'auto''auto' uses oxmysql when it runs, otherwise a JSON file. 'oxmysql' always uses the database. 'json' always uses garage.json in the resource folder

Opening the garage

OptionDefaultWhat it does
Config.Command'garage'Command that opens the menu
Config.Key'F7'Default key. Players can rebind it. '' means no default key, false means no key binding at all
Config.SaveCommand'savecar'Quick save of the car you're in, without the menu. false turns it off
Config.Title'Garage'Title shown in the menu

Limits and staff

OptionDefaultWhat it does
Config.MaxVehicles15Saved vehicles per player
Config.StaffMax50Saved vehicles for staff
Config.StaffAce'garage.staff'ACE that counts as staff
Config.StaffGroupsadmin, god, superadminFramework groups that also count as staff

To give donators or ranks more, replace Bridge.GetVehicleLimit. See Custom servers.

Spawning

OptionDefaultWhat it does
Config.SpawnMode'anywhere''anywhere' spawns saved vehicles wherever you are. 'garages' only next to a spot in Config.Garages
Config.SpawnPosition'front''front' puts the car in front of you, facing your way. 'replace' puts it in the place of the car you took out last, when you're driving it
Config.WarpIntruePut the player in the driver seat
Config.ReplacePrevioustrueDelete the car you took out last when you take out another
Config.DeleteOnLeavetrueDelete a player's garage car when they leave the server
Config.SpawnCooldown5Seconds between spawns
Config.Fuel100.0Fuel level of spawned vehicles (needs a fuel resource)
Config.SaveDirtfalseKeep dirt on saved vehicles. false always spawns them clean
Config.SpawnClearRadius3.0A spot counts as taken when a vehicle is this close, plus the car's own size

Garage spots

Used when Config.SpawnMode = 'garages'. Vehicles come out on the first free point in spawns.

KeyExampleWhat it does
label'Legion Square'Name of the garage
coordsvec3(215.8, -810.1, 30.7)Centre of the garage
radius25.0How close a player must be to use it
spawns{ vec4(...), ... }Spawn points with heading, tried in order

Legion Square, Sandy Shores and Paleto Bay ship by default.

Lua
Config.Garages = {
    {
        label = 'Legion Square',
        coords = vec3(215.8, -810.1, 30.7),
        radius = 25.0,
        spawns = { vec4(229.7, -800.2, 30.2, 157.0), vec4(232.4, -792.9, 30.2, 157.0) },
    },
}
OptionDefaultWhat it does
Config.GarageBlips{ enabled = true, sprite = 357, colour = 3, scale = 0.7, label = 'Garage' }Map blips for the garage spots

Allowed vehicles

OptionDefaultWhat it does
Config.BlacklistemptySpawn codes that can't be saved or taken out, lower case, e.g. 'rhino'
Config.BlockedClasses[21] = trueGTA vehicle classes that can't be saved. Trains are blocked by default
Config.Classesclass namesNames shown for the 23 GTA vehicle classes (0 Compact to 22 Open Wheel)

For job cars, whitelists or class locks per player, replace Bridge.CanUseModel.

Plates

OptionDefaultWhat it does
Config.Plates.EditabletruePlayers can change the plate text
Config.Plates.MinLength2Shortest plate
Config.Plates.MaxLength8Longest plate. GTA plates fit 8
Config.Plates.Allowed'[^A-Z0-9 ]'Characters that are NOT allowed, as a Lua pattern on the upper case text
Config.Plates.UniquetrueNo two saved vehicles on the server can share a plate
Config.Plates.BadWordslistWords a plate can't contain
Config.Plates.Styles6 stylesPlate styles players can pick

BadWords ships with a list of slurs and offensive words. Add your own to the list.

Each style is a GTA plate index and a label:

idLabel
0San Andreas
3San Andreas (old)
4SA Exempt
1Yellow on black
2Yellow on blue
5North Yankton

Share codes

OptionDefaultWhat it does
Config.Share.EnabledtruePlayers can turn a saved build into a code that others import
Config.Share.ExpireDays30Codes stop working after this many days. 0 means never

Vehicle pictures

OptionDefaultWhat it does
Config.ImageUrl'https://docs.fivem.net/vehicles/%s.webp'Picture link, %s is the spawn code. false turns pictures off

Addon cars without a picture get a plain icon.

SAF Scripts by San Andreas' Finest StoreDiscordsupprot@safrp.org

Not affiliated with or endorsed by Rockstar Games, Take-Two Interactive or Cfx.re.