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.
| Driver | Where data lives | Needs |
|---|---|---|
'json' | data/players.json in the resource folder | Nothing |
'mysql' | Table manniche_crosshair_data | oxmysql 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
- Import
sql/install.sql. It creates the tablemanniche_crosshair_datawith the columnsidentifier(primary key),data(LONGTEXT) andupdated_at. - Set
Config.Storage.driver = 'mysql'. - Make sure
oxmysqlstarts 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.