Raised This Month: $32 Target: $400
 8% 

Get real player view angles


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
karaulov
Senior Member
Join Date: Jul 2018
Old 01-18-2022 , 07:10   Get real player view angles
Reply With Quote #1

Code:
static cell AMX_NATIVE_CALL test_view_angles(AMX* amx, cell* params) // 1 pararam
{
	int index = params[1];
	if (!IsPlayerSafe(index))
	{
		MF_LogError(amx, AMX_ERR_NATIVE, "Cannot access player %d, it's not safe enough!", index);
		return 0;
	}

	edict_t* pPlayer = MF_GetPlayerEdict(index);

	char msg[256];
	snprintf(msg, sizeof(msg), "Angle %f %f %f", pPlayer->v.v_angle[0], pPlayer->v.v_angle[1], pPlayer->v.v_angle[2]);

	UTIL_TextMsg(index, msg);

	
	return 0;
}
And

Code:
public PrintViewAngles(Index)
{
	test_view_angles(Index)
	new msg[256];
	new Float:Angles[3];
	pev(Index,pev_v_angle,Angles);
	client_print_color(Index,Index,"Amxx Angles: %f %f %f", Angles[0],Angles[1],Angles[2]);
	get_entvar(Index,var_v_angle,Angles);
	client_print_color(Index,Index,"Amxx Angles 2: %f %f %f", Angles[0],Angles[1],Angles[2]);
}
I got next result:

Metamod module:
Angle 1.664429 -157.615356 0.000000
pev:
Amxx Angles: 1.664428 -106.303710 0.000000
get_entvar:
Amxx Angles 2: 1.664428 -106.303710 0.000000
karaulov is offline
karaulov
Senior Member
Join Date: Jul 2018
Old 01-18-2022 , 07:16   Re: Get real player view angles
Reply With Quote #2

Fixed) Close
karaulov is offline
Shadows Adi
AlliedModders Donor
Join Date: Aug 2019
Location: Romania
Old 01-18-2022 , 07:47   Re: Get real player view angles
Reply With Quote #3

Quote:
Originally Posted by karaulov View Post
Fixed) Close
Post the solution.
__________________


Accepting Paid Requests, contact PM.

MVP Of The Round View project on GITHUB / AlliedModders
CSGO REMAKE ~ CSGO MOD [STABLE + SOURCE CODE]
Shadows Adi 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 23:12.


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