Raised This Month: $ Target: $400
 0% 

Solved Calling GetClientEyeAngles from OnPlayerRunCmd


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
shavit
AlliedModders Donor
Join Date: Dec 2011
Location: Israel
Old 05-22-2017 , 16:08   Calling GetClientEyeAngles from OnPlayerRunCmd
Reply With Quote #1

Hi, I'm rewriting an old plugin by an inactive author and am trying to optimize it.

Code:
public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3], float angles[3])
{
	if(!IsPlayerAlive(client))
	{
		return Plugin_Continue;
	}

	float ang[3];
	GetClientEyeAngles(client, ang);

	// code(client. ang);

	return Plugin_Continue;
}
Is calling GetClientEyeAngles() fine, or do I get the same result from angles[3] as a parameter from OnPlayerRunCmd?

Thanks.
__________________
retired

Last edited by shavit; 05-22-2017 at 16:37.
shavit is offline
Bobakanoosh
Senior Member
Join Date: Sep 2015
Location: United States
Old 05-22-2017 , 16:24   Re: Calling GetClientEyeAngles from OnPlayerRunCmd
Reply With Quote #2

https://sm.alliedmods.net/new-api/sd...OnPlayerRunCmd

According to the documentation angles[3] is the same thing as GetClientEyeAngles, so yea, don't use GetClientEyeAngles.
Bobakanoosh is offline
shavit
AlliedModders Donor
Join Date: Dec 2011
Location: Israel
Old 05-22-2017 , 16:35   Re: Calling GetClientEyeAngles from OnPlayerRunCmd
Reply With Quote #3

Quote:
Originally Posted by Bobakanoosh View Post
https://sm.alliedmods.net/new-api/sd...OnPlayerRunCmd

According to the documentation angles[3] is the same thing as GetClientEyeAngles, so yea, don't use GetClientEyeAngles.
Thank you!
__________________
retired
shavit is offline
psychonic

BAFFLED
Join Date: May 2008
Old 05-22-2017 , 17:25   Re: Calling GetClientEyeAngles from OnPlayerRunCmd
Reply With Quote #4

GetClientEyeAngles gets you the current value. Reading the angles from the usercmd tells you what value the client is sending, and what the value will be later in the frame, if the server accepts the value.
psychonic 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 05:36.


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