Badger Docs
  • Welcome to Badger Docs
  • Badger's Website
  • Badger's Discord
  • 20% off hosting | Use Code: TheWolfBadger-4765
  • Fivem General Help
    • Updating Server Binaries
    • ACE Permissions
    • Getting Discord Role IDs
    • Setting up a Discord Webhook
    • Discord identifier not found
    • How to set up a Git Repository for my server
  • Fivem Discord Scripts
    • Introduction
    • BadgerTools
    • DiscordChatRoles
    • DiscordAcePerms
    • DiscordPedPerms
    • DiscordWeaponPerms
    • DiscordVehiclesRestrict
    • DiscordTagIDs
    • PoliceEMSActivity
    • BadgerCopChat
    • DiscordDonatorPerks
    • Badger-911
    • Bad-Scoreboard
    • Bad-DiscordQueue
    • Badger_Discord_API
      • Installation
      • GetRoleIdFromRoleName
      • CheckEqual
      • IsDiscordEmailVerified
      • GetDiscordEmail
      • GetDiscordName
      • GetDiscordAvatar
      • GetDiscordNickname
      • GetDiscordRoles
      • GetGuildIcon
      • GetGuildSplash
      • GetGuildName
      • GetGuildDescription
      • GetGuildMemberCount
      • GetGuildOnlineMemberCount
      • GetGuildRoleList
    • DiscordVehicleRestrictions
  • Fivem Misc. Scripts
    • Introduction
    • BadgerAnims
    • BadgerBankRobbery
    • VehicleTrustSystem
    • PedTrustSystem
    • BadgerVoting
    • BadgerTracer
    • Fivem Keybase Anticheat
    • DiscordReports
    • Badger-Priorities
    • Badssentials
    • BadgerStockMarket
    • Badger-Anticheat
    • Badger_Jailing
    • BadgerFires
    • Multiverse-World-Manager
  • Badger Software
    • Introduction
    • FivemDiscordPerms
    • BadgerTrustSystem+
    • BadgerStaffPanel
    • ResourceEventScrambler
    • CollectiveBot
  • Archived Projects
  • SimpleRoleBot
  • EssentialBot
Powered by GitBook
On this page
  • Badger's Discord Community
  • What is it?
  • Images
  • Requirement
  • Configuration
  • Download

Was this helpful?

  1. Fivem Discord Scripts

DiscordVehicleRestrictions

PreviousGetGuildRoleListNextIntroduction

Last updated 4 years ago

Was this helpful?

Badger's Discord Community

What is it?

DiscordVehiclesRestrictions is a Discord based vehicle restriction script. I have previously made a script like this in the past, but it was made when I was barely considered a FiveM script developer. Due to the sloppy code practices within that script, I decided to rewrite the script and include something at most people had inquired about within the old one: Inheritance.

Old Script:

Images

Requirement

Configuration

  • It should be noted that for Config.Inheritances, the roleNames and roleIDs should match up with the ones specified in Config.VehicleRestrictions.

  • Also, inheritance only inherits the role groups listed. Inheriting RoleName2 which inherits RoleName1 would not be inherited for RoleName3.

    ```lua Config = { RestrictedMessage = "~r~Restricted Vehicle Model.", InheritanceEnabled = false }

Config.VehicleRestrictions = { ['RoleName1 or ID'] = { "baller", "baller2", "baller3", "baller4" }, ['RoleName2 or ID2'] = {}, ['RoleName3 or ID3'] = {}, ['RoleName4 or ID4'] = {} }

-- Requires Config.InheritanceEnabled to be = true Config.Inheritances = { ['RoleName2 or ID'] = {'RoleName1', 'RoleName3', 'RoleName4'}, ['RoleName3'] = {'RoleName2'}, }

## Example Configuration
```lua
Config = {
    RestrictedMessage = "~r~Restricted Vehicle Model.",
    InheritanceEnabled = true
}

Config.VehicleRestrictions = {
    ['Head_Admin'] = {
        "baller",
        "baller2",
        "baller3",
        "baller4",
    },
    ['Admin'] = {
        "dcd",
        "chr20",
    },
    ['Moderator'] = {
        "nf6",
        "foxsnt",
        "foxshelby",
        "gt63s",
        "fhauler",
        "rescue1",
        "um1",
        "um2",
        "um3",
        "um4",
        "um5",
        "um6",
        "um6",
        "riot",
    },
}

-- Requires Config.InheritanceEnabled to be = true
Config.Inheritances = {
    ['Head_Admin'] = {'Admin', 'Moderator'},
}

Thanks to @clewis329 for helping to test this, a well as providing the example configuration file :)

Download

Developer Discord
LogoDiscordVehiclesRestrictCfx.re Community
Logo[RELEASE] Badger_Discord_APICfx.re Community
LogoGitHub - JaredScar/DiscordVehicleRestrictions: A FiveM Script [lol, do these get old as the default description?]GitHub