AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Need some help with vectors (https://forums.alliedmods.net/showthread.php?t=174838)

Kidev 12-26-2011 10:28

Need some help with vectors
 
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?

micapat 12-26-2011 11:32

Re: Need some help with vectors
 
PHP Code:

pevplayerpev_anglesangles );

angles] += 180.0;

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

set_pevplayerpev_anglesangles ); 

?

ConnorMcLeod 12-26-2011 11:38

Re: Need some help with vectors
 
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)



Kidev 12-26-2011 13:09

Re: Need some help with vectors
 
Ok thank you, but player's movement direction is not changed.

Sylwester 12-26-2011 13:27

Re: Need some help with vectors
 
If you want to block certain areas then check this: http://forums.alliedmods.net/showthr...52#post1448052

Kidev 12-26-2011 13:41

Re: Need some help with vectors
 
Thank you but i think that your plugin is a bit complex: i only want to 'push' a player who is touching an entity.

micapat 12-26-2011 13:57

Re: Need some help with vectors
 
Instead of just changing the angle of the player, why not expel him in the opposite direction of the entity ( pev_velocity ) ?

ConnorMcLeod 12-26-2011 15:33

Re: Need some help with vectors
 
Try with angle[x]


All times are GMT -4. The time now is 11:55.

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