Server-Sided function to detect when a client changes their aim

Author Topic: Server-Sided function to detect when a client changes their aim  (Read 583 times)

After tracing I found out that the client calls functions pitch(); and yaw(); to change the aim, but I could not find a server-sided function which is called when a client adjusts their aim.

There is another function called called "getMouseAdjustAmount()" but it appears to be client sided.

Does anyone know a server-sided function to check if someone changed their aim?


I don't know that there is anything on the server side at the script level.

If someone more knowledgeable doesn't appear, a last resort would be to schedule periodic checks on the player to see if their .getEyeVector() has changed.

There isn't a callback for people adjusting their sights. However, what you can do is set up a tick that compares the player's eyeVector.

Something like..
Code: [Select]
if(%eyeVector $= %client.oldEyeVector) {
   eyeMoved(vectorDist(%eyeVector,%client.oldEyeVector));
}
%client.oldEyeVector = %eyeVector;

in a loop.
« Last Edit: August 04, 2013, 01:08:56 PM by $trinick »