Some kind of fix for players getting stuck in each other, or walls.

Hey- this happens all the time on my server and I’m getting sick of it, especially since it usually ends with the players getting stuck dying and it frustrates them. A lot of games these days have a protection for this. I have no idea how it works, though, but I do have some criteria for what I want.

The fix will: seamlessly or not, get a player unstuck automatically, without him having to do anything at all. Hopefully, he will not even notice he was stuck, but if he does get stuck, please fix him in less than a second or around there, because players will either attempt to kill one another or suicide and that ruins their day.

The fix will not:

  1. Shoot a player in a random direction in hopes he gets unstuck.
  2. Kill any player or NPC in hopes this gets the player unstuck.
  3. Hurt a player to “provoke him to get unstuck,” as if predicting he’s exploiting.
  4. Do some silly voodoo magic that lags a ton and ultimately gets nothing done.

Thank you in advance!

And how does one get stuck in the first place?

I should have put that in the first post, shit.

Well, sometimes with the WAC helicopters, any vehicle really, if multiple players get out at the same time (or near the same time), they’ll get stuck inside of each other and will very, very slowly slide out of each other- it usually takes like, ten to fifteen seconds for that to happen, and by that time, they have been killed or have decided to attack each other in hopes that they’ll be forced free of each other (this usually just builds up momentum and the surviving player gets flung into the air or off of a cliff or something).

He can also get stuck in the ceiling or a wall by getting out of a chair that has little room around it… but I never understood why the game just couldn’t find a place for the player to get out to! Maybe it should block him from getting out if he’ll get stuck (IDK how you’d check that though), and print a message on his screen saying “Could not get out of the seat” or something in the middle of the screen (print this in console too so I can tell if it’s screwing something up in the server logs).

RagMod as well. If a player gets up out of that while next to a wall or something, we need to tell him to not get up until we can secure him and move him or he gets stuck in a wall and ends up getting in our way or dying. If an NPC has arrested a player in RagMod he can’t get up or he’ll die 99% of the time, since the NPC will be able to shoot/maim him faster.

Basically, when transitioning to one state or another (ragdolled, in a vehicle, or something? not sure the official term for this stuff), make sure the player’s hull is getting put somewhere that can fit him and that is free of obstacles. That’s what I want the script to do.

Well, http://wiki.garrysmod.com/?title=Entity.IsInWorld should help (It can’t predict it though, the player will have to be stuck first.)

Then, use a little http://wiki.garrysmod.com/?title=Vector magic.

Can’t do much with the collision with the map other than add, like a !stuck command.

You could just nocollide players of the same team.

EDIT: I really should check the wiki BEFORE I post.

Do a box check to see if where ever the vehicle is putting them out to is clear.