devConfig.lua
This developer configuration file handles client-side animations, UI behavior, and server-side checks for radio interactions.
Client-Side Functions
Radio Animations
cs_radio.useRadioAnimation(talkingState)Handles radio animations when a player is talking.
talkingState: true / false– Whether the player is currently talking on the radio.
Behavior:
Starts or stops animations (
generic_radio_enter/radio_chatter) based on talking state.Disables player actions while animation is playing.
Ensures animations load correctly before playing.
Variables:
isRadioAnimPlaying– Tracks if a radio animation is currently active.currentAnimDict/currentAnimName– Stores the current animation dictionary and name.
Menu Access Check
cs_radio.canOpenMenu()Determines whether a player can open the radio menu.
Checks if a specific item is required (configured in
Config.lua).Sends a notification if the player does not have the required item.
Show / Hide UI
cs_radio.showUI() -- Shows the radio menu (Client-sided)
cs_radio.hideUI() -- Hides the radio menu (Client-sided)Placeholders for managing the in-game radio UI display.
Server-Side Functions
Can Player Change Own Name
cs_radio.canPlayerChangeOwnName(src, newName)Checks if a player is allowed to change their own display name on the radio.
Returns
trueifLetPlayersSetTheirOwnNameInRadiois enabled inDefaultsAndOtherSettings.
Can Change Channel Name
cs_radio.canChangeChannelName(src, currentChannel, newName)Checks if a player is allowed to rename a radio channel.
Behavior:
Example ESX job check commented out (can be enabled for specific jobs/grades).
Checks if channel is protected and if players are allowed to override names.
Sends a notification if renaming is not allowed.
Parameters:
src– Player server IDcurrentChannel– Current radio frequencynewName– Desired new channel name
Returns: true / false
Last updated
Was this helpful?