Not released yet. These pages are written from the code of
manniche_crosshair and can change before the release.Server exports
| Export | Returns | What it does |
|---|---|---|
GetPlayerData(source) | table or nil | The player's stored data (active, profiles, weaponMap, settings, favorites). nil without an identifier, or on a cache miss with the MySQL driver. |
SetPlayerActive(source, config) | boolean | Sanitizes config, saves it as the active crosshair and syncs the client. false without an identifier. |
EncodeProfile(profile) | string | Returns an MNC- share code. |
DecodeProfile(code) | profile, or nil and an error key | Decodes a share code. |
local code = exports['manniche_crosshair']:EncodeProfile(profile)
Client exports
| Export | Returns | What it does |
|---|---|---|
Open(page) | - | Opens the editor, optionally on a page. |
Close() | - | Closes the editor. |
IsOpen() | boolean | Editor open state. |
GetActiveConfig() | table | Copy of the active crosshair config. |
GetRenderedConfig() | table | Copy of the config currently rendered. |
IsCrosshairVisible() | boolean | Whether the crosshair is visible. |
GetWeaponCategory() | string | Current weapon category. |
SetActiveConfig(config) | true | Sanitizes and equips a crosshair, and saves it to the server. |
SetEnabled(enabled) | boolean | Turns the crosshair on or off (anything except false is on) and saves the setting. |
TriggerHit() | boolean | Triggers hit feedback for custom damage systems. Returns false if Config.EnableDamageFeedback is off or the call is throttled (40 ms). |
Events
Client events registered by the resource:
| Event | What it does |
|---|---|
manniche_crosshair:sync | Server to client. Payload may contain profiles, weaponMap, settings, favorites, active. |
manniche_crosshair:presets | Server to client. Replaces the preset list. |
manniche_crosshair:response | Internal reply to editor requests. |
The server event manniche_crosshair:request is internal. It allows 40 requests per 10 seconds per player and rejects large payloads. Use the exports instead.