RoxiCrosshairs Configuration
The config is split the same way as the resource: shared behavior in config/config.lua, and server-controlled presets/database ownership in config/servercfg.lua.
Server config
config/servercfg.lua controls table names, how private crosshairs are owned, and which presets appear in the editor.
ServerConfig.Database = {
Crosshairs = 'roxi_crosshairs',
Favorites = 'roxi_crosshair_favorites',
Preferences = 'roxi_crosshair_preferences'
}
ServerConfig.MyCrosshairsOwner = 'citizenid'
Use license if one player should see the same private crosshairs on every character. Use citizenid if each QBCore/Qbox character should have its own private list and active crosshair.
If citizenid is enabled on a server that does not provide citizen IDs, RoxiCrosshairs falls back to the player's license so the resource still works.
Shared config
config/config.lua controls the public command, locale, display rules, save limits, community settings, and the default editor config.
Config.Locale = 'en'
Config.Commands = {
Menu = 'crosshairs'
}
Config.Theme = {
MainAccent = '#8B5CF6',
SecondAccent = '#A855F7'
}
Config.Limits = {
MaxSaved = 20,
MaxPublic = 5,
LabelMax = 32,
ConfigMaxBytes = 4096
}
Config.Community = {
Enabled = true,
Favorites = true
}
Config.Theme controls the editor, marketplace, cards, buttons, sliders, and other NUI accents. It stays in shared config because it is visual behavior, not a secret.
Config.Theme = {
MainAccent = '#EF4444',
SecondAccent = '#F97316'
}
Display rules example
Config.Display = {
EnabledByDefault = true,
HideWhenUnarmed = true,
HideWhenPaused = true,
HideWhenDead = true,
HideInVehicle = false,
HideWithScopedWeapons = true,
HideNativeReticle = true,
ActiveInterval = 75,
IdleInterval = 300
}
Recommended limits
- Keep saved crosshair limits reasonable to prevent database clutter.
- Limit public crosshairs per player if community sharing is enabled.
- Use short label lengths so cards stay clean.
Preset example
ServerConfig.Presets = {
{
id = 'classic',
label = 'Classic',
config = {
dot = { enabled = true, size = 3, color = '#FFFFFF', opacity = 1.0 },
lines = { enabled = true, length = 8, thickness = 2, gap = 4, color = '#FFFFFF', opacity = 1.0 },
circle = { enabled = false, radius = 16, thickness = 1.5, color = '#FFFFFF', opacity = 0.8 },
outline = { enabled = true, thickness = 1, color = '#000000', opacity = 0.55 },
effects = { scale = 1.0, rotation = 0, gapOnFire = 0, animation = 'none' }
}
}
}
Keep preset names short and distinct. A few useful presets are better than many small variations that players cannot tell apart.
Display rules
Use display rules to decide when the crosshair appears. The resource should avoid showing the overlay on top of NUI menus and should only show during valid gameplay states.
