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

Half-Life Position, Velocity, and Angles (for n00bs)


Post New Thread Reply   
 
Thread Tools Display Modes
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 05-06-2016 , 06:43   Re: Half-Life Position, Velocity, and Angles (for n00bs)
Reply With Quote #41

can any one make plugin for that with cvar to change speed angle?
i understood little (
__________________
abdobiskra is offline
Send a message via Skype™ to abdobiskra
Kotoamatsukami
Member
Join Date: Jan 2017
Location: Malaysia
Old 01-15-2017 , 05:06   Re: Half-Life Position, Velocity, and Angles (for n00bs)
Reply With Quote #42

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;

Quote:
Originally Posted by Arkshine View Post
The purpose of a TraceLine is to trace a virtual line from point A to point B and seeing if it hits something.

To make a line, you need to know the Point A origin, and the Point B origin.

We know already player's origin, which is Point A (vOrigin).

To know the end origin, which is Point B, you need a direction and a length.

Length and direction you will want to apply from Point A.

Code:
A           B
x---------->x
|   length  |
Since we don't care about length, you multiply the direction by a big number like 9999. (You could also use 8192 which is the max length of a map)

So you have "a long line" with a defined direction.To know the Point B origin, you just need to start the line from Point A.

That's why you add the Point A origin to this "long line". You need to tell from where you want to start to draw the line.
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...
Kotoamatsukami is offline
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
Reply


Thread Tools
Display Modes

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 11:08.


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