Badger Docs
Search…
DiscordVehicleRestrictions

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:

DiscordVehiclesRestrict
Cfx.re Community

Images

Requirement

[RELEASE] Badger_Discord_API
Cfx.re Community

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'}, }
1
## Example Configuration
2
```lua
3
Config = {
4
RestrictedMessage = "~r~Restricted Vehicle Model.",
5
InheritanceEnabled = true
6
}
7
8
Config.VehicleRestrictions = {
9
['Head_Admin'] = {
10
"baller",
11
"baller2",
12
"baller3",
13
"baller4",
14
},
15
['Admin'] = {
16
"dcd",
17
"chr20",
18
},
19
['Moderator'] = {
20
"nf6",
21
"foxsnt",
22
"foxshelby",
23
"gt63s",
24
"fhauler",
25
"rescue1",
26
"um1",
27
"um2",
28
"um3",
29
"um4",
30
"um5",
31
"um6",
32
"um6",
33
"riot",
34
},
35
}
36
37
-- Requires Config.InheritanceEnabled to be = true
38
Config.Inheritances = {
39
['Head_Admin'] = {'Admin', 'Moderator'},
40
}
Copied!
Thanks to @clewis329 for helping to test this, a well as providing the example configuration file :)

Download

GitHub - JaredScar/DiscordVehicleRestrictions: A FiveM Script [lol, do these get old as the default description?]
GitHub
Last modified 1yr ago