Raised This Month: $ Target: $400
 0% 

[SOLVED] Get player's 'hands' origin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
danielkza
AMX Mod X Plugin Approver
Join Date: May 2007
Location: São Paulo - Brasil
Old 07-18-2008 , 22:20   [SOLVED] Get player's 'hands' origin
Reply With Quote #1

Hi, I need to get the player's 'hands' origin (or, if you want,get the origin of a player model's attachment). I know the engine does it, as messages like TE_BEAMFOLLOW accept and entid ORed with an attachment bitflag. Does anybody know how to do this?

Thanks in advance.

Last edited by danielkza; 07-18-2008 at 22:56.
danielkza is offline
danielkza
AMX Mod X Plugin Approver
Join Date: May 2007
Location: São Paulo - Brasil
Old 07-18-2008 , 22:56   Re: Get player's 'hands' origin
Reply With Quote #2

Nevermind,I found a better way: instead of getting their hand pos,I just use angle_vector() to get a normalized vector pointing to where they are looking at, and add it to the user's origin. The code:
Code:
if(++iPlayerJump_Thinks[id] >= 10)
{
    static Float:fOrigin[3]
    pev(id,pev_origin,fOrigin)
    
    static Float:fAngles[3],Float:fAngleVector[3]

    pev(id,pev_angles,fAngles)
    angle_vector(fAngles,1,fAngleVector)

    for(new i=0;i <3;i++)
        fOrigin[i] += (fAngleVector[i] * 20)
    
    BeamPointPoint(fPlayerJump_BeamPos[id],fOrigin,iBeamSprite)
    
    fPlayerJump_BeamPos[id] = fOrigin
}
danielkza is offline
Old 07-18-2008, 22:57
danielkza
This message has been deleted by danielkza.
Reply


Thread Tools
Display Modes

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 05:40.


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