Raised This Month: $ Target: $400
 0% 

Where player aim -> Same angle to object.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 12-30-2008 , 14:34   Re: Where player aim -> Same angle to object.
Reply With Quote #4

You'd have to get the forward vector. Here's an example:

Code:
/* Assume id is passed to this function */ new Float:Origin[3],Float:Angle[3],Float:Forward[3],Float:Result[3] pev(id,pev_origin,Origin) pev(id,pev_v_angle,Angle)         engfunc(EngFunc_MakeVectors,Angle) global_get(glb_v_forward,Forward)         Result[0] = Origin[0] + Forward[0] * 100 Result[1] = Origin[1] + Forward[1] * 100 /* This will leave it on the same z axis,     but if you want it to go up and down,     uncomment the line after and comment     this one */ Result[2] = Origin[2] //Result[2] = Origin[2] + Forward[2] * 100 engfunc(EngFunc_SetOrigin,Index,Result)

You can also make it go to the right, up, etc, using glb_v_right and glb_v_up.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
 



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 09:11.


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