Raised This Month: $ Target: $400
 0% 

How to make entity follow players aim ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 11-07-2009 , 12:16   Re: How to make entity follow players aim ?
Reply With Quote #1

Sorry not exactly what I wanted to say.

For 1/ and 2/ ; I was meant the direction between the end position ( where you aim ) and the entity origin.
By getting the direction you can retrieve an angle of it and changing the entity angle.

Code:
new Float:AimOrigin[3]; new Float:EntityAngles[3]; new Float:EntityOrigin[3]; new Float:Direction[3]; xs_vec_sub( AimOrigin, EntityOrigin, Direction ); xs_vec_normalize( Direction, Direction ); vector_to_angle( Direction, EntityAngles ); set_pev( Entity, pev_angles, EntityAngles );
__________________

Last edited by Arkshine; 11-07-2009 at 12:19.
Arkshine 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 17:31.


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