Raised This Month: $ Target: $400
 0% 

Aiming Direction


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 08-28-2009 , 10:50   Aiming Direction
Reply With Quote #1

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.
__________________

Last edited by hleV; 08-28-2009 at 10:53.
hleV is offline
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 08-28-2009 , 12:03   Re: Aiming Direction
Reply With Quote #2

I am not sure but... this?

http://www.amxmodx.org/funcwiki.php?go=func&id=366
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...
Alucard^ is offline
Send a message via Skype™ to Alucard^
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 08-28-2009 , 13:49   Re: Aiming Direction
Reply With Quote #3

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.
__________________
hleV is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 08-28-2009 , 14:03   Re: Aiming Direction
Reply With Quote #4

change pev_angles and then set pev_fixangle to 1
__________________
xPaw is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 08-28-2009 , 14:25   Re: Aiming Direction
Reply With Quote #5

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.
__________________
hleV is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 08-28-2009 , 15:39   Re: Aiming Direction
Reply With Quote #6

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 ); }
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!

Last edited by Exolent[jNr]; 08-28-2009 at 15:46.
Exolent[jNr] is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 08-28-2009 , 15:49   Re: Aiming Direction
Reply With Quote #7

Thanks a lot.
__________________
hleV 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 15:12.


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