решил сделать дтапчик а оно не работает че делать
вот хукич
как вызываю в криеитмувчике
чтонетак
вот хукич
Код:
bool __fastcall WriteUsercmdDeltaToBuffer_hook(void* ecx, void*, int slot, bf_write* buf, int from, int to, bool isnewcommand) {
static auto original_fn = hlclient_hook.get_original<decltype(&WriteUsercmdDeltaToBuffer_hook)>(24);
if (!g_EngineClient->IsConnected())
{
GlobalVars::tickbaseshit = 0;
return original_fn(g_CHLClient, ecx, slot, buf, from, to, isnewcommand);
}
if (GlobalVars::tickbaseshit <= 0)
{
return original_fn(g_CHLClient,ecx, slot, buf, from, to, isnewcommand);
}
if (from != -1)
{
return true;
}
auto CL_SendMove = []()
{
using CL_SendMove_t = void(__fastcall*)(void);
static CL_SendMove_t CL_SendMoveF = (CL_SendMove_t)Utils::PFindPattern("engine.dll", "55 8B EC A1 ? ? ? ? 81 EC ? ? ? ? B9 ? ? ? ? 53 8B 98");
CL_SendMoveF();
};
auto WriteUsercmd = [](bf_write* buf, CUserCmd* in, CUserCmd* out)
{
using WriteUsercmd_t = void(__fastcall*)(bf_write*, CUserCmd*, CUserCmd*);
static WriteUsercmd_t WriteUsercmdF = (WriteUsercmd_t)Utils::PFindPattern("client_panorama.dll", "55 8B EC 83 E4 F8 51 53 56 8B D9 8B 0D");
WriteUsercmdF(buf, in, out);
};
int* pNumBackupCommands = (int*)(reinterpret_cast <uintptr_t> (buf) - 0x30);
int* pNumNewCommands = (int*)(reinterpret_cast <uintptr_t> (buf) - 0x2C);
int32_t new_commands = *pNumNewCommands;
int32_t next_cmdnr = g_ClientState->m_nLastOutgoingCommand + g_ClientState->m_nChokedCommands + 1;
int32_t total_new_commands = std::min(GlobalVars::tickbaseshit, 16);
GlobalVars::tickbaseshit -= total_new_commands;
from = -1;
*pNumNewCommands = total_new_commands;
*pNumBackupCommands = 0;
for (to = next_cmdnr - new_commands + 1; to <= next_cmdnr; to++)
{
if (!original_fn(g_CHLClient,ecx, slot, buf, from, to, isnewcommand))
{
return false;
}
from = to;
}
CUserCmd* last_realCmd = g_Input->GetUserCmd(slot, from);
CUserCmd fromCmd;
if (last_realCmd)
{
fromCmd = *last_realCmd;
}
CUserCmd toCmd = fromCmd;
toCmd.command_number++;
toCmd.tick_count += 200;
for (int i = new_commands; i <= total_new_commands; i++)
{
WriteUsercmd(buf, &toCmd, &fromCmd);
fromCmd = toCmd;
toCmd.command_number++;
toCmd.tick_count++;
}
return true;
}
как вызываю в криеитмувчике
Код:
static int lastDoubleTapInTickcount = 0;
if (cmd->buttons & IN_ATTACK)
{
int doubletapTickcountDelta = g_GlobalVars->tickcount - lastDoubleTapInTickcount;
if (doubletapTickcountDelta >= TIME_TO_TICKS(2.0f)) {
lastDoubleTapInTickcount = g_GlobalVars->tickcount;
GlobalVars::tickbaseshit = TIME_TO_TICKS(0.2f);
}
}
Если по теме то хз