Ulysses

Ulysses Stuff => General Chat & Help and Support => Topic started by: Shotz on June 10, 2022, 12:26:05 AM

Title: ULX Group help
Post by: Shotz on June 10, 2022, 12:26:05 AM
So, me and my friend have a store for our GMOD server. We want to make PAC3 buyable but to do that we need to make a group. The issue is, if someone buys a package that doesn't have PAC3 included they will be removed from that group and no longer have PAC3. What can I do? Is there anyway to make them have permanent features after buying?
Title: Re: ULX Group help
Post by: iViscosity on June 10, 2022, 12:52:42 AM
What do you mean you need to make a group for them to use PAC? If you're using something like Pointshop, you shouldn't need to make a new group iirc. If you're using your own custom shop, just use something like CheckGroup (https://ulyssesmod.net/docs/files/lua/ulib/shared/sh_ucl-lua.html#Player:CheckGroup) or IsUserGroup (https://wiki.facepunch.com/gmod/Player:IsUserGroup)
Title: Re: ULX Group help
Post by: Shotz on June 10, 2022, 01:28:04 AM
This is the code I need to use to restrict pac3 to certain groups:
Code: [Select]
-- add/change rank names here in the same format
local ranks = {
["pac3"] = true,
["owner"] = true,
["admins"] = true,
["superadmin"] = true,
}
    CustomCheckFailMsg = "Donators only",
hook.Add("PrePACEditorOpen", "PACRankRestrict", function(ply)
if not ranks[ply:GetUserGroup()] then
              return false,"Insufficient rank to use PAC."
        end
end)

I want to make it so if they buy PAC3 Package they have it permanently so when they buy another package it doesn't get removed.