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.

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 true if LetPlayersSetTheirOwnNameInRadio is enabled in DefaultsAndOtherSettings.

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 ID

  • currentChannel – Current radio frequency

  • newName – Desired new channel name

Returns: true / false


Notes
  • Client-side functions control animations and UI interactions.

  • Server-side functions ensure job or configuration-based restrictions for renaming channels and changing player names.

  • Developers can expand job checks or channel protection logic inside canChangeChannelName.

Last updated

Was this helpful?