PivityGmodStore

Restrict to usergroups

You can easily restrict keys, dongles or skins to certain usergroups.

You simply need to add a Usergroups table, similar to other addons config.

Usergroups = {
["superadmin"] = true,
["admin"] = true,
["vip"] = true,
},

You can add as many usergroups you want. Any group NOT in this list, will NOT be able to buy it.

Here is the full example of a restricted key:

CH_Keys.Keys["door_key_3"] = {
Name = "Double-bit Door Key",
Price = 1000,
ViewModel = "models/craphead_scripts/adv_keys_2/c_key3.mdl",
WorldModel = "models/craphead_scripts/adv_keys_2/w_key3.mdl",
Type = "DoorKey",
DoorOnly = true,
Animations = {
Lock = ACT_VM_PRIMARYATTACK,
Unlock = ACT_VM_SECONDARYATTACK,
},
Sounds = {
DoorLock = "doors/door_latch1.wav",
DoorUnlock = "doors/door_latch3.wav",
CarLock = "doors/door_latch1.wav",
CarUnlock = "doors/door_latch3.wav",
},
Usergroups = {
["superadmin"] = true,
},
}

It's the same practice for dongles and skins.

Can't find what you're looking for?

Contact support