View Single Post
scorpius2k1
Senior Member
Join Date: Feb 2016
Old 04-25-2019 , 21:34   Re: Teleporting Player Check "Non-Stuck"
Reply With Quote #5

Quote:
Originally Posted by MasterMind420 View Post
Simple solution...just gotta check if the player is moving or not...by checking there velocity i believe. and check the keys there pressing at the time. if they are pressing the key to move but not then they are stuck if u need help just pm me. but thats what i do to figure out who's stuck. Unless u absolutely need to specifically check if there stuck in specific things...like walls ceilings or floors...this is the way to go.
Thanks for the replies everyone! This is a slightly different scenario than just a player being stuck on spawn or on another player. I don't need to worry about player movement, but only need to do a problematic check on a previously defined coordinate IF we teleported the player to that particular coordinate. We don't want the players bounding box to clip anything after fixing.

Let's say we have an X,Y,Z coordinate of 100,200,300 and if I were to move the player there with "TeleportEntity", they would be stuck in the ceiling (left pic below). Essentially what I am aiming to do is check, and if need be, fix up those coordinates so the player would not be stuck when I moved them (right pic below). The FIXED coordinates would be something like 100,200,228 (notice the Z axis was changed to compensate for the players height of 72 units). Again this checkpoint should work regardless if it is a wall/floor/ceiling/object unless it is impossible which at that point the check would return a -1 or something.

Here is a good visual (notice the bounding box of the player not being clipped in the right side pic after fix):



The plugin link Franc1sco shared seemed to be close, except it didn't work 100% of the time. I would still be left stuck sometimes, especially in ceilings for some reason. It was pretty close to what I'm after because it seemed to check in a radius around the player and act accordingly.

Again, I am sure this can somehow be done with TR_TraceRayFilter to check X,Y,Z with the player bounding box dimensions in mind (32,32,72), just how to go about it is what I am stuck on.

Thanks again all!!
__________________
{__ PIRATES COVE __} ● HIGH-KILL Community | Stats ●
Half-Life 2: Deathmatch
66.151.244.149:27016 => CONNECT

Last edited by scorpius2k1; 04-25-2019 at 21:52.
scorpius2k1 is offline