Вопрос Csgo Simple viewangles problem

Начинающий
Статус
Оффлайн
Регистрация
29 Июн 2018
Сообщения
15
Реакции[?]
0
Поинты[?]
0
heres a screenshot of the issue
the autostrafe wants to go into diffrent directions

if thats relevant ill post the create move here

C++:
bool __stdcall Hooks::creatmove::hook(float input_sample_frametime, CUserCmd* cmd) {

    bool* send_packet = reinterpret_cast<bool*>(reinterpret_cast<uintptr_t>(_AddressOfReturnAddress()) + 0x14);

    o_crmove(input_sample_frametime, cmd);



    if (!cmd || !cmd->command_number || g_Unload) return false;



    static int latency_ticks = 0;

    float fl_latency = g_EngineClient->GetNetChannelInfo()->GetLatency(FLOW_OUTGOING);

    int latency = TIME_TO_TICKS(fl_latency);;

    if (g_ClientState->m_nChokedCommands <= 0) latency_ticks = latency;

    else latency_ticks = max(latency, latency_ticks);



    if (g_GameRules->m_bIsValveDS()) {

        if (fl_latency >= g_GlobalVars->interval_per_tick) max_choke_ticks = 6 - latency_ticks;

        else max_choke_ticks = 6;

    }

    else max_choke_ticks = 13 - latency_ticks;



    static float SpawnTime = 0.0f;

    if (g_LocalPlayer->m_flSpawnTime() != SpawnTime) {

        g_AnimState.pBaseEntity = g_LocalPlayer;

        g_LocalPlayer->ResetAnimationState(&g_AnimState);

        SpawnTime = g_LocalPlayer->m_flSpawnTime();

    }



    if (Menu::Get().IsVisible()) cmd->buttons &= ~IN_ATTACK | IN_ATTACK2;   



    if (Cfg.misc_bhop)         Misc::Get().BunnyHop(cmd);

    if (Cfg.misc_autostrafe) Misc::Get().AutoStrafe(cmd,cmd->viewangles);

 

    QAngle angleold = cmd->viewangles;



    if (Cfg.misc_showranks && cmd->buttons & IN_SCORE) Utils::RankRevealAll();



    EnginePrediction::Begin(cmd); {

        Aimbot::Get().Run(cmd);

        Backtrack::Get().OnMove(cmd);

        if (Cfg.esp_grenade_prediction) GrenadePrediction::trace(cmd);



        if (Cfg.misc_desync && std::fabsf(g_LocalPlayer->m_flSpawnTime() - g_GlobalVars->curtime) > 1.0f)

            Misc::Get().Desync(cmd, send_packet);



      

        cmd->viewangles.yaw = std::remainderf(cmd->viewangles.yaw, 360.0f);



        if (Cfg.misc_desync && g_ClientState->m_nChokedCommands >= max_choke_ticks) {

            *send_packet = true;

            cmd->viewangles = g_ClientState->viewangles;

        }



        Misc::Get().correct_mouse(cmd);



        auto anim_state = g_LocalPlayer->GetPlayerAnimState();

        if (anim_state) {

            CCSGOPlayerAnimState anim_state_backup = *anim_state;

            *anim_state = g_AnimState;

            *g_LocalPlayer->GetVAngles() = cmd->viewangles;

            g_LocalPlayer->UpdateClientSideAnimation();



            if (anim_state->speed_2d > 0.1f || std::fabsf(anim_state->flUpVelocity)) {

                next_lby = g_GlobalVars->curtime + 0.22f;

            }

            else if (g_GlobalVars->curtime > next_lby) {

                if (std::fabsf(Utils::AngleDiff(anim_state->m_flGoalFeetYaw, anim_state->m_flEyeYaw)) > 35.0f)

                    next_lby = g_GlobalVars->curtime + 1.1f;               

            }



            g_AnimState = *anim_state;

            *anim_state = anim_state_backup;

        }



        if (*send_packet) {

            real_angle = g_AnimState.m_flGoalFeetYaw;

            view_angle = g_AnimState.m_flEyeYaw;

        }



        fix_movement(cmd, angleold);

    } EnginePrediction::End();

    Math::FixAngles(cmd->viewangles);

 

    std::clamp(cmd->sidemove, -450.f, 450.f);

    std::clamp(cmd->forwardmove, -450.f, 450.f);

    std::clamp(cmd->upmove, -320.f, 320.f);

    return false;

}
 
Сверху Снизу