C0nw0nk / Garrys-Mod-Anti-Cheat

Putting Anti back into Anti Cheat by blocking players cheating instead of just detecting what they do. Anti Bhop bunny hopping gmod lua garrysmod
http://www.networkflare.com/
13 stars 10 forks source link

Add Anti-Propclimb? #1

Open BlueMustache opened 8 years ago

BlueMustache commented 8 years ago

I thought your Anti-BHop script was great. I know for a matter of fact that you can prop-climb in GMOD. I know because I do it. That being said, I was wondering if you would make a script to stop this! Thanks! Keep up the good work.

C0nw0nk commented 8 years ago

What method of prop climbing and game mode. Just Sandbox ?

BlueMustache commented 8 years ago

General prop-climbing. Simply crouching on a prop, and alternating use and jumping. It works in all gamemodes. A simple fix would be to slow the rate at which people can pick up props. Synergy fixed prop-climbing and BHopping. Here is a proof video. I am not great at prop climbing, but you can see that it works. https://youtu.be/Gq2Pdiik-JA

C0nw0nk commented 8 years ago

Sandbox, A few ways to stop it prevent the player spamming their use key or like when i played HL2DM puzzle maps spamming retract and then dropping the prop with the gravity gun to pull the prop inside of yourself or fix props collision with players by a "GetPhysicsObject():IsPenetrating()" check.

C0nw0nk commented 8 years ago

I wrote this up quickly no idea if it will work you will have to test and find out but i based it of my solution for a problem within the ZS game mode. What i based my code of.

Because of the way prop climbing works in sandbox you need to pull the prop inside of your model what sets PhysicsObject():IsPenetrating() to true. So if your models are stuck inside of eachother you will no longer have collision preventing you from being pushed up in the air.

Alternative to the code i provided would be to change the SetCollisionGroup on prop_physics to something else. View : https://wiki.garrysmod.com/page/Enums/COLLISION there are many alternatives depends what way people prefer it working.

Create a file: garrysmod/lua/autorun/server/propclimb.lua

hook.Add("ShouldCollide", "Player.Stuck", function(entity1, entity2)
--Check our entites are valid.
if entity1:IsValid() and entity2:IsValid() then
--Check if either entity is a player.
if entity1:IsPlayer() or entity2:IsPlayer() then
--Check if either entity is a prop.
if string.match(entity1:GetClass(), "prop_physics*") or string.match(entity2:GetClass(), "prop_physics*") then
--If their model's are penetrating each other.
if entity1:GetPhysicsObject():IsPenetrating() != false or entity2:GetPhysicsObject():IsPenetrating() != false then
--Make the player have no collision with what they are stuck in.
return false
end --End if penetrating check.
end --End if entity is a prop check.
end --End if entity is a player check.
end --End if entity is valid check.
end) --End hook function.
C0nw0nk commented 7 years ago

If you or anyone else replies to this and find my solution above fixed the problem I will close this as a feature request and push the code to the main repo as a new feature.

BlueMustache commented 7 years ago

I am on vacation. I don't have my PC. I'll let you know soon if it works.

pparadoxx commented 3 years ago

my eyes. i need bleach, anyway it wouldn't work first of all it would make the entity invisible, secondly it would be possible to bypass by using a hook.Remove, and thirdly crouching disables it...

im a bit late as well