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

http://forum.facepunch.com/showthread.php?t=1299097

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
    end
end)

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
	end
end
 
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

-snip-