DocsCrosshair

Storage

JSON file or MySQL storage and the player identifier.

Not released yet. These pages are written from the code of manniche_crosshair and can change before the release.

Drivers

Set Config.Storage.driver to choose where player data is saved. Each player has one record.

DriverWhere data livesNeeds
'json'data/players.json in the resource folderNothing
'mysql'Table manniche_crosshair_dataoxmysql and sql/install.sql

If the JSON file cannot be parsed, the resource starts with an empty store and keeps the old content as data/players.json.bak.

MySQL

  1. Import sql/install.sql. It creates the table manniche_crosshair_data with the columns identifier (primary key), data (LONGTEXT) and updated_at.
  2. Set Config.Storage.driver = 'mysql'.
  3. Make sure oxmysql starts before the resource, then restart.

If oxmysql is not started, the resource prints an error and falls back to JSON. If the table is missing, it prints an error asking you to import the SQL file.

Player identifier

Records are keyed by the identifier type in Config.Storage.identifier. If the player has none, the server tries license, license2, fivem, steam and discord in that order. A player with none of these cannot save, and requests fail with no_identifier.

Changes are written after the debounce time, when the player leaves, and when the resource stops.