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

Player aim


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 



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 08:58.


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