View Single Post
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 01-15-2017 , 15:30   Re: Half-Life Position, Velocity, and Angles (for n00bs)
Reply With Quote #43

Quote:
Originally Posted by Kotoamatsukami View Post
Hello. I try to write some code which will teleport user using this;
PHP Code:
public plugin_init()
{
    
register_clcmd("say /tp""tp" )
}

public 
tpid )
{
   new 
origin[3]

   
get_user_originidorigin )
   
   
origin[0] += 50 // will move forward because this is X-position based on CS

   
set_user_originidorigin )

It does teleport successfully but it didn't teleport forward( as I wanted it to do ) and It allow player to penetrate the wall too but then I saw Arkshine's post on how to move from A to B;



But, how do I redirect the player from point A to point B? Using vector? but the tutorial use
PHP Code:
new Float:fVelocity[3]
pevidpev_velocityfVelocity 
Which I don't understand what it's trying to do...
How do you suppose to move ALWAYS 10 units "in forward" of you by just adding 10 units to your origin? It's aligned to map coordinates, 3d dimension, learn about it, get some math books. You have to move in forward having your view direction vector
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline