HUD
Functions

GM: CD can Use

Called when a person attempts to use the car dealer.

Used in: VCMod Main addon.

Server GM:VC_CD_canUse(Entity NPC, Entity ply)

Arguments

1. Entity NPC; Car Dealer
The car dealer NPC.

2. Entity ply; Player
Player who is attempting to use it.

Returns

1. Boolean If it should allow player use it or not.

Example

// 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)
Page modified:
...2018-11-02 09:24:35