3bd8365ca5
+ Updated to latest server artifacts + Updated vMenu to the latest v3.6 + Replaced Discord Weapon restrictions with a better fork of the repository. + Restructured the server config, and updated the dlc build to the latest San Andreas Mercenaries dlc. + Attempted to fix missing radios in the wheel.
53 lines
1.6 KiB
Lua
53 lines
1.6 KiB
Lua
--------------------------
|
|
--- DiscordWeaponPerms ---
|
|
--------------------------
|
|
roleList = {
|
|
"Civilian I", -- Civilian I (1)
|
|
"Civilian II", -- Civilian II (2)
|
|
"Civilian III", -- Civilian III (3)
|
|
"Civilian IV", -- Civilian IV (4)
|
|
"Civilian V", -- Civilian V (5)
|
|
"EG | Helper", -- Mod (6)
|
|
"EG | Staff", -- Admin (7)
|
|
"EG | Sr. Staff", -- Management (8)
|
|
"EG | Moderator", -- Owner (9)
|
|
"EG | Sr. Moderator", -- Owner (10)
|
|
"EG | Admin", -- Owner (11)
|
|
"EG | Sr. Admin", -- Owner (12)
|
|
"EG | Head of Staff", -- Owner (13)
|
|
"EG | Server Developer", -- Owner (14)
|
|
"EG | Owner", -- Owner (15)
|
|
}
|
|
|
|
|
|
RegisterNetEvent('Print:PrintDebug')
|
|
AddEventHandler('Print:PrintDebug', function(msg)
|
|
print(msg)
|
|
TriggerClientEvent('chatMessage', -1, "^7[^1Badger's Scripts^7] ^1DEBUG ^7" .. msg)
|
|
end)
|
|
|
|
RegisterNetEvent("DiscordWeaponPerms:CheckPerms")
|
|
AddEventHandler("DiscordWeaponPerms:CheckPerms", function()
|
|
local src = source
|
|
for k, v in ipairs(GetPlayerIdentifiers(src)) do
|
|
if string.sub(v, 1, string.len("discord:")) == "discord:" then
|
|
identifierDiscord = v
|
|
end
|
|
end
|
|
local hasPerms = {} -- Has perms for indexes:
|
|
if identifierDiscord then
|
|
local roleIDs = exports.Badger_Discord_API:GetDiscordRoles(src)
|
|
if not (roleIDs == false) then
|
|
for i = 1, #roleList do
|
|
for j = 1, #roleIDs do
|
|
if exports.Badger_Discord_API:CheckEqual(roleList[i], roleIDs[j]) then
|
|
table.insert(hasPerms, i)
|
|
end
|
|
end
|
|
end
|
|
else
|
|
print(GetPlayerName(src) .. " has not gotten their permissions cause roleIDs == false")
|
|
end
|
|
end
|
|
TriggerClientEvent('DiscordWeaponPerms:CheckPerms:Return', src, hasPerms)
|
|
end) |