AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Aiming Direction (https://forums.alliedmods.net/showthread.php?t=101904)

hleV 08-28-2009 10:50

Aiming Direction
 
I've searched but didn't really find (or didn't understand if I did) a way to change player's aiming direction. Like if you're looking at some wall, I want you to spin 90 degrees.

Or maybe it's possible to make player look to a specific origin e.g. to the center point of a map? Thanks.

Alucard^ 08-28-2009 12:03

Re: Aiming Direction
 
I am not sure but... this?

http://www.amxmodx.org/funcwiki.php?go=func&id=366

hleV 08-28-2009 13:49

Re: Aiming Direction
 
Thanks. Looks like this should be what I need. I don't really know how to use it though so I hope someone will teach me.

xPaw 08-28-2009 14:03

Re: Aiming Direction
 
change pev_angles and then set pev_fixangle to 1 :)

hleV 08-28-2009 14:25

Re: Aiming Direction
 
OK, I'll provide more info about what I'm doing.

I'm using
Code:
entity_set_int(Cl, EV_INT_flags, entity_get_int(Cl, EV_INT_flags) | FL_FROZEN);
After that no matter where you aim, your model position doesn't change. That's OK, I don't want it to change but I want it to be in a specific direction.

An example function would be welcome. Thanks.

Exolent[jNr] 08-28-2009 15:39

Re: Aiming Direction
 
Code:
AimToOrigin( client, Float:vAimOrigin[ 3 ] ) {     static iOrigin[ 3 ], Float:vOrigin[ 3 ];     get_user_origin( client, iOrigin, 1 );     IVecFVec( iOrigin, vOrigin );         static Float:vDirection[ 3 ];     xs_vec_sub( vAimOrigin, vOrigin, vDirection );         static Float:vAngles[ 3 ];     vector_to_angle( vDirection, vAngles );         entity_set_int( client, EV_INT_fixangle, 1 );     entity_set_vector( client, EV_VEC_angles, vAngles );     entity_set_vector( client, EV_VEC_v_angle, vAngles ); }

hleV 08-28-2009 15:49

Re: Aiming Direction
 
Thanks a lot.


All times are GMT -4. The time now is 15:12.

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