Server GM:VC_CD_canUse(Entity NPC, Entity ply)
1. Entity NPC; Car Dealer
The car dealer NPC.
2. Entity ply; Player
Player who is attempting to use it.
1. Boolean If it should allow player use it or not.
// Compatibility with: https://www.gmodstore.com/scripts/view/4270
local allowedsecondarygroups = {
"donator",
"donator+",
}
hook.Add("VC_CD_canUse", "VC_SecondaryRank", function(NPC, ply)
local ID, name, model, data = NPC:VC_CD_getInfo()
local secUserGroup = ply.GetSecondaryUserGroup and ply:GetSecondaryUserGroup()
if name == "VIP Car Dealer" and secUserGroup and !table.HasValue(allowedsecondarygroups, secUserGroup) then
print("Insufficient Group Permissions")
return false
end
end)