have pac3 bans and unbans be automated depending on user group

This commit is contained in:
edshot99 2024-10-12 23:54:06 -05:00
parent bbbaf621ee
commit 083991a803

View File

@ -0,0 +1,26 @@
hook.Add("PlayerInitialSpawn", "edshot_pac3_auto_ban_connect", function(player, transition)
local userGroup = player:GetUserGroup()
if (userGroup == "user_noaccess") then
RunConsoleCommand("pac_ban", player:SteamID())
end
end)
hook.Add("PlayerDisconnected", "edshot_pac3_auto_ban_disconnect", function(player)
local userGroup = player:GetUserGroup()
if (userGroup == "user_noaccess") then
RunConsoleCommand("pac_unban", player:SteamID())
end
end)
hook.Add("ULibUserGroupChange", "edshot_pac3_auto_ban_groupchange", function(id, allows, denies, new_group, old_group)
if (new_group == "user_noaccess") then
RunConsoleCommand("pac_ban", id)
end
if (old_group == "user_noaccess") then
RunConsoleCommand("pac_unban", id)
end
end)