Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PropMingeConfig = {} -- DO NOT EDIT
- PropMingeConfig.IgnoreGroups = { -- Groups listed here will be exempt from the anti propminge
- "admin",
- "superadmin"
- }
- PropMingeConfig.IgnoreSteamIDs = { -- Same as IgnoreGroups, but for SteamIDs
- "STEAM_0:0:11",
- "STEAM_0:0:00"
- }
- PropMingeConfig.NoCollideEntities = { -- The entities you want the effect to be applied to
- "prop_physics",
- "gmod_cameraprop",
- "Keypad",
- "gmod_button"
- }
- PropMingeConfig.EnableAutoNocollide = true -- Enable the automatic nocollide when physgunning a prop?
- PropMingeConfig.StopPropDamage = true -- Stop props from hurting people?
- PropMingeConfig.StopVehicleDamage = true -- Stop vehicles from hurting people?
- function AutoNoCollide( ply, ent )
- if (PropMingeConfig.EnableAutoNocollide) then
- if (PropMingeConfig.IgnoreSteamIDs) and (!table.HasValue(PropMingeConfig.IgnoreSteamIDs, ply:SteamID())) then
- -- if ent:GetClass() == "prop_physics" or ent:GetClass() == "gmod_cameraprop" or ent:GetClass() == "Keypad" or ent:GetClass() == "gmod_button" then
- if (table.HasValue(PropMingeConfig.NoCollideEntities, ent:GetClass())) then
- ent:SetCollisionGroup(COLLISION_GROUP_WORLD)
- elseif (PropMingeConfig.IgnoreGroups) and (!table.HasValue(PropMingeConfig.IgnoreGroups, ply:GetUserGroup())) then
- -- if ent:GetClass() == "prop_physics" or ent:GetClass() == "gmod_cameraprop" or ent:GetClass() == "Keypad" or ent:GetClass() == "gmod_button" then
- if (table.HasValue(PropMingeConfig.NoCollideEntities, ent:GetClass())) then
- ent:SetCollisionGroup(COLLISION_GROUP_WORLD)
- end
- end
- end
- end
- end
- hook.Add( "PhysgunPickup", "Auto Nocollide", AutoNoCollide )
- function AutoUnNoCollide( ply, ent )
- local phys = ent:GetPhysicsObject()
- if (PropMingeConfig.EnableAutoNocollide) then
- if (table.HasValue(PropMingeConfig.NoCollideEntities, ent:GetClass())) then
- phys:SetVelocity(Vector(0,0,0))
- ent:SetCollisionGroup(COLLISION_GROUP_NONE)
- end
- end
- end
- hook.Add( "PhysgunDrop", "Auto UnNocollide", AutoUnNoCollide )
- function AntiDmg( ent, dmginfo )
- if (PropMingeConfig.StopPropDamage) then
- if ent:IsPlayer() and dmginfo:GetDamageType() == DMG_CRUSH then
- dmginfo:SetDamage(0)
- dmginfo:ScaleDamage(0)
- dmginfo:SetDamageForce(Vector(0,0,0))
- return dmginfo,true
- end
- if (PropMingeConfig.StopVehicleDamage) then
- if ent:IsPlayer() and dmginfo:GetDamageType() == DMG_VEHICLE then
- dmginfo:SetDamage(0)
- dmginfo:ScaleDamage(0)
- dmginfo:SetDamageForce(Vector(0,0,0))
- end
- end
- end
- end
- hook.Add( "EntityTakeDamage", "AntiDmg", AntiDmg )
- function AntiWeldStuck( ent
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement