Whitelisting entities to SteamID's

So, I run a server which isnt released yet, but I plan to run my VIP system off of SteamID’s, and I was wondering if there was a way to whitelist a SteamID to a entity?

ENT:Initialize

Player:SteamID

That doesn’t really help.

What do you mean whitelist a SteamID to an entity? As in letting only X SteamID’s spawn an entity?

Try this on your SENTs




// Replace YOURWHITELISTTABLE with your actual table containing white listed SteamIDs

function ENT:SpawnFunction( ply, tr, ClassName )

	if ( !tr.Hit ) then return end

	local SpawnPos = tr.HitPos + tr.HitNormal * 16

	local ent = ents.Create( ClassName )

        if table.HasValue(YOURWHITELISTTABLE, ply:SteamID()) then

	    ent:SetPos( SpawnPos )
	    ent:Spawn()
	    ent:Activate()

        else

            ply:ChatPrint("You can't spawn this. VIP only.")

        end

	return ent

end


I bet there could be a better way, but this is what I came up with for now.