[CSGO] how to warp players without getting stuck in walls?
I have the following code that warps the farthest bot to where I am pointing.
It works perfectly when pointing at the floor but when pointing to a wall or other things it places the bots into them and they get stuck. Is there a way to do the trace to keep them from being placed into things and being stuck? tx PHP Code:
|
Re: [CSGO] how to warp players without getting stuck in walls?
You want to use a trace hull to scan a rectangular prism area for intersecting entitys before teleporting the player.
The trace hull size would be the max size of the player entity. If something is intersecting the end point then you would want to move the endpoint away from the wall/ent you just hit by a fixed value in the inverse direction of the tracerays view angle. Then you run the tracehull scan again until it is cleared or a max threshold of scans are reached. If the area is then clear we would teleport the player entity or else deny it. PHP Code:
|
Re: [CSGO] how to warp players without getting stuck in walls?
Quote:
|
Re: [CSGO] how to warp players without getting stuck in walls?
Quote:
THANK YOU Franc1sco! And also thanks to backwards. Even though you "relied heavly" on Franc1sco' work -you did all of the modifications- to HAND me a WORKING plugin working exactly how I needed it to work. As well as describing exactly how it works... There is major credit in that.... "relying heavly" on others work is how this community thrives... Only thing is giving credit where deserved... I have been here 20 years! (almost) Going for another 20?! I hope alliedmods.net and this great community never goes away. |
Re: [CSGO] how to warp players without getting stuck in walls?
Quote:
I don't know where you got the idea that I used any of his code or references? I wrote all the code myself, starting only from the snippet of code you posted above. This is similar to things I already made in older projects like this: |
Re: [CSGO] how to warp players without getting stuck in walls?
Quote:
Very sorry about that! VERY. You obviously know SM coding forwards and backwards..... My apologies and hopefully I didn't offend you. Many many thanks agian. |
Re: [CSGO] how to warp players without getting stuck in walls?
Mine is a foulproof function that will teleport you across the your angle. Even teleport behind you if needed / if you are staring directly below yourself.
It will teleport you to the aim position, then for every time you are stuck, teleport you backwards across the angle of aim ( so you can teleport someone behind you if you're looking at a wall... ) If all else fails, block the teleport. https://github.com/eyal282/Useful-Co...mands.sp#L5763 |
Re: [CSGO] how to warp players without getting stuck in walls?
Quote:
|
All times are GMT -4. The time now is 06:15. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.