A codeplug is the configuration object that defines a single radio — its identity, the zones and channels it has access to, its scan lists, its encryption key data, and a long list of behavioural toggles. The term is borrowed from real-world land mobile radios, where the "codeplug" is the file a technician programs into a radio.
In SCNP25 every radio loads exactly one codeplug at a time. Each codeplug belongs to an agency, identified by a short string ID — conventionally the lower-case in-game department name (e.g. lspd for Los Santos Police Department, bcso for Blaine County Sheriff's Office). Switching the agency is what swaps the codeplug.
There is one reserved agency: default. The default codeplug is loaded automatically when the script starts and provides a basic out-of-the-box radio configuration for users who don't want to wire up agency-switching at all.
| Field | Purpose |
|---|---|
codeplugID |
A short label the radio briefly shows when the codeplug loads. |
subscriberID |
The radio's Subscriber ID, constructed from the prefix plus the user's local ID. |
subscriberPrefix |
The numeric prefix added to every local ID under this codeplug. |
keyData |
The encryption key material applied on secure channels. See Encryption / Key Data. |
zones |
Ordered list of zones, each containing channels. |
scanLists |
Ordered list of scan lists. |
radioModels |
Which radio model is shown for handheld vs ground / air / boat vehicles. |
vehicleTypes |
Vehicle classes that should auto-select the vehicle radio model. |
buttonActions |
Default actions bound to the radio's programmable buttons. |
shortTextModels |
Models that use the radio's short-text display layout. |
shortZnLength |
How many characters of the zone short name to render on short-text models. |
ackEmg |
Whether the radio waits for an emergency-ack from the control channel. |
endOfTxTone |
Whether to play an end-of-transmission tone after PTT releases. |
allowQuickKeyOverride |
Whether user code may override the quick-key mapping. |
sendGPSCoords |
Whether the radio responds to GPS location queries. |
cpVersion |
Codeplug schema version. |
runtimeMetadata |
Per-radio runtime state (current zone/channel, button state) that persists across reloads. |
A codeplug is fetched from the server when the radio sets its agency:
setAgency(agencyID) (or fires radioExternal:setCodeplug).radioLink:getCodeplug with the agency ID.subscriberID = subscriberPrefix + localID, and fires radioExternal:CodeplugChange.If the server returns no codeplug for the requested agency, the radio powers down and shows "Agency not found!". The default agency is silent on a miss, since it's loaded automatically at script start.
User code can re-trigger a codeplug load at any time by firing the setCodeplug event. The most common reason is changing the user's agency assignment.
Lua
TriggerEvent("radioExternal:setCodeplug", "lspd")
C#
BaseScript.TriggerEvent("radioExternal:setCodeplug", "lspd");
A permissions handler may be registered to gate codeplug changes — see the setCodeplug page. The default agency bypasses the permissions handler so a script can always reset back to it.