I have searched for quite a while and have never seen anyone successfully do this.
I want to change the vector that a client's crosshair is aiming at.
(Reason has to do with DoD's style of recoil handling, a lot diff. than cs)
I can absolutely
get the aim, by reading pev_v_angle or reading UC_ViewAngles, but neither actually do anything when I
set them.
One of the threads on this forum suggested setting pev_fixangle to 1 after I set pev_v_angle. That's a misinterpretation - all pev_fixangle does is the equivelant of pressing the "Home" key on your keyboard in game - it brings your aim back to straight forward (y-angle-wise).
----------------------------------------
I have tried hooking CmdStart, which allows me to read UC_ViewAngles but not set them. I have tried this in normal register_forward() and as post.
Code:
public hook_CmdStart( id, uc_handle, seed ) {
if( !is_user_alive( id ) ) return FMRES_IGNORED;
if( g_logging[id] )
{
new Float:m_viewangles[3];
get_uc( uc_handle, UC_ViewAngles, m_viewangles );
g_logging[id] = 0;
console_print( id, "Get UC_ViewAngles currently {%f, %f, %f}", m_viewangles[0], m_viewangles[1], m_viewangles[2] );
}
else
{
set_uc( uc_handle, UC_ViewAngles, g_set[id] );
return FMRES_SUPERCEDE;
}
return FMRES_IGNORED;
}
Note that g_set is a global variable set with a client command in a properly working function.
Has anyone ever actually changed where a player is aiming, or knows how?
__________________