Hello everyone. I don't know if this place is active or not, but I thought I'd give it a try and make my first post. I'm attempting to make a simple SourceMod plugin for Portal that outputs the look direction of the player to a file in real-time. However, when I use the GetClientEyeAngles() function to store the look direction, the function returns false and doesn't store any data. Here is my code:
Code:
#include <sourcemod>
#include <sdktools>
public Plugin myinfo = {
name = "Portal Plugin",
author = "Me",
description = "Portal Plugin",
version = "1.0",
};
public void OnGameFrame() {
new Float:eyeAng[3];
if (!GetClientEyeAngles(1, eyeAng)) {
PrintToChat(1, "Failed");
}
PrintToChat(1,"Look Angle: %f, %f, %f", eyeAng[0], eyeAng[1], eyeAng[2]);
}
As you can see, I attempt to call this function every game frame. I then create a float vector for the data to be stored in and try to call the function. I print "Failed" to the chat if the function returns false, which according to the documentation at
https://sourcemod.dev/#/sdktools_fun...lientEyeAngles means that the function failed in some way. I also attempt to print the values stored in eyeAng to the chat, which should show the result of GetClientEyeAngles() but instead displays nothing but 0 for each value.
I'm not sure exactly why this function is failing. There don't seem to be any errors or compiling issues and after reading the documentation, I believe I'm using the function properly. Any help with this issue? Thanks a lot!