Raised This Month: $ Target: $400
 0% 

Solved sentry turn to target using pev_controller


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
NOVA GAMING
Member
Join Date: Apr 2020
Old 05-18-2020 , 02:37   Re: sentry turn to target using pev_controller
Reply With Quote #9

okay thanks i will try

and i have find this code which do exactly what i wanted but problem is it is in module coding and i don't know how to apply in plugin . any way i will try your method

PHP Code:
    if (m_vecCurAngles.!= m_vecGoalAngles.y)
    {
        
float flDir m_vecGoalAngles.m_vecCurAngles.: -;
        
float flDist fabs(m_vecGoalAngles.m_vecCurAngles.y);
        
        if (
flDist 180)
        {
            
flDist 360 flDist;
            
flDir = -flDir;
        }
        if (
flDist 30)
        {
            if (
m_fTurnRate m_iBaseTurnRate 10)
            {
                
m_fTurnRate += m_iBaseTurnRate;
            }
        }
        else if (
m_fTurnRate 45)
        {
            
m_fTurnRate -= m_iBaseTurnRate;
        }
        else
        {
            
m_fTurnRate += m_iBaseTurnRate;
        }

        
m_vecCurAngles.+= 0.1 m_fTurnRate flDir;

        if (
m_vecCurAngles.0)
            
m_vecCurAngles.+= 360;
        else if (
m_vecCurAngles.>= 360)
            
m_vecCurAngles.-= 360;

        if (
flDist < (0.05 m_iBaseTurnRate))
            
m_vecCurAngles.m_vecGoalAngles.y;

        
//ALERT(at_console, "%.2f -> %.2f\n", m_vecCurAngles.y, y);
        
if (m_iOrientation == 0)
            
SetBoneController(0m_vecCurAngles.pev->angles.);
        else 
            
SetBoneController(0pev->angles.180 m_vecCurAngles.);
        
state 1;
    } 
FULL LINK :- https://github.com/ValveSoftware/hal...lls/turret.cpp
__________________

Last edited by NOVA GAMING; 05-18-2020 at 02:38. Reason: WRONG LINK
NOVA GAMING is offline
 


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 07:39.


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