qbcore-framework / qb-radio

Radio Script With UI
GNU General Public License v3.0
22 stars 122 forks source link

feat(config): make single channels restricted by jobs #4

Closed Doxylamin closed 2 years ago

Doxylamin commented 3 years ago

If applied, this PR changes the channel restrictions. New restrictions can be created and applied to multiple jobs.

Config.RestrictedChannels = {
  --
  -- Syntax Reference
  --
  [targetChannel] = {
    playerJob = true,
    playerJob = true,
  },

  --
  -- Examples
  --

  -- Make a channel accessible only for police
  [482] = { -- channel 482
    police = true
  },
  -- Make a channel accessible for police and ambulance
  [456] = {
    police = true,
    ambulance = true
  }
}
apfrmeast commented 3 years ago

I was going to fork to fix the fact that the ems is classed wrong in the if for restricted channels but this is a much better and modular solution.