View Single Post
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