Thread: [Solved] TeleportEntity function?
View Single Post
impossible_cc
Senior Member
Join Date: Sep 2018
Location: Ukraine
Old 12-14-2018 , 13:36   Re: TeleportEntity function?
Reply With Quote #4

If you want to just teleport from one coord to another one without changing angles (Camera position), according to your code you should do like this:
PHP Code:
TeleportEntity(clientDPNULL_VECTORNULL_VECTOR); 
Example of usage angles.
If you want teleport one player to any other player, you probably want to set his crosshair in the same place to crosshair of that second player.
Then you can do:
PHP Code:

void TeleportToPlayer
(int targetint otherPlayer)
{
    
float otherPlayerOrigin[3];
    
float otherPlayerAngles[3];
    
    
GetClientAbsOrigin(otherPlayerotherPlayerOrigin);
    
GetClientEyeAngles(otherPlayerotherPlayerAngles);
    
    
TeleportEntity(targetotherPlayerOriginotherPlayerAnglesNULL_VECTOR);

By the way, angles have only 2 dimensions. X and Y. ang[2] (z) always equals zero.

Last edited by impossible_cc; 12-14-2018 at 13:47.
impossible_cc is offline