Raised This Month: $51 Target: $400
 12% 

How can i get origin where user is aiming?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
AlejandroSk
BANNED
Join Date: Nov 2008
Location: Aqui, en mi casa. Karma:
Old 04-26-2009 , 21:40   How can i get origin where user is aiming?
Reply With Quote #1

How can i get where is user aiming?
AlejandroSk is offline
Send a message via MSN to AlejandroSk
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 04-26-2009 , 21:43   Re: How can i get origin where user is aiming?
Reply With Quote #2

get_user_origin() param number 3 (mode) set to 3 (End position from eyes)

or a different type of aiming detection: get_user_aiming()

edit: that's why I said different he may be needing it
__________________

Last edited by Hunter-Digital; 04-27-2009 at 06:47. Reason: answer to arkshine
Hunter-Digital is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-27-2009 , 04:44   Re: How can i get origin where user is aiming?
Reply With Quote #3

get_user_aiming doesn't pass the end origin.
Arkshine is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-27-2009 , 11:41   Re: How can i get origin where user is aiming?
Reply With Quote #4

fakemeta_util

PHP Code:
// ported from AMXX's core get_user_origin(..., 3) (suggested by Greenberet)
stock fm_get_aim_origin(indexFloat:origin[3]) {
    new 
Float:start[3], Float:view_ofs[3];
    
pev(indexpev_originstart);
    
pev(indexpev_view_ofsview_ofs);
    
xs_vec_add(startview_ofsstart);

    new 
Float:dest[3];
    
pev(indexpev_v_angledest);
    
engfunc(EngFunc_MakeVectorsdest);
    
global_get(glb_v_forwarddest);
    
xs_vec_mul_scalar(dest9999.0dest);
    
xs_vec_add(startdestdest);

    
engfunc(EngFunc_TraceLinestartdest0index0);
    
get_tr2(0TR_vecEndPosorigin);

    return 
1;

__________________

Last edited by Bugsy; 04-27-2009 at 19:48.
Bugsy is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-27-2009 , 12:34   Re: How can i get origin where user is aiming?
Reply With Quote #5

It's from VEN (fakemeta_util) if I'm right, but get_user_origin(_, _, 3 ) should do the same. ( Slightly less accurate since it doesn't use float )
Arkshine is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-27-2009 , 19:45   Re: How can i get origin where user is aiming?
Reply With Quote #6

You are correct ark, it was the angle-of-aim function that stupok wrote for me. I edited my above post
__________________

Last edited by Bugsy; 04-27-2009 at 19:47.
Bugsy 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 10:24.


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