It seems that doing:
Code:
SetEntPropVector(client, Prop_Data, "m_vecVelocity", vecNewVelocity);
Does not work. It seems like the value is enforced per frame, by the server. I get a rubber band effect. Even trying to set the player's velocity to zero, doesn't work for me.
Looks like I have finally got things working as I want, but I cannot stop the players movement. Here is the code I have to stop the player:
PHP Code:
//reset player velocity
decl Float:fVelocity_Current[3];
decl Float:fVelocity[3];
GetEntPropVector(client, Prop_Data, "m_vecVelocity", fVelocity_Current);
fVelocity[0] = (fVelocity_Current[0] * -1);
fVelocity[1] = (fVelocity_Current[1] * -1);
fVelocity[2] = (fVelocity_Current[2] * -1);
SetEntPropVector(client, Prop_Data, "m_vecBaseVelocity", fVelocity);
Presuming that m_vecBaseVelocity adds to m_vecVelocity, I am taking the current velocity and inverting it, so that the value added results in a 0.
Sadly, I cannot see any effect in testing.
I am doing this with a 1 second timer, that runs after the player's velocity is modified.
Hopefully when all this is solved, someone else out there will Google this and make use of it too.
Update:
I was rather tired, so missed an obvious solution... use that teleport function:
PHP Code:
new Float:fVelocity[3] = {0.0, 0.0, -9001.0};
TeleportEntity(client, NULL_VECTOR, NULL_VECTOR, fVelocity);
In order to prevent players dying from fall damage, I am granting a tiny bit of uber on them.