AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   *Actually* Change a players aiming angles? (https://forums.alliedmods.net/showthread.php?t=61870)

Wilson [29th ID] 10-12-2007 15:28

*Actually* Change a players aiming angles?
 
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?

Voi 10-12-2007 15:37

Re: *Actually* Change a players aiming angles?
 
http://forums.alliedmods.net/showthread.php?t=61147

:)

Orangutanz 10-12-2007 17:18

Re: *Actually* Change a players aiming angles?
 
Quote:

Originally Posted by Wilson [29th ID] (Post 541453)
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).

You are wrong, if you look at bots they are constantly set to 1. To my understanding fixangle is basically a server side setting to enforce clients to look a particular way.

To my knowledge AssKicR, Freecode and myself was the 1st to maniplate viewing angles of clients for AMX Mod when we created SoccerMod :mrgreen:

Wilson [29th ID] 10-12-2007 19:23

Re: *Actually* Change a players aiming angles?
 
Voi, I can't believe I actually missed that. I've seen that thread before too, but I never imagined it actually worked...

alien 10-13-2007 00:28

Re: *Actually* Change a players aiming angles?
 
This works for me perfectly, but it's engine.


Code:
set_view_angle(id, Float:angles[3])   {     entity_set_vector(id, EV_VEC_angles, angles);     entity_set_int(id, EV_INT_fixangle, 1);     return;   }

VEN 10-14-2007 08:07

Re: *Actually* Change a players aiming angles?
 
From HLSDK:
Quote:

int fixangle; // 0:nothing, 1:force view angles, 2:add avelocity


All times are GMT -4. The time now is 16:06.

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