SAFScriptsDocs

Getting started

What you get, where to download it, and how to start any SAF script on your server.

On this page

Editions

Every script is sold in two editions. Both have the same features and the same config.

StandardOpen source
CodeCore protected by Cfx.re escrowEvery file readable and editable
Always openconfig.lua, bridge/, custom/Everything
DeliveryCfx.re KeymasterDownload link from the store
Runs onServers whose license key belongs to the Cfx.re account that bought itAny of your servers
Best forDropping in and staying updated without touching codeChanging how the script works inside

The parts you need to fit a script to your server (options, framework hooks, permissions) are open in both. Pick open source only if you want to change the core.

Getting your download

Standard (escrowed)

  1. At checkout, log in to the store with the Cfx.re account that owns your server's license key.
  2. After payment, open keymaster.fivem.net and log in with that same account.
  3. Go to Granted Assets. The script is listed there. Download the zip.
  4. Unzip it into your server's resources folder.

An escrowed resource only starts on a server whose license key is on the account that owns the asset. If the console says the server lacks the entitlement, see the FAQ.

Open source

You get a download link by email right after checkout. The same link is in your purchase history on the store. Unzip it into your resources folder.

Requirements

  • A current FiveM server build. Update your artifacts if a script fails to start on an old one.
  • One of the supported frameworks below, or none (standalone).
  • OneSync for SAF Traffic and SAF Anticheat. It is on by default on current servers.

Frameworks

Each script detects the framework on its own. You can also set Config.Framework by hand.

ScriptQboxQBCoreESXND Coreox_coreStandalone
SAF TVYesYesYesYesYesYes
SAF ScenesYesYesYesYesYesYes
SAF HUDYesYesYesStandaloneStandaloneYes
SAF WeatherYesYesYesYesYesYes
SAF PursuitYesYesYesYesYesYes
SAF GarageYesYesYesYesYesYes
SAF TrafficYesYesYesYesYesYes
SAF AnticheatYesYesYesYesYesYes

"Standalone" means SAF HUD runs in its standalone mode there. To use your framework's loaded state and staff groups, point the open bridge functions at it. See SAF HUD custom servers.

Inventories

SAF TV and SAF Scenes use items. They work with ox_inventory, qb-inventory, ps-inventory, lj-inventory, qs-inventory, codem-inventory, core_inventory, tgiann-inventory, jaksam_inventory, origen_inventory, the ESX default inventory, or no inventory at all. Item files for each are in the script's install/ folder.

Other resources

ScriptNeedsOptional
SAF TVNothingox_target or qb-target
SAF Scenesox_lib, oxmysql
SAF HUDNothingA postal map file
SAF WeatherNothingox_lib
SAF PursuitNothingox_lib
SAF GarageNothingoxmysql, a fuel script, a keys script, ox_lib
SAF TrafficOneSyncox_lib, SAF Weather
SAF AnticheatOneSyncoxmysql, screenshot-basic

Ensure order

Start SAF scripts after everything they talk to: your framework, then the libraries and database, then your inventory and target, then the SAF scripts.

server.cfg
# framework and libraries
ensure oxmysql
ensure ox_lib
ensure qbx_core

# inventory and target
ensure ox_inventory
ensure ox_target

# SAF Scripts
ensure saf-hud
ensure saf-scenes
ensure saf-tv

Each script prints the framework and inventory it found when it starts. Check the server console after the first start.

Permissions

Staff features use ACE permissions. Each script's Installation page lists its own, for example:

server.cfg
add_ace group.admin hud.manage allow
add_ace group.admin tv.staff allow
add_ace group.admin scenes.staff allow

Most scripts also count framework admin groups (admin, god, superadmin) as staff. You can replace the permission check with your own staff system in custom/.

The custom folder

Every script loads custom/ last:

FolderUse it for
custom/shared/Changing Config values
custom/client/Replacing client Bridge.* functions
custom/server/Replacing server Bridge.* functions

Updates never ship anything in custom/, so your changes survive every update. For example:

custom/shared/config.lua
Config.Units = 'kmh'
Config.SOE.prefix = ''
custom/server/staff.lua
function Bridge.IsStaff(src)
    return exports['my-admin']:IsAdmin(src)
end

Updating

  1. Download the new version from the same place as before.
  2. Replace every file in the resource folder except custom/ and the data files the script writes, such as placed.json, state.json or roads.json.
  3. Restart the resource and read the changelog for config options that were added.

Next

Pick a script from the sidebar and open its Installation page.

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

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