Skip to content

Installation

Installation

1. Dependencies

Install and start ox_lib before this resource. If you plan to use database storage, oxmysql must also be running.

2. Drop the resource in

Place bupa-safezonecreator in your resources folder (for example inside a [BUPA] category folder) and add it to your server.cfg.

3. server.cfg — ensure order

ox_lib (and oxmysql, if used) must start before the resource.

server.cfg
ensure ox_lib
ensure oxmysql            # only if you use Storage = 'db'
ensure bupa-safezonecreator

4. Admin access

Opening the creator is gated. During testing it is open to everyone — lock it down before you go live.

shared/config/general.lua
Config.AdminOnly = false   -- TODO: set true before release (currently open to everyone)
Config.AdminAce  = 'bupa.safezone'
Config.AdminGroups = { 'admin', 'superadmin', 'god' }
Config.CustomAdmin = false -- true = use your own IsPlayerAdmin() in server/editable.lua

Once AdminOnly = true, a player passes the gate if any of these is true:

  • They hold the ACE permission — grant it with:
server.cfg
  add_ace group.admin bupa.safezone allow
  
  • Their framework group is in Config.AdminGroups (ESX group, QB-Core job name / HasPermission('admin'), QBox job name).
  • Config.CustomAdmin = true and your Editable.isAdmin(src) in server/editable.lua returns true.

Config.AdminOnly ships as false so you can test immediately. Set it to true before release, or anyone can open the creator.

5. Storage — JSON or database

shared/config/general.lua
Config.Storage = 'json'   -- 'json' | 'db'
  • json (default) — zones are written to data/zones.json inside the resource. Zero setup.
  • db — zones are stored in oxmysql. The table is created automatically on first start; you do not need to import any SQL:
auto-created table
CREATE TABLE IF NOT EXISTS bupa_safezones (
    id   VARCHAR(64) PRIMARY KEY,
    data LONGTEXT
);

6. Language

Language is set globally via ox_lib's locale convar. Add to server.cfg:

server.cfg
setr ox:locale "tr"

English is the fallback for any missing key. See Localization for the full list of shipped languages.