Raised This Month: $51 Target: $400
 12% 

Get real view angles


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Keplyx
Member
Join Date: Apr 2017
Location: France
Old 07-10-2017 , 16:58   Get real view angles
Reply With Quote #1

I'm trying to get the player orientation in the world as I'm moving, but I can't get it right for some reason.

I tried using

PHP Code:
GetClientAbsAngles(client_indexrot); 
and

PHP Code:
GetEntPropVector(client_indexProp_Send"m_angRotation"rot); 
called in OnPlayerRunCmd.

But they only give me the orientation each 90°. The value returned by these are only 0°, 90°, 180° or 270°, but I can move the camera between 0° and 360°. This problem seems to occur only with the player when I try to get the value
with OnPlayerRunCmd.

When parenting a prop to the player, it also only moves each 90°, not correctly following the player camera angles.

So I was wondering if there was a way to get the real, precise camera angles from the player.

I'm lost here, any help is appreciated!

(I'm making a CSGO plugin)
__________________
Keplyx is offline
Proz
AlliedModders Donor
Join Date: Apr 2005
Old 07-10-2017 , 17:05   Re: Get real view angles
Reply With Quote #2

https://sm.alliedmods.net/new-api/sd...lientEyeAngles
Proz is offline
Weetabix
Member
Join Date: Feb 2017
Location: United Kingdom
Old 07-10-2017 , 17:31   Re: Get real view angles
Reply With Quote #3

Another case of someone who fails to use the API correctly. Try using keywords in the future such as "angle" "eye" "view"

Last edited by Weetabix; 07-10-2017 at 17:31.
Weetabix is offline
Keplyx
Member
Join Date: Apr 2017
Location: France
Old 07-11-2017 , 03:07   Re: Get real view angles
Reply With Quote #4

Thanks guys it worked as expected!

But I still can't figure why the methods I used before worked for other entities, but not the player, or why an entity only rotates each 90° when parenting it to the player.
__________________
Keplyx is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:36.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode