Quote:
Originally Posted by KliPPy
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 Float: fvOrigin[3], Float: fvViewOfs[3];
pev(id, pev_origin, fvOrigin);
pev(id, pev_view_ofs, fvViewOfs);
xs_vec_add(fvOrigin, fvViewOfs, fvOrigin);
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(entity, pev_owner);
if(equali(model, "models/w_hegrenade.mdl"))
{
new Float: vel[3];
pev(entity, pev_velocity, vel);
if(!vel[0]) return;
set_pev(entity, pev_modelindex, m);
set_pev(entity, pev_movetype, MOVETYPE_FLYMISSILE)
new Float: fvOrigin[3], Float: fvViewOfs[3];
pev(id, pev_origin, fvOrigin);
pev(id, pev_view_ofs, fvViewOfs);
xs_vec_add(fvOrigin, fvViewOfs, fvOrigin);
set_pev(entity, pev_velocity, ???) // ???
set_pev(entity, pev_nextthink, get_gametime() + 99999.9);
}
}