Advertisement
Guest User

Untitled

a guest
Sep 29th, 2015
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.61 KB | None | 0 0
  1. PropMingeConfig = {} -- DO NOT EDIT
  2.  
  3. PropMingeConfig.IgnoreGroups = { -- Groups listed here will be exempt from the anti propminge
  4.     "admin",
  5.     "superadmin"
  6. }
  7.  
  8. PropMingeConfig.IgnoreSteamIDs = { -- Same as IgnoreGroups, but for SteamIDs
  9.     "STEAM_0:0:11",
  10.     "STEAM_0:0:00"
  11. }
  12.  
  13. PropMingeConfig.NoCollideEntities = { -- The entities you want the effect to be applied to
  14.     "prop_physics",
  15.     "gmod_cameraprop",
  16.     "Keypad",
  17.     "gmod_button"
  18. }
  19.  
  20. PropMingeConfig.EnableAutoNocollide = true      -- Enable the automatic nocollide when physgunning a prop?
  21. PropMingeConfig.StopPropDamage = true           -- Stop props from hurting people?
  22. PropMingeConfig.StopVehicleDamage = true        -- Stop vehicles from hurting people?
  23.  
  24. function AutoNoCollide( ply, ent )
  25.         if (PropMingeConfig.EnableAutoNocollide) then
  26.             if (PropMingeConfig.IgnoreSteamIDs) and (!table.HasValue(PropMingeConfig.IgnoreSteamIDs, ply:SteamID())) then
  27. --              if ent:GetClass() == "prop_physics" or ent:GetClass() == "gmod_cameraprop" or ent:GetClass() == "Keypad" or ent:GetClass() == "gmod_button" then
  28.                 if (table.HasValue(PropMingeConfig.NoCollideEntities, ent:GetClass())) then
  29.                     ent:SetCollisionGroup(COLLISION_GROUP_WORLD)
  30.             elseif (PropMingeConfig.IgnoreGroups) and (!table.HasValue(PropMingeConfig.IgnoreGroups, ply:GetUserGroup())) then
  31. --              if ent:GetClass() == "prop_physics" or ent:GetClass() == "gmod_cameraprop" or ent:GetClass() == "Keypad" or ent:GetClass() == "gmod_button" then
  32.                 if (table.HasValue(PropMingeConfig.NoCollideEntities, ent:GetClass())) then
  33.                     ent:SetCollisionGroup(COLLISION_GROUP_WORLD)
  34.                 end
  35.             end
  36.         end
  37.     end
  38. end
  39. hook.Add( "PhysgunPickup", "Auto Nocollide", AutoNoCollide )
  40.  
  41. function AutoUnNoCollide( ply, ent )
  42.     local phys = ent:GetPhysicsObject()
  43.         if (PropMingeConfig.EnableAutoNocollide) then
  44.             if (table.HasValue(PropMingeConfig.NoCollideEntities, ent:GetClass())) then
  45.                 phys:SetVelocity(Vector(0,0,0))
  46.                 ent:SetCollisionGroup(COLLISION_GROUP_NONE)
  47.         end
  48.     end
  49. end
  50. hook.Add( "PhysgunDrop", "Auto UnNocollide", AutoUnNoCollide )
  51.  
  52. function AntiDmg( ent, dmginfo )
  53.         if (PropMingeConfig.StopPropDamage) then
  54.             if ent:IsPlayer() and dmginfo:GetDamageType() == DMG_CRUSH then
  55.                 dmginfo:SetDamage(0)
  56.                 dmginfo:ScaleDamage(0)
  57.                 dmginfo:SetDamageForce(Vector(0,0,0))
  58.                 return dmginfo,true
  59.             end
  60.         if (PropMingeConfig.StopVehicleDamage) then
  61.             if ent:IsPlayer() and dmginfo:GetDamageType() == DMG_VEHICLE then
  62.                 dmginfo:SetDamage(0)
  63.                 dmginfo:ScaleDamage(0)
  64.                 dmginfo:SetDamageForce(Vector(0,0,0))
  65.             end
  66.         end
  67.     end
  68. end
  69. hook.Add( "EntityTakeDamage", "AntiDmg", AntiDmg )
  70.  
  71. function AntiWeldStuck( ent
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement