Raised This Month: $51 Target: $400
 12% 

Push Entity In Opposite Direction


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
scorpius2k1
Senior Member
Join Date: Feb 2016
Old 05-06-2019 , 13:36   Push Entity In Opposite Direction
Reply With Quote #1

Using TeleportEntity, how can one go about pushing an entity in the opposite direction it was traveling while keeping it's current origin, angle, & velocity in mind? The "bounce back" should have the same effect as if you were to throw a barrel or another object against the wall or any other surface in the game.

PHP Code:
stock void PushEntityBack(int iEntity) {


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

Last edited by scorpius2k1; 05-06-2019 at 13:37.
scorpius2k1 is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 05-06-2019 , 15:10   Re: Push Entity In Opposite Direction
Reply With Quote #2

Quote:
Originally Posted by scorpius2k1 View Post
Using TeleportEntity, how can one go about pushing an entity in the opposite direction it was traveling while keeping it's current origin, angle, & velocity in mind? The "bounce back" should have the same effect as if you were to throw a barrel or another object against the wall or any other surface in the game.

PHP Code:
stock void PushEntityBack(int iEntity) {


Thanks in advance!
I think:

Code:
new Float:Velocity[3];
GetEntPropVector(client, Prop_Data, "m_vecVelocity", Velocity);

NegateVector(Velocity);

TeleportEntity(client, NULL_VECTOR, NULL_VECTOR, Velocity);
This will negate the movement direction of a client with the same speed. If you're falling at 500 mph and the stock is activated, you'll be sent flying upwards at 500 mph before gravity starts affecting you again. Replace "client" with iEntity
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334

Last edited by eyal282; 05-06-2019 at 15:11.
eyal282 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:19.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode