Installation guide — please follow each step carefully and exactly as described to ensure the script works correctly on your server. Skipping or modifying steps may cause the system to not function properly, so follow it step by step.
This script requires some mandatory dependencies to function correctly. Make sure to download and extract them inside your server’s main directory, keeping their original folder structure intact.
Get up and running in just a few minutes. Follow the steps below to install the resource, configure the required dependencies, and verify that everything is working correctly on your server. Once completed, all features will be available in-game and ready to use.
Upload The Resource
Place qs-crosshair/ inside your server's resources/ directory.
javascript
resources/
└── [crosshair]/
└── qs-crosshair/
Configure server.cfg
Add the following lines to your server.cfg in this exact order:
javascript
ensure oxmysql
ensure ox_lib
ensure qs-crosshair
Restart The Server
Restart your server to load the resource.
Verify Installation
Check the server console and confirm that the qs-crosshair startup banner appears successfully, showing the resource version and status.
This script includes an essential database required for its operation.You must import it before starting your server, preferably using HeidiSQL or any other manager compatible with MariaDB/MySQL.
ESX/QB
sql
CREATE TABLE IF NOTEXISTS `qs_crosshair_admin_config` (
`id` INT UNSIGNED NOT NULLPRIMARY KEY,
`config_json` LONGTEXT NOT NULL,
`updated_at` TIMESTAMPNOT NULLDEFAULTCURRENT_TIMESTAMPONUPDATECURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE IF NOTEXISTS `qs_crosshair_share_codes` (
`code` VARCHAR(32) NOT NULLPRIMARY KEY,
`cfg_json` LONGTEXT NOT NULL,
`name` VARCHAR(64) NOT NULL,
`owner_license` VARCHAR(128) NOT NULL,
`created_at` TIMESTAMPNOT NULLDEFAULTCURRENT_TIMESTAMP,
INDEX `idx_qscrosshair_codes_created_at` (`created_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE IF NOTEXISTS `qs_crosshair_players` (
`license` VARCHAR(128) NOT NULLPRIMARY KEY,
`cfg_json` LONGTEXT NULL,
`enabled` TINYINT(1) NOT NULLDEFAULT1,
`updated_at` TIMESTAMPNOT NULLDEFAULTCURRENT_TIMESTAMPONUPDATECURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
Replace XXXXXXXXXXXXXXXXXX with the player's FiveM license identifier. You can find it via F8 while connected, or from the txAdmin player list.
To use a different ace group (for example a custom crosshair.admin), edit Config.Admin.AceGroup in config/main.lua and grant that ace to your admin players.
If you need to gate access, fire side-effects, or integrate with another script, use the hook files — they are not encrypted.
Location client/custom/main.lua.
lua
-- Return false to block a specific player from opening the panel.functionOnBeforeOpen()-- Example: block panel during active PvP event-- if IsInPvpZone() then return false endreturntrueend-- Called immediately after the panel opens.functionOnAfterOpen()end-- Called whenever the active crosshair build changes.-- cfg is the full CrosshairCfg table.functionOnApply(cfg)end
Location server/custom/main.lua.
lua
-- Called when a player loads and their library is hydrated.functionOnPlayerLoad(src)end-- Called when a player successfully sends a build to another player.functionOnShareSent(sender, recipient, build)end-- Called when an admin saves a panel setting (key/value pair).functionOnAdminSave(admin, key, value)end