Originally Posted by
WasserEsser
Use a timer and a condition instead of sleep.
Please ignore that it is blatantly copy pasted
Code:
static clock_t start_t = clock();
double timeSoFar = (double)(clock() - start_t) / CLOCKS_PER_SEC;
if (timeSoFar < 0.25)
return;
start_t = clock();
Is this something similar to what you mean? Sorry if I offend you with my lack of c++ knowledge but what I tried to do is
Code:
static clock_t start_t = clock();
double timeSoFar = (double)(clock() - start_t) / CLOCKS_PER_SEC;
if (timeSoFar < 0.25)
return;
if (pCmd->buttons & IN_JUMP && GUI.GetKeyState(VK_SPACE))
{
int iFlags = hackManager.pLocal()->GetFlags();
if (!(iFlags & FL_ONGROUND))
pCmd->buttons &= ~IN_JUMP;
start_t = clock();
Should I do
Code:
if (pCmd->buttons & IN_JUMP && GUI.GetKeyState(VK_SPACE) && timeSoFar > 0.25))
?
Or just stick to what I did above.
Should I implement it with
Code:
pCmd->buttons &= ~IN_JUMP;
?