Raised This Month: $12 Target: $400
 3% 

Player aim


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
~Ice*shOt
Veteran Member
Join Date: Mar 2009
Location: Lithuania
Old 10-04-2013 , 12:13   Player aim
Reply With Quote #1

Hello, can anyone help me to change player's aim? If I'm looking to player and press 'Attack' button his aim should rotate and rotate by += 1.0 while I'm holding that button. Idk how it should be done.

There is my attempt (with angle)
PHP Code:
public Fwd_CmdStart(idCmd)
{
    if (!
is_user_alive(id))
        return 
FMRES_IGNORED

    
static ButtonsButtonsChangedButtonPressedButtonReleased
    Buttons 
get_uc(CmdUC_Buttons)

    
ButtonsChanged get_pdata_int(id245) ^ Buttons

    ButtonPressed 
ButtonsChanged Buttons
    ButtonReleased 
ButtonsChanged & ~Buttons

    
if (ButtonPressed IN_ATTACK)
    {
        new 
TargetBody
        get_user_aiming
(idTargetBody)

        static 
FloatAngle[3]

        
entity_get_vector(TargetEV_VEC_anglesAngle)

        if (
Angle[1] < 180.0)
        {
            
Angle[1] += 1.0

            entity_set_vector
(idEV_VEC_anglesAngle)

            
//client_print(id, print_center, "[Angle: %f %f %f]", Angle[0], Angle[1], Angle[2])
        
}
    }
    return 
FMRES_IGNORED

~Ice*shOt is offline
Send a message via Skype™ to ~Ice*shOt
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 10-04-2013 , 12:17   Re: Player aim
Reply With Quote #2

Alter pev_punchangle.
__________________
<VeCo> is offline
~Ice*shOt
Veteran Member
Join Date: Mar 2009
Location: Lithuania
Old 10-04-2013 , 13:06   Re: Player aim
Reply With Quote #3

What do you mean?
~Ice*shOt is offline
Send a message via Skype™ to ~Ice*shOt
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 10-04-2013 , 13:06   Re: Player aim
Reply With Quote #4

Ah, didn't see you use engine.
Change EV_VEC_angles to EV_VEC_punchangle.
__________________

Last edited by <VeCo>; 10-04-2013 at 13:08.
<VeCo> is offline
~Ice*shOt
Veteran Member
Join Date: Mar 2009
Location: Lithuania
Old 10-04-2013 , 13:36   Re: Player aim
Reply With Quote #5

Hmm, I think it works, but not how I want. What I need to do that player turn until I see his back?
~Ice*shOt is offline
Send a message via Skype™ to ~Ice*shOt
lazarev
Veteran Member
Join Date: Sep 2008
Old 10-04-2013 , 13:39   Re: Player aim
Reply With Quote #6

set EV_INT_fixangle to 1 after changing angles
lazarev is offline
~Ice*shOt
Veteran Member
Join Date: Mar 2009
Location: Lithuania
Old 10-04-2013 , 14:02   Re: Player aim
Reply With Quote #7

OK, but how to turn player (that I could see his back) if doesn't matter where he's looking?
~Ice*shOt is offline
Send a message via Skype™ to ~Ice*shOt
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-04-2013 , 14:08   Re: Player aim
Reply With Quote #8

Can't you just set their yaw angle to the same as your yaw angle? I think that should work if you want them to be facing directly away from you.
__________________
fysiks is offline
~Ice*shOt
Veteran Member
Join Date: Mar 2009
Location: Lithuania
Old 10-04-2013 , 14:39   Re: Player aim
Reply With Quote #9

Ah of course I can, thank you.
~Ice*shOt is offline
Send a message via Skype™ to ~Ice*shOt
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 06:05.


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