PHP Code:
stock SetEntitySpeed(Client, Float:fSpeed)
{
//Set Prop Data:
SetEntPropFloat(Client, Prop_Data, "m_flLaggedMovementValue", fSpeed);
}
stock SetSpeed(Client, Float:Speed)
{
//Declare:
new SpeedOffset = -1;
//Initialize:
SpeedOffset = FindSendPropOffs("CHL2MP_Player", "m_flMaxspeed");
//Set Speed:
if(SpeedOffset > 0) SetEntData(Client, SpeedOffset, Speed, 4, true);
}
Some of these are really mis-named. SetEntityTimeScale and SetEntityMaxSpeed would be much better.
Also the second might work better if you get the clients netclass instead of using a specific one.