Raised This Month: $ Target: $400
 0% 

Velocity from player eyes.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
FromTheFuture
Senior Member
Join Date: Jan 2013
Old 11-24-2014 , 14:10   Re: Velocity from player eyes.
Reply With Quote #1

Quote:
Originally Posted by KliPPy View Post
I don't think so. If it flew from the hand, it would be the attachment origin, not the aim origin. However, you may try this:
PHP Code:
new FloatfvOrigin[3], FloatfvViewOfs[3];
pev(idpev_originfvOrigin);
pev(idpev_view_ofsfvViewOfs);
xs_vec_add(fvOriginfvViewOfsfvOrigin); 
After that, your fvOrigin[] variable should hold eyes position.
Thank U. But how I can add velocity to it?
PHP Code:
public fw_SetModel(entity, const model[])
{
    new 
id pev(entitypev_owner);
    
    if(
equali(model"models/w_hegrenade.mdl"))
    {    
        new 
Floatvel[3];
        
pev(entitypev_velocityvel);
        
        if(!
vel[0]) return;
        
        
        
set_pev(entitypev_modelindexm);
        
set_pev(entitypev_movetypeMOVETYPE_FLYMISSILE)
        
        new 
FloatfvOrigin[3], FloatfvViewOfs[3];
        
pev(idpev_originfvOrigin);
        
pev(idpev_view_ofsfvViewOfs);
        
xs_vec_add(fvOriginfvViewOfsfvOrigin);  

        
set_pev(entitypev_velocity, ???) // ???
            
        
set_pev(entitypev_nextthinkget_gametime() + 99999.9);
    }
    

FromTheFuture 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:39.


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