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

Need some help with vectors


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Kidev
Veteran Member
Join Date: Jun 2010
Location: France
Old 12-26-2011 , 10:28   Need some help with vectors
Reply With Quote #1

Hi, i actually need to change at a precise moment a player direction's vector to his opposite vector (v to -v). In this way, he can't go on certain map areas.

Can you help me, please?
__________________

Last edited by Kidev; 12-26-2011 at 10:31.
Kidev is offline
micapat
Veteran Member
Join Date: Feb 2010
Location: Nyuu, nyuu (France).
Old 12-26-2011 , 11:32   Re: Need some help with vectors
Reply With Quote #2

PHP Code:
pevplayerpev_anglesangles );

angles] += 180.0;

if( 
angles] >= 360.0 )
    
angles] -= 360.0;

set_pevplayerpev_anglesangles ); 
?
__________________
micapat is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-26-2011 , 11:38   Re: Need some help with vectors
Reply With Quote #3

You have to retrieve v_angle and set angles.
And set fixangle to 1 so it takes effect.

PHP Code:
{
    new 
Float:vecAngle[3]
    
pev(idpev_v_anglevecAngle)
    
vecAngle[1] += 180.0
    
while( vecAngle[1] >= 360.0 )
    {
        
vecAngle[1] -= 360.0
    
}
    
set_pev(idpev_anglesvecAngle)
    
set_pev(idpev_fixangle1)

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Kidev
Veteran Member
Join Date: Jun 2010
Location: France
Old 12-26-2011 , 13:09   Re: Need some help with vectors
Reply With Quote #4

Ok thank you, but player's movement direction is not changed.
__________________

Last edited by Kidev; 12-26-2011 at 13:39.
Kidev is offline
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 12-26-2011 , 13:27   Re: Need some help with vectors
Reply With Quote #5

If you want to block certain areas then check this: http://forums.alliedmods.net/showthr...52#post1448052
__________________
Impossible is Nothing
Sylwester is offline
Kidev
Veteran Member
Join Date: Jun 2010
Location: France
Old 12-26-2011 , 13:41   Re: Need some help with vectors
Reply With Quote #6

Thank you but i think that your plugin is a bit complex: i only want to 'push' a player who is touching an entity.
__________________

Last edited by Kidev; 12-26-2011 at 13:41.
Kidev is offline
micapat
Veteran Member
Join Date: Feb 2010
Location: Nyuu, nyuu (France).
Old 12-26-2011 , 13:57   Re: Need some help with vectors
Reply With Quote #7

Instead of just changing the angle of the player, why not expel him in the opposite direction of the entity ( pev_velocity ) ?
__________________
micapat is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-26-2011 , 15:33   Re: Need some help with vectors
Reply With Quote #8

Try with angle[x]
__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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 05:37.


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