GhiaccioScripts

Radio

Configuration

config.lua and config_server.lua, signal, job channels, death detection, branding and animation presets.

config.lua is replicated to clients (no secrets). config_server.lua is server only.

#config.lua

KeyDefaultWhat it does
Config.Locale'it'Default language, 'it' or 'en'. Players can change it in the radio settings.
Config.Framework'auto''auto' (Qbox, QBCore, ESX, standalone) or forced: 'esx', 'qbcore', 'qbox', 'standalone'.
Config.Voice'pma-voice'Voice adapter (adapters/voice/). Only 'pma-voice' is bundled.
Config.MuteNativeClickstrueMutes the pma-voice microphone clicks.
Config.DebugfalsePrints the animation state in the F8 console.
Config.Frequencymin = 1.00, max = 999.99, decimals = 2Range of typable frequencies and decimals (0..3).
Config.RequireItemtrueThe player needs the item to open the radio and stay connected.
Config.Item'radio'Item name.
Config.Inventory'auto''auto', 'ox', 'qb', 'qs', 'esx', 'none'.
Config.UsableItemtrueUsing the item opens the radio.
Config.Commandsopen = 'radio', openKey = 'F5', anim = 'radioanim', animKey = 'F4''' = no command / no default key.
Config.Featuresall truememberList, clickSounds, favorites, signal, volume, scale, animations, jobChannels. false disables it for everybody.
Config.HideMembersPublicfalseHides the member list on public (non-job) channels in the NUI.
Config.Favorites.slots8Number of memory slots.
Config.Volume.default60Initial volume (0..100).

#UI and push-to-talk

KeyDefaultWhat it does
Config.UI.keepInputWhileOpentrueThe game keeps the keyboard while the UI is open: PTT and talk animation work with the UI open.
Config.UI.txIndicatortrueSmall TX mark while transmitting with the UI closed.
Config.UI.blockMovementfalsetrue = no walking while the UI is open.
Config.Ptt.cooldown750Anti-spam in ms between transmissions. 0 = off.
Config.Ptt.notifyBusyfalseShows a small "radio busy" notification when a press is refused.

#Branding

KeyDefaultWhat it does
Config.Branding.showLogotruefalse hides the logo engraved on the body.
Config.Branding.logo'logo.svg'A file in web/dist, a nui:// path or an https URL.
Config.Branding.logoTinttruetrue = monochrome engraved look, false = original colors.
Config.Branding.text'GHIACCIO'Brand text ('' = hidden).
Config.Branding.model'GX-9'Model label ('' = hidden).

#Signal

KeyDefaultWhat it does
Config.Signal.interval700Ms between two evaluations.
Config.Signal.staticBelow2Bars below this: static and warning.
Config.Signal.minTransmit1Bars needed to transmit.
Config.Signal.blockTransmittruefalse = low signal only shows the warning.
Config.Signal.interiorPenalty0.35Subtracted from the signal ratio inside an interior.
Config.Signal.undergroundPenalty / undergroundZ0.5 / -5.0Penalty below that Z.
Config.Signal.towers6 examples{ name, coords, radius }: 1.0 at the tower, 0 at radius meters. Replace them with yours.
Config.Signal.deadZonesempty{ name, coords, radius, penalty } (1.0 = no signal).

#Emergency (SOS) and callsign

KeyDefaultWhat it does
Config.Emergency.enabledtruefalse hides the button and the server refuses it.
Config.Emergency.cooldown60Seconds between two SOS of the same player.
Config.Emergency.jobChannelsOnlytrueOnly on a job channel; false = any frequency.
Config.Emergency.alertOnDutyJobfalseAlso alerts every on-duty player with the sender's job.
Config.Emergency.blip / sound / logsee fileBlip (sprite, colour, scale, seconds, flash, route), PlaySoundFrontend sound, server log.
Config.Callsign.enabledtrueEnables callsigns.
Config.Callsign.maxLength81..16.
Config.Callsign.pattern'^[%w%-]+$'Lua pattern the callsign must match.
Config.Callsign.uppercasetrueStored in upper case.
Config.Callsign.display'both'Member list: 'callsign', 'name' or 'both'.

#Death detection

KeyDefaultWhat it does
Config.Death.mode'auto''auto', 'export', 'event', 'statebag', 'native'. See Commands, exports & events.
Config.Death.export{ resource = '', name = '' }For mode 'export'.
Config.Death.events{ death = {}, revive = {} }Client events for mode 'event'.
Config.Death.statebag{ 'isDead', 'dead' }LocalPlayer.state keys.
Config.Death.blockWhenCuffedtrueA cuffed player cannot transmit either.
Config.Death.cuffedStatebag{ 'isHandcuffed', 'handcuffed', 'cuffed' }State bag keys for cuffed.

#Radio prop and animations

KeyDefaultWhat it does
Config.PropModel'ghiaccio_radio_b'Radio in hand (from ghiaccio_radio_props). Alternative: 'ghiaccio_radio_a'.
Config.PropFallbackModel'prop_cs_hand_radio'Used, with a console warning, when the model is not found.
Config.PropModelOffsetsper modelCorrection (pos, rot) on top of the preset offset.
Config.Prop.enabled / networked / whileUItrueProp in hand / visible to others / held while the window is open.
Config.Anim.enabledtrueRadio animations.
Config.Anim.inVehicletruefalse = never animate in vehicles.
Config.Anim.blockFiring / blockJumptrue / falseNo shooting or melee / no jumping while transmitting.
Config.Anim.withWeapontrueTalk animation also with a weapon (right-hand presets fall back to default).
Config.Anim.whileAimingtrueTalk animation also while aiming.
Config.Anim.previewOnSelect / previewMsfalse / 2500Preview when confirmed with "Use".
Config.Anim.default'default'Preset used when the player never chose.
Config.HoldAnimenabled"Radio in hand" idle animation while the UI is open.

Config.AnimPresets lists the presets players pick in /radioanim (Default, Default fast, Shoulder slow, Shoulder fast, Police, Ear 1 to 3). They are validated at start: an invalid one is skipped with a warning. Add one like this:

lua
{ id = 'my_anim', label = 'preset.my_anim', dict = 'random@arrests', anim = 'generic_radio_chatter',
  flag = 50, blendIn = 8.0, blendOut = 2.5, vehicle = true,
  prop = { bone = 60309, pos = { 0.06, 0.05, 0.04 }, rot = { -90.0, 30.0, 0.0 } } }

flag adds up: 1 loop, 2 stay on last frame, 16 upper body only, 32 controllable (50 = 2+16+32). id is unique and never changes once live; label is a preset.<id> locale key or plain text (max 32).

#config_server.lua

KeyDefaultWhat it does
Config.Database'auto''auto' (oxmysql if started, otherwise KVP), true (oxmysql only), false (KVP only).
Config.ChannelOffset0Offset added to the pma-voice channel (channel = frequency * 10^decimals + offset). Raise it if other scripts use small numeric channels.
Config.JobChannelsemptyPrivate job channels (see Commands, exports & events).
Config.JobRequireOnDutyfalseQBCore/Qbox: must be on duty (per channel with onDuty).
Config.JobRecheckSeconds30Periodic re-read of job and grade.
Config.MaxChannelsPerRule5000Safety limit of channels for one range rule.
Config.ItemCheckSeconds5How often the server checks the item.
Config.Memberssee belowshowOnPublic (true), nameSource ('rp' / 'steam' / 'id'), showCallsign (true), max (64).
Config.RateLimitper request{ window = seconds, max = events } per request type.
Config.LogRejectedtrueLogs rejected requests.

Copy your PNG/SVG (square, transparent background) into web/dist/ (or web/public/ before npm run build) and set Config.Branding.logo = 'mine.png'.

#Other voice systems

The logic goes through adapters/voice/pmavoice.lua (client) and adapters/voice/pmavoice_server.lua (server). Implement the same functions (documented at the top of the files) and change Config.Voice to support another system.