C++ EnginePrediction for weave

EyeAngel = ты просто пидр
Начинающий
Статус
Оффлайн
Регистрация
16 Сен 2019
Сообщения
82
Реакции[?]
21
Поинты[?]
0
предик хороший
EnginePrediction.cpp
C++:
#include "EnginePrediction.h"
#include "checksum_md5.h"
#include "AntiAims.h"
#include "xor.h"
void CEnginePrediction::Start(CUserCmd* cmd, IBasePlayer* local) {
    float flPrev = interfaces.global_vars->curtime;
    static ConVar* weapon_recoil_scale = interfaces.cvars->FindVar(xorstr_("weapon_recoil_scale"));
    static ConVar* view_recoil_tracking = interfaces.cvars->FindVar(xorstr_("view_recoil_tracking"));
    csgo->local->GetPunchAngle() * (weapon_recoil_scale ? weapon_recoil_scale->GetFloat() : 2.f);
    old_vars.curtime = interfaces.global_vars->curtime;
    old_vars.frametime = interfaces.global_vars->frametime;
    old_vars.tickcount = interfaces.global_vars->tickcount;
    interfaces.global_vars->curtime = TICKS_TO_TIME(local->GetTickBase()) - TICK_INTERVAL;
    interfaces.global_vars->frametime = m_bEnginePaused ? 0 : TICK_INTERVAL;
    interfaces.global_vars->tickcount = TIME_TO_TICKS(interfaces.global_vars->curtime);
    interfaces.global_vars->curtime = TICKS_TO_TIME(local->GetTickBase()) - TICK_INTERVAL;
    interfaces.global_vars->frametime = m_bEnginePaused ? 0 : TICK_INTERVAL;
    interfaces.game_movement->StartTrackPredictionErrors(local);
    interfaces.move_helper->SetHost(local);
    interfaces.global_vars->curtime = flPrev;
    m_nButtons = cmd->buttons;
    int buttonsChanged = cmd->buttons ^ *reinterpret_cast<int*>(uintptr_t(local) + 0x31E8);
    *reinterpret_cast<int*>(uintptr_t(local) + 0x31DC) = (uintptr_t(local) + 0x31E8);
    *reinterpret_cast<int*>(uintptr_t(local) + 0x31E8) = cmd->buttons;
    interfaces.game_movement->StartTrackPredictionErrors(local);
    memset(&data, 0, sizeof(data));
    interfaces.prediction->SetupMove(local, cmd, interfaces.move_helper, &data);
    interfaces.game_movement->ProcessMovement(local, &data);
    interfaces.prediction->FinishMove(local, cmd, &data);
    interfaces.global_vars->curtime = flPrev;
}
void CEnginePrediction::Finish(IBasePlayer* local) {
    interfaces.game_movement->FinishTrackPredictionErrors(local);
    interfaces.move_helper->SetHost(0);
    interfaces.global_vars->curtime = old_vars.curtime;
    interfaces.global_vars->frametime = old_vars.frametime;
}
EnginePrediction.h
C++:
#pragma once
#include "hooks.h"
class CEnginePrediction : public Singleton<CEnginePrediction>
{
public:
    void Start(CUserCmd* cmd, IBasePlayer* local);
    void Finish(IBasePlayer* local);
    int     m_nButtons;
    bool m_bEnginePaused;
private:
    CMoveData data;
    struct {
        float curtime, frametime;
        int tickcount, tickbase;
    }old_vars;
};
 

Вложения

  • 1.5 KB Просмотры: 60
Последнее редактирование модератором:
kill me
Забаненный
Статус
Оффлайн
Регистрация
18 Дек 2018
Сообщения
365
Реакции[?]
70
Поинты[?]
0
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
пахнет вкусно :grinning:

для тех кто не может пофиксить "xor_"
 
Пользователь
Статус
Оффлайн
Регистрация
3 Янв 2020
Сообщения
81
Реакции[?]
96
Поинты[?]
0
пж ликнете кому не трудно!!!!!!!!!!!!


а так предик хороший
EnginePrediction.cpp
C++:
#include "EnginePrediction.h"
#include "checksum_md5.h"
#include "AntiAims.h"
#include "xor.h"
void CEnginePrediction::Start(CUserCmd* cmd, IBasePlayer* local) {
    float flPrev = interfaces.global_vars->curtime;
    static ConVar* weapon_recoil_scale = interfaces.cvars->FindVar(xorstr_("weapon_recoil_scale"));
    static ConVar* view_recoil_tracking = interfaces.cvars->FindVar(xorstr_("view_recoil_tracking"));
    csgo->local->GetPunchAngle() * (weapon_recoil_scale ? weapon_recoil_scale->GetFloat() : 2.f);
    old_vars.curtime = interfaces.global_vars->curtime;
    old_vars.frametime = interfaces.global_vars->frametime;
    old_vars.tickcount = interfaces.global_vars->tickcount;
    interfaces.global_vars->curtime = TICKS_TO_TIME(local->GetTickBase()) - TICK_INTERVAL;
    interfaces.global_vars->frametime = m_bEnginePaused ? 0 : TICK_INTERVAL;
    interfaces.global_vars->tickcount = TIME_TO_TICKS(interfaces.global_vars->curtime);
    interfaces.global_vars->curtime = TICKS_TO_TIME(local->GetTickBase()) - TICK_INTERVAL;
    interfaces.global_vars->frametime = m_bEnginePaused ? 0 : TICK_INTERVAL;
    interfaces.game_movement->StartTrackPredictionErrors(local);
    interfaces.move_helper->SetHost(local);
    interfaces.global_vars->curtime = flPrev;
    m_nButtons = cmd->buttons;
    int buttonsChanged = cmd->buttons ^ *reinterpret_cast<int*>(uintptr_t(local) + 0x31E8);
    *reinterpret_cast<int*>(uintptr_t(local) + 0x31DC) = (uintptr_t(local) + 0x31E8);
    *reinterpret_cast<int*>(uintptr_t(local) + 0x31E8) = cmd->buttons;
    interfaces.game_movement->StartTrackPredictionErrors(local);
    memset(&data, 0, sizeof(data));
    interfaces.prediction->SetupMove(local, cmd, interfaces.move_helper, &data);
    interfaces.game_movement->ProcessMovement(local, &data);
    interfaces.prediction->FinishMove(local, cmd, &data);
    interfaces.global_vars->curtime = flPrev;
}
void CEnginePrediction::Finish(IBasePlayer* local) {
    interfaces.game_movement->FinishTrackPredictionErrors(local);
    interfaces.move_helper->SetHost(0);
    interfaces.global_vars->curtime = old_vars.curtime;
    interfaces.global_vars->frametime = old_vars.frametime;
}
EnginePrediction.h
C++:
#pragma once
#include "hooks.h"
class CEnginePrediction : public Singleton<CEnginePrediction>
{
public:
    void Start(CUserCmd* cmd, IBasePlayer* local);
    void Finish(IBasePlayer* local);
    int     m_nButtons;
    bool m_bEnginePaused;
private:
    CMoveData data;
    struct {
        float curtime, frametime;
        int tickcount, tickbase;
    }old_vars;
};
this is my atm -_- from your mess of a code etc
C++:
#include "EnginePrediction.h"
#include "checksum_md5.h"
#include "AntiAims.h"
void CEnginePrediction::Start(CUserCmd* cmd, IBasePlayer* local) {
    //holy fuck this is a big miss why no spaces etc -_-
    //i spend 5 secs fixing some crap i am not gonna spoon feed there are alot more stuff u can fix etc and fix properly

    // runcommand is only called on frames, when ur framerate dips, ur cmds wont be predicted (in time), so lots of things like desync etc fuck up
    // by simply forcing prediction on our cmds in CM, we circumvent all problems caused by this flawed setup where prediction is based on framerate
    g_pPrediction->Update(interfaces.ClientState->m_nDeltaTick, true, interfaces.ClientState->m_nLastCommandAck, interfaces.ClientStateClientState->m_nLastOutgoingCommand + interfaces.ClientStateClientState->m_nChokedCommands);

    static ConVar* weapon_recoil_scale = interfaces.cvars->FindVar(xorstr_("weapon_recoil_scale"));
    static ConVar* view_recoil_tracking = interfaces.cvars->FindVar(xorstr_("view_recoil_tracking"));

    //hmmm yeah
    csgo->local->GetPunchAngle()* (weapon_recoil_scale ? weapon_recoil_scale->GetFloat() : 2.f);

    // backup stuff before we fuck with it
    old_vars.curtime = interfaces.global_vars->curtime;
    old_vars.frametime = interfaces.global_vars->frametime;
    old_vars.tickcount = interfaces.global_vars->tickcount;

    //lets fix some crap and set it
    interfaces.global_vars->curtime = TICKS_TO_TIME(local->GetTickBase()) - TICK_INTERVAL;//u should do this the proper way -_- not gonna spoon feed u
    interfaces.global_vars->frametime = m_bEnginePaused ? 0 : TICK_INTERVAL;
    interfaces.global_vars->tickcount = TIME_TO_TICKS(interfaces.global_vars->curtime);

    interfaces.game_movement->StartTrackPredictionErrors(local);
    interfaces.move_helper->SetHost(local);

    //oh god help me plz do nice clean code
    m_nButtons = cmd->buttons;
    int buttonsChanged = cmd->buttons ^ *reinterpret_cast<int*>(uintptr_t(local) + 0x31E8);
    *reinterpret_cast<int*>(uintptr_t(local) + 0x31DC) = (uintptr_t(local) + 0x31E8);
    *reinterpret_cast<int*>(uintptr_t(local) + 0x31E8) = cmd->buttons;

    interfaces.game_movement->StartTrackPredictionErrors(local);

    memset(&data, 0, sizeof(data));
    interfaces.prediction->SetupMove(local, cmd, interfaces.move_helper, &data);
    interfaces.game_movement->ProcessMovement(local, &data);
    interfaces.prediction->FinishMove(local, cmd, &data);

}
void CEnginePrediction::Finish(IBasePlayer* local) {

    //plz spaces for the love of god
    interfaces.game_movement->FinishTrackPredictionErrors(local);
    interfaces.move_helper->SetHost(0);

    //restore the shit we fucked with use the stored values
    interfaces.global_vars->curtime = old_vars.curtime;
    interfaces.global_vars->frametime = old_vars.frametime;

}
i spend 5 secs fixing some crap i am not gonna spoon feed yous more u should replace the messy 1 u posted with this 1 dud
 
Последнее редактирование:
Начинающий
Статус
Оффлайн
Регистрация
4 Июл 2020
Сообщения
27
Реакции[?]
1
Поинты[?]
0
пж ликнете кому не трудно!!!!!!!!!!!!


а так предик хороший
EnginePrediction.cpp
C++:
#include "EnginePrediction.h"
#include "checksum_md5.h"
#include "AntiAims.h"
#include "xor.h"
void CEnginePrediction::Start(CUserCmd* cmd, IBasePlayer* local) {
    float flPrev = interfaces.global_vars->curtime;
    static ConVar* weapon_recoil_scale = interfaces.cvars->FindVar(xorstr_("weapon_recoil_scale"));
    static ConVar* view_recoil_tracking = interfaces.cvars->FindVar(xorstr_("view_recoil_tracking"));
    csgo->local->GetPunchAngle() * (weapon_recoil_scale ? weapon_recoil_scale->GetFloat() : 2.f);
    old_vars.curtime = interfaces.global_vars->curtime;
    old_vars.frametime = interfaces.global_vars->frametime;
    old_vars.tickcount = interfaces.global_vars->tickcount;
    interfaces.global_vars->curtime = TICKS_TO_TIME(local->GetTickBase()) - TICK_INTERVAL;
    interfaces.global_vars->frametime = m_bEnginePaused ? 0 : TICK_INTERVAL;
    interfaces.global_vars->tickcount = TIME_TO_TICKS(interfaces.global_vars->curtime);
    interfaces.global_vars->curtime = TICKS_TO_TIME(local->GetTickBase()) - TICK_INTERVAL;
    interfaces.global_vars->frametime = m_bEnginePaused ? 0 : TICK_INTERVAL;
    interfaces.game_movement->StartTrackPredictionErrors(local);
    interfaces.move_helper->SetHost(local);
    interfaces.global_vars->curtime = flPrev;
    m_nButtons = cmd->buttons;
    int buttonsChanged = cmd->buttons ^ *reinterpret_cast<int*>(uintptr_t(local) + 0x31E8);
    *reinterpret_cast<int*>(uintptr_t(local) + 0x31DC) = (uintptr_t(local) + 0x31E8);
    *reinterpret_cast<int*>(uintptr_t(local) + 0x31E8) = cmd->buttons;
    interfaces.game_movement->StartTrackPredictionErrors(local);
    memset(&data, 0, sizeof(data));
    interfaces.prediction->SetupMove(local, cmd, interfaces.move_helper, &data);
    interfaces.game_movement->ProcessMovement(local, &data);
    interfaces.prediction->FinishMove(local, cmd, &data);
    interfaces.global_vars-> curtime = flPrev;
}
void CEnginePrediction :: Finish (IBasePlayer * local) {
    interfaces.game_movement->FinishTrackPredictionErrors(local);
    interfaces.move_helper->SetHost(0);
    interfaces.global_vars-> curtime = old_vars.curtime;
    interfaces.global_vars->frametime = old_vars.frametime;
}
EnginePrediction.h
C++:
#pragma once
#include "hooks.h"
class CEnginePrediction: public Singleton <CEnginePrediction>
{
public:
    void Start(CUserCmd* cmd, IBasePlayer* local);
    void Finish(IBasePlayer* local);
    int     m_nButtons;
    bool m_bEnginePaused;
private:
    CMoveData data;
    struct {
        float curtime, frametime;
        int tickcount, tickbase;
    } old_vars;
};
its literally the same one
 
EyeAngel = ты просто пидр
Начинающий
Статус
Оффлайн
Регистрация
16 Сен 2019
Сообщения
82
Реакции[?]
21
Поинты[?]
0
Забаненный
Статус
Оффлайн
Регистрация
18 Июн 2020
Сообщения
506
Реакции[?]
90
Поинты[?]
0
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Ебать вообще норм предикт, теперь дт 1 тик с телепортом
 
Забаненный
Статус
Оффлайн
Регистрация
18 Июн 2020
Сообщения
506
Реакции[?]
90
Поинты[?]
0
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Тапает скит, скит миссает в аа, то что надо (не надо говорить что предикшен не связан с аа Я ЗНАЮ, просто написал по фану)
 
Сверху Снизу