Superadmins and higher picking up Vehicles

I need to figure out how to make it so my superadmins and higher can pick up vehicles for darkrp. Here are the ulx ranks!

Mod, Mod+, Admin, Admin+ superadmin, headadmin, globaladmin, owner

The thing is with that, does it make it so everything and higher can or only superadmins?

Use Falco’s Prop Protection, It’s pretty self explanatory

No, you can’t.

hook.Add("PhysgunPickup", "SuperAdminVehicle", function(ply, ent)
	if (ent:IsVehicle() and !ply:IsSuperAdmin()) then
           return false

This makes it so only superadmins can pick up the vehicle

Superadmin IS the highest possible rank.

local function PhysgunPickup(ply, ent)
	--If the player is an admin, and the entity is a door or a player,
	if ply:IsAdmin() and (ent:GetClass():lower() == "prop_vehicle_jeep") then
		return true -- Deny pickup
hook.Add("PhysgunPickup", "Physgun.DenyShit", PhysgunPickup)

put this into lua/autorun and then it should work

This will only work for Jeeps though… dence47’s code should work fine.

Ok, Thanks! Will try