Code:
void pfnSetClientMaxspeed(const edict_t *pEdict, float fNewMaxspeed)
{
int client_index;
if (debug_engine) { fp=fopen("HPB_bot.txt","a");
fprintf(fp,"pfnSetClientMaxspeed: edict=%x speed=%f\n",pEdict,fNewMaxspeed); fclose(fp); }
for (client_index = 1; client_index < MAX_CLIENTS; client_index++)
{
if (clients[client_index].is_used)
clients[client_index].max_speed = fNewMaxspeed;
}
(*g_engfuncs.pfnSetClientMaxspeed)(pEdict, fNewMaxspeed);
}
This is what im using for TOD and DOD.
Although TOD is spamming the system continiosly with the pfnSetClientMaxspeed, DOD only sends it when the clients speed changes.
In dod the speed also depends what gun and if the gun is deployed.
In that case there are more speeds to recorded for each class and gun. crouching etc etc.
=================
edit.
I recorded only the main speeds like when a client crouches.
It may varie a little but when the speed is below a certain level.
The game dll knows it's slow enuf to stop footstep sounds.
Or when the speed is low enuf the game knows it can't move because it is like zoomed or deployed.
However im not sure fo CS code. (as i don't code for cs)