SAFScriptsDocs

Installation

On this page

SAF TV needs no database. It finds your framework and inventory on its own.

Steps

  1. Put the saf-tv folder in your resources folder.
  2. Add it to server.cfg, after your framework and inventory:
    server.cfg
    ensure saf-tv
  3. Give your staff access. Staff can pick up anyone's TV and have no TV limit:
    server.cfg
    add_ace group.admin tv.staff allow
  4. Add the four TV items for your inventory. See Items.
  5. Copy the item pictures from install/images/ into your inventory's image folder (for ox_inventory: ox_inventory/web/images/).
  6. Start the server. The console prints the framework and inventory it found, and the link the TV page is hosted at.

Items

ItemLabelModel
tv_smallSmall TVprop_tv_flat_03
tv_mediumTVprop_tv_flat_02
tv_largeBig Screen TVprop_tv_flat_01
tv_wallWall TVprop_tv_flat_michael

Pick the file in install/ that matches your inventory:

FileFor
install/ox_inventory.txtox_inventory (Qbox, ND Core, ox_core). Paste into ox_inventory/data/items.lua
install/qb_items.txtQBCore inventories and qs-inventory. Paste into the shared items list
install/esx_items.sqlESX. Run once on your database

With no inventory (Config.Inventory = 'none'), staff place TVs with /placetv <item> instead.

The TV page

YouTube only plays on https pages, so the TVs can't load their home screen straight from the resource. With Config.ScreenUrl = 'auto' (the default) SAF TV hosts the page itself over https through your server's own cfx.re address. There is nothing to set up.

That address only exists when your server is listed with Cfx.re. It is not there on sv_lan servers. Until it shows up the TVs still work, but YouTube videos won't play.

To host the page yourself, upload the html/os folder to your website or CDN and point the config at it:

Lua
Config.ScreenUrl = 'https://cdn.example.com/tv/os/index.html'

Optional: target

With ox_target or qb-target running, placed TVs get a "Pick up TV" option. Without one, players use /pickuptv next to the TV.

Updating

Replace every file except your custom/ folder and the saved files placed.json (placed TVs) and fits.json (picture alignment). Keep config changes in custom/shared/ so updates never undo them. See Custom servers.

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

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