Raised This Month: $ Target: $400
 0% 

Vector Directions


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
AntiBots
Veteran Member
Join Date: May 2008
Location: Brazil
Old 02-03-2009 , 08:22   Re: Vector Directions
Reply With Quote #1

Some like this:

I want to push player near that ent.

PHP Code:
stock put_allplayers(Float:origin[3])
{
         static 
Float:direction[3]
         for( new 
1<= 32i++)
         {
                  if( 
is_user_connected(i) && is_user_alive(i) )
                  {
                           new 
Float:plrorigin[3]
                           
pev(ipev_originplrorigin)
 
                           static 
Float:velocity[2][3
                           
pev(victimpev_velocityvelocity[0])
                           
xs_vec_copy(velocity[0], velocity[1])
 
                           
direction origin plrorigin
 
                           xs_vec_mul_scalar
(direction200.0 - (get_distance_f(plroriginorigin)*0.5), direction)
                           
xs_vec_add(directionvelocity[0], velocity[0])
                           
velocity[0][2] = velocity[1][2]
                           
set_pev(victimpev_velocityvelocity[0])
 
                           
server_print("%f %f %f, Distance: %f"direction[0], direction[1], direction[2], get_distance_f(plroriginorigin))
                  }
         }

__________________

Last edited by AntiBots; 02-03-2009 at 08:49.
AntiBots is offline
Send a message via ICQ to AntiBots Send a message via MSN to AntiBots Send a message via Skype™ to AntiBots
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 01:42.


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